X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/6eabc4c2f76441f11cc344891d3849ad3631ab15..dd92b5f5047931f6020045ce47360b62d1c2cb72:/lisp/erc/erc-ring.el diff --git a/lisp/erc/erc-ring.el b/lisp/erc/erc-ring.el index 95c313a23f..b00be95c4f 100644 --- a/lisp/erc/erc-ring.el +++ b/lisp/erc/erc-ring.el @@ -1,18 +1,18 @@ ;; 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 +;; 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 @@ -20,9 +20,7 @@ ;; 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 . ;;; Commentary: @@ -40,6 +38,10 @@ (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 @@ -56,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.") @@ -65,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) @@ -145,5 +148,3 @@ containing a password." ;; Local Variables: ;; indent-tabs-mode: nil ;; End: - -;; arch-tag: b77924a8-a80e-489d-84cd-b351761ea5c8