]> code.delx.au - gnu-emacs/blobdiff - lisp/erc/erc-truncate.el
* lisp/progmodes/compile.el (compilation-always-kill): New var.
[gnu-emacs] / lisp / erc / erc-truncate.el
index 0737fb1a0b77a1e500d4811982a3ed2a48beb732..dd47c601ea896af64bc5d19305b66e72dec05f22 100644 (file)
@@ -1,6 +1,6 @@
 ;;; erc-truncate.el --- Functions for truncating ERC buffers
 
-;; Copyright (C) 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2004, 2006-2012 Free Software Foundation, Inc.
 
 ;; Author: Andreas Fuchs <asf@void.at>
 ;; Keywords: IRC, chat, client, Internet, logging
@@ -36,7 +36,7 @@
   :group 'erc)
 
 (defcustom erc-max-buffer-size 30000
-  "*Maximum size in chars of each ERC buffer.
+  "Maximum size in chars of each ERC buffer.
 Used only when auto-truncation is enabled.
 \(see `erc-truncate-buffer' and `erc-insert-post-hook')."
   :group 'erc-truncate
@@ -66,11 +66,10 @@ 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 behaviour in
+      ;; I am not sure, I think this was not recommended behavior in
       ;; Emacs 20.
       (save-restriction
        (widen)
@@ -116,4 +115,3 @@ Meant to be used in hooks, like `erc-insert-post-hook'."
 ;; tab-width: 8
 ;; End:
 
-;; arch-tag: 22a2ea78-871f-4870-8f1e-efe534170311