]> git.eshelyaron.com Git - emacs.git/commitdiff
Conditionally initialize rcirc-input-ring
authorLeo Liu <sdl.web@gmail.com>
Wed, 7 Sep 2011 03:37:22 +0000 (11:37 +0800)
committerLeo Liu <sdl.web@gmail.com>
Wed, 7 Sep 2011 03:37:22 +0000 (11:37 +0800)
lisp/ChangeLog
lisp/net/rcirc.el

index 979708e2c919c77c264207dbbdb4a4f2bc75af46..310fb42a1558b98d03a66018380f7c097cc4ed49 100644 (file)
@@ -1,3 +1,8 @@
+2011-09-07  Leo Liu  <sdl.web@gmail.com>
+
+       * net/rcirc.el (rcirc-mode): Conditionally initialize
+       rcirc-input-ring.
+
 2011-09-07  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/find-func.el (find-function-C-source): Only set
index 06bbfb0b78c6605c6e1c9d325c679779ef2c6b65..51a087bc0843ecdd6b9d9df575fcd7a4e0e6cf52 100644 (file)
@@ -964,7 +964,13 @@ This number is independent of the number of lines in the buffer.")
   (setq mode-line-process nil)
 
   (set (make-local-variable 'rcirc-input-ring)
-       (make-ring rcirc-input-ring-size))
+       ;; If rcirc-input-ring is already a ring with desired size do
+       ;; not re-initialize.
+       (if (and (ring-p rcirc-input-ring)
+               (= (ring-size rcirc-input-ring)
+                  rcirc-input-ring-size))
+          rcirc-input-ring
+        (make-ring rcirc-input-ring-size)))
   (set (make-local-variable 'rcirc-server-buffer) (process-buffer process))
   (set (make-local-variable 'rcirc-target) target)
   (set (make-local-variable 'rcirc-topic) nil)