Mercurial > emacs
diff lisp/eshell/em-hist.el @ 112098:40af77a50adc
Merge changes from emacs-23 branch
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sun, 02 Jan 2011 15:28:40 -0500 |
parents | f57f72bb4757 27e06e53f81b |
children | 417b1e4d63cd |
line wrap: on
line diff
--- a/lisp/eshell/em-hist.el Sun Jan 02 11:23:02 2011 +0000 +++ b/lisp/eshell/em-hist.el Sun Jan 02 15:28:40 2011 -0500 @@ -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)))))