;;; erc-truncate.el --- Functions for truncating ERC buffers
-;; Copyright (C) 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
;; Author: Andreas Fuchs <asf@void.at>
;; Keywords: IRC, chat, client, Internet, logging
(unless (get-buffer buffer)
(error "erc-truncate-buffer-to-size: %S is not a buffer" buffer)))
(when (> (buffer-size buffer) (+ size 512))
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
;; Note that when erc-insert-post-hook runs, the buffer is
;; narrowed to the new message. So do this delicate widening.
- ;; I am not sure, I think this was not recommended behaviour in
+ ;; I am not sure, I think this was not recommended behavior in
;; Emacs 20.
(save-restriction
(widen)