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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13223 in the body.
You can then email your comments to 13223 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#13223; Package emacs. (Wed, 19 Dec 2012 06:40:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Tim Daly Jr." <tim <at> tenkan.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 19 Dec 2012 06:40:03 GMT) Full text and rfc822 format available.

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

From: "Tim Daly Jr." <tim <at> tenkan.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.2; comint history rendered useless by messages
Date: Tue, 18 Dec 2012 22:39:16 -0800
I always have to comment out the line (1194 in my copy) in comint.el
that does this:

(message "History item: %d" (1+ pos))

because it makes M-r in shell mode too slow to use.  You hit M-r and
type something and it just spams the heck out of you and goes nowhere.


In GNU Emacs 24.2.1 (x86_64-apple-darwin, NS apple-appkit-1038.36)
 of 2012-08-27 on bob.porkrind.org
Windowing system distributor `Apple', version 10.3.1138
Configured using:
 `configure '--host=x86_64-apple-darwin' '--build=i686-apple-darwin'
 '--with-ns' 'build_alias=i686-apple-darwin'
 'host_alias=x86_64-apple-darwin' 'CC=gcc -mmacosx-version-min=10.5''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
T h e SPC i n d e <backspace> <backspace> t e n d e 
d SPC e f f e c t SPC i s SPC j u s t SPC t o SPC k 
i l l SPC t h e SPC f o r e g r o u n d SPC p r o c 
e s s SPC o n SPC t h e SPC r e o <backspace> m o <backspace> 
o t e SPC h o s t . C-n C-p C-f C-SPC C-M-f C-M-f M-f 
M-f M-f C-f C-f C-w C-p M-b M-b C-y SPC M-q C-n C-n 
C-e C-n M-< C-e M-b M-b M-b M-b M-b C-SPC C-e C-b C-w 
y a h o o - M-b M-b C-SPC C-e C-b C-w t i m @ t e n 
k a n . o r g C-n C-a C-n C-n C-v C-v M-> M-< C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-p C-c C-c y e s <return> 
m a i l SPC c l i e n t <return> C-SPC M-< C-x C-n 
C-n C-n C-g C-x 1 C-n C-n C-n C-n C-g C-SPC C-n C-p 
C-n C-n C-p C-p C-n C-w <return> C-n C-n C-n C-n C-n 
C-SPC C-p C-w C-p C-p C-p C-p C-p C-SPC M-> M-w M-< 
C-n M-f C-f C-f C-SPC C-e M-w C-n C-a M-f M-b C-SPC 
C-e M-w C-x k <return> y e s <return> C-x b c <backspace> 
c o m <tab> i <tab> <return> C-p C-p C-a M-f M-b C-b 
C-b C-f C-SPC C-e M-w M-x r e p o <tab> r <tab> C-g 
M-x r e p r o t - b u <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> o r t - b u g <tab> 
<return>

Recent messages:
Quit [2 times]
Mark set [3 times]
Saved text from "
If you ssh someplace in shell mode and "
Mark set [2 times]
Auto-saving...done
Mark set
Making completion list...
Mark set
Making completion list...
Quit

Load-path shadows:
None found.

Features:
(novice cus-edit cus-start cus-load wid-edit shadow sort gnus-util
mail-extr emacsbug message format-spec rfc822 mml mml-sec mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
mule-util rect nxml-uchnm rng-xsd xsd-regexp rng-cmpct rng-nxml
rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util
rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph
nxml-enc xmltok conf-mode newcomment derived cl byte-opt bytecomp
byte-compile cconv macroexp vc-dispatcher vc-svn jka-compr tabify man
assoc make-mode cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs vc-git help-mode view pcmpl-unix
dired-aux misearch multi-isearch sh-script executable dired shell
pcomplete warnings iswitchb compile comint regexp-opt ansi-color advice
help-fns advice-preload xcscope ring easymenu slime-autoloads edmacro
kmacro time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel
ns-win tool-bar dnd fontset image fringe lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face files text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process ns multi-tty emacs)





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13223; Package emacs. (Sun, 28 Apr 2013 22:28:02 GMT) Full text and rfc822 format available.

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

From: "Tim Daly Jr." <tim <at> tenkan.org>
To: 13223 <at> debbugs.gnu.org
Subject: patch to fix this bug
Date: Sun, 28 Apr 2013 15:27:40 -0700
[Message part 1 (text/plain, inline)]
This patch keeps emacs from printing the history messages when performing a history search in a comint buffer.  (For example, M-x shell RET M-r o).

Changelog:

2013-04-28  Tim Daly Jr.  <tim <at> tenkan.org>

	* comint.el (comint-history-isearch-in-progress): new variable
	that lets us detect that an isearch is running over command
	history
	(comint-previous-matching-input): don't print "History item: N"
	messages when called as part of an isearch over history, because
	it's too slow and spammy.
	(comint-history-isearch-setup, comint-history-isearch-end): toggle
	comint-history-isearch-in-progress to indicate search start and
	stop

Patch:

[skip-isearch-history-msgs.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13223; Package emacs. (Sun, 28 Apr 2013 23:14:02 GMT) Full text and rfc822 format available.

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

From: "Tim Daly Jr." <tim <at> tenkan.org>
To: 13223 <at> debbugs.gnu.org
Subject: resending the patch as text/plain...
Date: Sun, 28 Apr 2013 16:13:16 -0700
[skip-isearch-history-msgs.patch.txt (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13223; Package emacs. (Mon, 29 Apr 2013 06:52:02 GMT) Full text and rfc822 format available.

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.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13223; Package emacs. (Wed, 01 May 2013 01:37:02 GMT) Full text and rfc822 format available.

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

From: "Tim Daly Jr." <tim <at> tenkan.org>
To: Juri Linkov <juri <at> jurta.org>
Cc: 13223 <at> debbugs.gnu.org
Subject: Re: bug#13223: patch to fix this bug
Date: Tue, 30 Apr 2013 18:35:59 -0700
On Apr 28, 2013, at 11:45 PM, Juri Linkov wrote:

>> 	* 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:

quite right, your patch looks much better. :)


-tim





bug Marked as fixed in versions 24.3.50. Request was from Juri Linkov <juri <at> jurta.org> to control <at> debbugs.gnu.org. (Wed, 01 May 2013 08:08:01 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 13223 <at> debbugs.gnu.org and "Tim Daly Jr." <tim <at> tenkan.org> Request was from Juri Linkov <juri <at> jurta.org> to control <at> debbugs.gnu.org. (Wed, 01 May 2013 08:08:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 29 May 2013 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 360 days ago.

Previous Next


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