Source

erc / erc-ring.el

Diff from to

erc-ring.el

 ;; erc-ring.el -- Command history handling for erc using ring.el
 
-;; Copyright (C) 2001,2002,2003,2004 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
 ;; Author: Alex Schroeder <alex@gnu.org>
 ;; Keywords: comm
 ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcHistory
 
-;; This file is free software; you can redistribute it and/or modify
+;; This file is part of GNU Emacs.
+
+;; 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.
 
-;; This file is distributed in the hope that it will be useful,
+;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; 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 St, Fifth Floor,
-;; Boston, MA 02110-1301 USA
+;; 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.
 
 ;;; Commentary:
 
 containing a password."
   (interactive)
   (setq erc-input-ring (make-ring comint-input-ring-size)
-	erc-input-ring-index nil)
+        erc-input-ring-index nil)
   (garbage-collect)
   (message "ERC input ring cleared."))
 
           (erc-replace-current-command "")
           (setq erc-input-ring-index nil))
 
-      ;; If we are not viewing old input and there's text in the input area, push
-      ;; it on the history ring before moving back through the input history, so it
-      ;; will be there when we return to the front.
+      ;; If we are not viewing old input and there's text in the input
+      ;; area, push it on the history ring before moving back through
+      ;; the input history, so it will be there when we return to the
+      ;; front.
       (if (null erc-input-ring-index)
-          (let ((start-of-input (save-excursion (goto-char erc-insert-marker) (erc-bol))))
-            (when (> (point-max) start-of-input)
-              (erc-add-to-input-ring (buffer-substring start-of-input (point-max)))
-              (setq erc-input-ring-index 0))))
+          (when (> (point-max) erc-input-marker)
+            (erc-add-to-input-ring (buffer-substring erc-input-marker
+                                                     (point-max)))
+            (setq erc-input-ring-index 0)))
 
       (setq erc-input-ring-index (if erc-input-ring-index
                                      (ring-plus1 erc-input-ring-index
                                                  (ring-length erc-input-ring))
                                    0))
-      (erc-replace-current-command (ring-ref erc-input-ring erc-input-ring-index)))))
+      (erc-replace-current-command (ring-ref erc-input-ring
+                                             erc-input-ring-index)))))
 
 (defun erc-next-command ()
   "Replace current command with the next one from the history."
 (provide 'erc-ring)
 
 ;;; erc-ring.el ends here
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; End:
+
+;; arch-tag: b77924a8-a80e-489d-84cd-b351761ea5c8