diff options
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/eshell/em-hist.el | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8eda1582948..9d3b38bba11 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2010-12-17 Leo <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * eshell/em-hist.el (eshell-previous-matching-input): Signal error | ||
| 4 | if point is not behind eshell-last-output-end (Bug#7585). | ||
| 5 | |||
| 1 | 2010-12-16 Chong Yidong <cyd@stupidchicken.com> | 6 | 2010-12-16 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 7 | ||
| 3 | * textmodes/rst.el (rst-compile-pdf-preview) | 8 | * textmodes/rst.el (rst-compile-pdf-preview) |
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. | |||
| 837 | If N is negative, find the next or Nth next match." | 837 | If N is negative, find the next or Nth next match." |
| 838 | (interactive (eshell-regexp-arg "Previous input matching (regexp): ")) | 838 | (interactive (eshell-regexp-arg "Previous input matching (regexp): ")) |
| 839 | (setq arg (eshell-search-arg arg)) | 839 | (setq arg (eshell-search-arg arg)) |
| 840 | (if (> eshell-last-output-end (point)) | ||
| 841 | (error "Point not located after prompt")) | ||
| 840 | (let ((pos (eshell-previous-matching-input-string-position regexp arg))) | 842 | (let ((pos (eshell-previous-matching-input-string-position regexp arg))) |
| 841 | ;; Has a match been found? | 843 | ;; Has a match been found? |
| 842 | (if (null pos) | 844 | (if (null pos) |
| @@ -844,7 +846,7 @@ If N is negative, find the next or Nth next match." | |||
| 844 | (setq eshell-history-index pos) | 846 | (setq eshell-history-index pos) |
| 845 | (unless (minibuffer-window-active-p (selected-window)) | 847 | (unless (minibuffer-window-active-p (selected-window)) |
| 846 | (message "History item: %d" (- (ring-length eshell-history-ring) pos))) | 848 | (message "History item: %d" (- (ring-length eshell-history-ring) pos))) |
| 847 | ;; Can't use kill-region as it sets this-command | 849 | ;; Can't use kill-region as it sets this-command |
| 848 | (delete-region eshell-last-output-end (point)) | 850 | (delete-region eshell-last-output-end (point)) |
| 849 | (insert-and-inherit (eshell-get-history pos))))) | 851 | (insert-and-inherit (eshell-get-history pos))))) |
| 850 | 852 | ||