X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/ae940284fa77a6928f5162b7de859e67bdc7506c..937e6a5612df742722aadd1e2d190f3ef7165952:/lisp/erc/erc-truncate.el?ds=sidebyside diff --git a/lisp/erc/erc-truncate.el b/lisp/erc/erc-truncate.el index 137152ca99..1a0e205056 100644 --- a/lisp/erc/erc-truncate.el +++ b/lisp/erc/erc-truncate.el @@ -66,8 +66,7 @@ region is logged if `erc-logging-enabled' returns non-nil." (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 behavior in