]> code.delx.au - gnu-emacs/blobdiff - lisp/erc/erc-ring.el
; Merge from origin/emacs-25
[gnu-emacs] / lisp / erc / erc-ring.el
index 94af8a092005c712b73b0506aabd17c5e5000fb8..b00be95c4faee29282b9070eaa9c087225cd796e 100644 (file)
@@ -1,8 +1,9 @@
 ;; erc-ring.el -- Command history handling for erc using ring.el
 
-;; Copyright (C) 2001-2004, 2006-2012 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2004, 2006-2016 Free Software Foundation, Inc.
 
 ;; Author: Alex Schroeder <alex@gnu.org>
+;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: comm
 ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcHistory
 
 (require 'comint)
 (require 'ring)
 
+(defgroup erc-ring nil
+  "An input ring for ERC."
+  :group 'erc)
+
 ;;;###autoload (autoload 'erc-ring-mode "erc-ring" nil t)
 (define-erc-module ring nil
   "Stores input in a ring so that previous commands and messages can
@@ -53,7 +58,7 @@ be recalled using M-p and M-n."
 
 (defvar erc-input-ring-index nil
   "Position in the input ring for erc.
-If nil, the input line is blank and the user is conceptually 'after'
+If nil, the input line is blank and the user is conceptually after
 the most recently added item in the ring. If an integer, the input
 line is non-blank and displays the item from the ring indexed by this
 variable.")
@@ -62,7 +67,8 @@ variable.")
 (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)
@@ -142,4 +148,3 @@ containing a password."
 ;; Local Variables:
 ;; indent-tabs-mode: nil
 ;; End:
-