]> code.delx.au - gnu-emacs/blobdiff - lisp/erc/erc-ring.el
Merge from emacs-24
[gnu-emacs] / lisp / erc / erc-ring.el
index 345c636fa79b31ef669b1f060a9173485bc1105e..682585c53bbcc32d16c050ac8d0c71833c782c23 100644 (file)
@@ -1,8 +1,9 @@
 ;; erc-ring.el -- Command history handling for erc using ring.el
 
-;; Copyright (C) 2001-2004, 2006-2011 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2004, 2006-2014 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
@@ -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)