]> code.delx.au - gnu-emacs/blobdiff - lisp/eshell/em-hist.el
Merge changes from emacs-23 branch
[gnu-emacs] / lisp / eshell / em-hist.el
index 1f6442613378860b66add8cf3791d2370ba2ca9d..82c9b0ccfc31df6cd711bc84e051320f9b9d2a08 100644 (file)
@@ -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)))))