From: Leo Liu Date: Wed, 7 Sep 2011 03:37:22 +0000 (+0800) Subject: Conditionally initialize rcirc-input-ring X-Git-Tag: emacs-pretest-24.0.90~104^2~148 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=183fc730a3fd2f113d16125a90ef23ee5fd3659c;p=emacs.git Conditionally initialize rcirc-input-ring --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 979708e2c91..310fb42a155 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-09-07 Leo Liu + + * net/rcirc.el (rcirc-mode): Conditionally initialize + rcirc-input-ring. + 2011-09-07 Stefan Monnier * emacs-lisp/find-func.el (find-function-C-source): Only set diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 06bbfb0b78c..51a087bc084 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -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)