# HG changeset patch # User Chong Yidong # Date 1292583880 -28800 # Node ID 27e06e53f81bd7fb5d2f4016f5dee9d6a6c1592a # Parent 9cd818c8f3e0d1eb5dff61213bb3e0a1beccfef2 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). diff -r 9cd818c8f3e0 -r 27e06e53f81b lisp/ChangeLog --- a/lisp/ChangeLog Thu Dec 16 10:13:28 2010 +0800 +++ b/lisp/ChangeLog Fri Dec 17 19:04:40 2010 +0800 @@ -1,3 +1,8 @@ +2010-12-17 Leo + + * eshell/em-hist.el (eshell-previous-matching-input): Signal error + if point is not behind eshell-last-output-end (Bug#7585). + 2010-12-16 Chong Yidong * textmodes/rst.el (rst-compile-pdf-preview) diff -r 9cd818c8f3e0 -r 27e06e53f81b lisp/eshell/em-hist.el --- a/lisp/eshell/em-hist.el Thu Dec 16 10:13:28 2010 +0800 +++ b/lisp/eshell/em-hist.el Fri Dec 17 19:04:40 2010 +0800 @@ -837,6 +837,8 @@ 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 @@ (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)))))