GNU bug report logs - #21737
24.5; Minor feature request: `comint-previous-matching-input-from-input' and point

Previous Next

Package: emacs;

Reported by: Eli Barzilay <eli <at> barzilay.org>

Date: Thu, 22 Oct 2015 20:30:05 UTC

Severity: wishlist

Found in version 24.5

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Stephen Perry <stevoooo <at> gmail.com>
To: 21737 <at> debbugs.gnu.org
Subject: Re: bug#21737: Acknowledgement (24.5;
 Minor feature request: `comint-previous-matching-input-from-input'
 and point)
Date: Fri, 13 Nov 2015 22:30:45 +0000
How about this for a patch?  It’s my first so be kind :-)

diff --git a/lisp/comint.el b/lisp/comint.el
index e70fe88..8d61226 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -283,6 +283,14 @@ comint-move-point-for-output
 		 (const others))
   :group 'comint)
 
+(defcustom comint-move-point-to-end-on-match nil
+  "Controls whether point moves to the end of the matched input.
+If nil, then point remains in the current position.
+If t, point moves to the end of matched input."
+  :type '(choice (const :tag "off" nil)
+                 (const t))
+  :group 'comint)
+
 (defvaralias 'comint-scroll-to-bottom-on-output 'comint-move-point-for-output)
 
 (defcustom comint-scroll-show-maximum-output t
@@ -1220,7 +1228,8 @@ comint-previous-matching-input-from-input
     (comint-previous-matching-input
      (concat "^" (regexp-quote comint-matching-input-from-input-string))
      n)
-    (goto-char opoint)))
+    (unless comint-move-point-to-end-on-match
+      (goto-char opoint))))
 
 (defun comint-next-matching-input-from-input (n)
   "Search forwards through input history for match for current input.







This bug report was last modified 4 years and 308 days ago.

Previous Next


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