GNU bug report logs - #7585
23.2.90; [PATCH] fix eshell-previous-matching-input

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Tue, 7 Dec 2010 18:46:01 UTC

Severity: normal

Tags: patch

Found in version 23.2.90

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.2.90; [PATCH] fix eshell-previous-matching-input
Date: Tue, 07 Dec 2010 18:51:07 +0000
There is a customisable variable eshell-hist-move-to-end when set to
nil, point is not guaranteed to be located behind
eshell-last-output-end. Thus blindly calling delete-region and
insert-and-inherit will generate an error in that case.


diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el
index 45fe050..defaf5a 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))
+  (assert (<= eshell-last-output-end (point))
+	  nil "Point not located after prompt")
   (let ((pos (eshell-previous-matching-input-string-position regexp arg)))
     ;; Has a match been found?
     (if (null pos)




This bug report was last modified 14 years and 161 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.