Subject: erc-input-ring-setup: do not reset the ring when there already is one
From: Ivan Shmakov <[email-masked]>
To: [email-masked]
Date: Thu, 02 Oct 2014 05:11:03 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Package: emacs
X-Debbugs-Cc: [email-masked], Kashish Sharma <[email-masked]>

>>>>> Kashish Sharma <[email-masked]> writes:

[…]

 > 2. (what seems like another bug -) Input history is lost if one
 > disconnects/reconnects.

	Please consider the patch MIMEd.

	(This one was also recently pointed out on IRC, BTW.)

 > Wishlist - input history remembered across Emacs sessions.  Perhaps
 > with the option of setting the history size.

[…]

-- 
FSF associate member #7257  http://boycottsystemd.org/  … 3013 B6A0 230E 334A
--- a/lisp/erc/erc-ring.el
+++ b/lisp/erc/erc-ring.el
@@ -67,7 +67,8 @@
 (defun erc-input-ring-setup ()
   "Do the setup required so that we can use comint style input rings.
 Call this function when setting up the mode."
-  (setq erc-input-ring (make-ring comint-input-ring-size))
+  (unless (ring-p erc-input-ring)
+    (setq erc-input-ring (make-ring comint-input-ring-size)))
   (setq erc-input-ring-index nil))
 
 (defun erc-add-to-input-ring (s)