GNU bug report logs - #13223
24.2; comint history rendered useless by messages

Previous Next

Package: emacs;

Reported by: "Tim Daly Jr." <tim <at> tenkan.org>

Date: Wed, 19 Dec 2012 06:40:02 UTC

Severity: normal

Found in version 24.2

Fixed in version 24.3.50

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


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

From: Juri Linkov <juri <at> jurta.org>
To: "Tim Daly Jr." <tim <at> tenkan.org>
Cc: 13223 <at> debbugs.gnu.org
Subject: Re: bug#13223: patch to fix this bug
Date: Mon, 29 Apr 2013 09:45:34 +0300
> 	* comint.el (comint-history-isearch-in-progress): new variable
> 	that lets us detect that an isearch is running over command
> 	history

I wonder why you didn't use the existing variable `isearch-mode'
to detect that an isearch is running?  There should be no problem
using `isearch-mode' as you can see in the patch below.

Additionally it will display only the current history item where
isearch actually matches, i.e. to display just one "History item"
message per one M-r isearch match.  This is necessary to inform the user
about the current history index as the commands `M-p' (comint-previous-input)
and `M-n' (comint-next-input) already do:

=== modified file 'lisp/comint.el'
--- lisp/comint.el	2013-04-27 23:07:46 +0000
+++ lisp/comint.el	2013-04-29 06:44:43 +0000
@@ -1191,7 +1191,8 @@ (defun comint-previous-matching-input (r
 	  (setq comint-stored-incomplete-input
 		(funcall comint-get-old-input)))
       (setq comint-input-ring-index pos)
-      (message "History item: %d" (1+ pos))
+      (unless isearch-mode
+	(message "History item: %d" (1+ pos)))
       (comint-delete-input)
       (insert (ring-ref comint-input-ring pos)))))
 
@@ -1540,8 +1541,11 @@ (defun comint-history-isearch-message (&
       (overlay-put comint-history-isearch-message-overlay 'evaporate t))
     (overlay-put comint-history-isearch-message-overlay
 		 'display (isearch-message-prefix c-q-hack ellipsis))
-    ;; And clear any previous isearch message.
-    (message "")))
+    (if (and comint-input-ring-index (not ellipsis))
+	;; Display the current history index.
+	(message "History item: %d" (1+ comint-input-ring-index))
+      ;; Or clear a previous isearch message.
+      (message ""))))
 
 (defun comint-history-isearch-wrap ()
   "Wrap the input history search when search fails.





This bug report was last modified 12 years and 80 days ago.

Previous Next


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