aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu2010-12-17 19:04:40 +0800
committerChong Yidong2010-12-17 19:04:40 +0800
commitc33fa63197e674bf95097b3dfb9d1cb3bfd8ac62 (patch)
tree691e49ff2bb0e31aca37a395f82f84a0897f85a6
parent4bf3e46ed9236e0a8cfc538583c981468255357a (diff)
downloademacs-c33fa63197e674bf95097b3dfb9d1cb3bfd8ac62.tar.gz
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).
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/eshell/em-hist.el4
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 @@
12010-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
12010-12-16 Chong Yidong <cyd@stupidchicken.com> 62010-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.
837If N is negative, find the next or Nth next match." 837If 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