]> code.delx.au - gnu-emacs/blobdiff - lisp/eshell/em-hist.el
Merge from emacs-23; up to 2010-06-03T22:16:02Z!dann@ics.uci.edu
[gnu-emacs] / lisp / eshell / em-hist.el
index 1f6442613378860b66add8cf3791d2370ba2ca9d..993e9d63a94a8b7cd30178ce349819bfb652ac98 100644 (file)
@@ -1,7 +1,6 @@
 ;;; em-hist.el --- history list management
 
-;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-;;   2008, 2009, 2010  Free Software Foundation, Inc.
+;; Copyright (C) 1999-2011  Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
@@ -71,8 +70,9 @@
 
 ;;; User Variables:
 
-(defcustom eshell-hist-load-hook '(eshell-hist-initialize)
+(defcustom eshell-hist-load-hook nil
   "A list of functions to call when loading `eshell-hist'."
+  :version "24.1"                      ; removed eshell-hist-initialize
   :type 'hook
   :group 'eshell-hist)
 
@@ -293,7 +293,7 @@ element, regardless of any text on the command line.  In that case,
 
 (defun eshell-save-some-history ()
   "Save the history for any open Eshell buffers."
-  (eshell-for buf (buffer-list)
+  (dolist (buf (buffer-list))
     (if (buffer-live-p buf)
        (with-current-buffer buf
          (if (and eshell-mode
@@ -731,7 +731,7 @@ matched."
          (narrow-to-region here (point))
          (goto-char (point-min))
          (let ((modifiers (cdr (eshell-parse-modifiers))))
-           (eshell-for mod modifiers
+           (dolist (mod modifiers)
              (setq hist (funcall mod hist)))
            hist))
       (delete-region here (point)))))
@@ -837,6 +837,8 @@ With prefix argument N, search for Nth previous match.
 If N is negative, find the next or Nth next match."
   (interactive (eshell-regexp-arg "Previous input matching (regexp): "))
   (setq arg (eshell-search-arg arg))
+  (if (> eshell-last-output-end (point))
+      (error "Point not located after prompt"))
   (let ((pos (eshell-previous-matching-input-string-position regexp arg)))
     ;; Has a match been found?
     (if (null pos)
@@ -844,7 +846,7 @@ If N is negative, find the next or Nth next match."
       (setq eshell-history-index pos)
       (unless (minibuffer-window-active-p (selected-window))
        (message "History item: %d" (- (ring-length eshell-history-ring) pos)))
-       ;; Can't use kill-region as it sets this-command
+      ;; Can't use kill-region as it sets this-command
       (delete-region eshell-last-output-end (point))
       (insert-and-inherit (eshell-get-history pos)))))
 
@@ -996,5 +998,4 @@ If N is negative, search backwards for the -Nth previous match."
 ;; generated-autoload-file: "esh-groups.el"
 ;; End:
 
-;; arch-tag: 1a847333-f864-4b96-9acd-b549d620b6c6
 ;;; em-hist.el ends here