diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2011-01-02 15:31:19 -0500 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2011-01-02 15:31:19 -0500 |
commit | 7c420169baa7c50428589cca7f8eda71b462eb15 (patch) | |
tree | b556f9e181818bbaf8b5b425844b4ae26e88f537 /lisp/eshell | |
parent | bb7f5cbcda931661c8dc3311603ac764fa87a639 (diff) | |
parent | d12f22f52cb7bb18b46f5ea8de5d8e8e04733e3f (diff) | |
download | emacs-7c420169baa7c50428589cca7f8eda71b462eb15.tar.gz |
Merge changes from emacs-23 branch
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 1f644261337..82c9b0ccfc3 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))))) |