;; erc-ring.el -- Command history handling for erc using ring.el
-;; Copyright (C) 2001, 2002, 2003, 2004, 2006,
-;; 2007 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
;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
(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
(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.")
(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)
;; Local Variables:
;; indent-tabs-mode: nil
;; End:
-
-;; arch-tag: b77924a8-a80e-489d-84cd-b351761ea5c8