diff options
author | Leo Liu <sdl.web@gmail.com> | 2010-12-17 19:04:40 +0800 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2010-12-17 19:04:40 +0800 |
commit | c33fa63197e674bf95097b3dfb9d1cb3bfd8ac62 (patch) | |
tree | 691e49ff2bb0e31aca37a395f82f84a0897f85a6 /lisp/eshell | |
parent | 4bf3e46ed9236e0a8cfc538583c981468255357a (diff) | |
download | emacs-c33fa63197e674bf95097b3dfb9d1cb3bfd8ac62.tar.gz emacs-c33fa63197e674bf95097b3dfb9d1cb3bfd8ac62.tar.bz2 emacs-c33fa63197e674bf95097b3dfb9d1cb3bfd8ac62.zip |
Minor fix for eshell-previous-matching-input (Bug#7585).
* lisp/eshell/em-hist.el (eshell-previous-matching-input): Signal error
if point is not behind eshell-last-output-end (Bug#7585).
Diffstat (limited to 'lisp/eshell')
-rw-r--r-- | lisp/eshell/em-hist.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el index 37a926f888a..7f2e3b4b1a5 100644 --- a/lisp/eshell/em-hist.el +++ b/lisp/eshell/em-hist.el @@ -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))))) |