From: "Tim Daly Jr." <tim@tenkan.org>
To: 13223@debbugs.gnu.org
Subject: bug#13223: patch to fix this bug
Date: Sun, 28 Apr 2013 15:27:40 -0700 [thread overview]
Message-ID: <96A9F7F8-2C61-422F-A18E-9C95511F260F@tenkan.org> (raw)
In-Reply-To: <58A8252B-C006-4216-97FD-3D2933D35282@tenkan.org>
[-- Attachment #1: Type: text/plain, Size: 663 bytes --]
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@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:
[-- Attachment #2: skip-isearch-history-msgs.patch --]
[-- Type: application/octet-stream, Size: 3496 bytes --]
=== modified file 'ChangeLog'
*** ChangeLog 2013-04-27 19:30:33 +0000
--- ChangeLog 2013-04-28 22:22:55 +0000
***************
*** 1,3 ****
--- 1,15 ----
+ 2013-04-28 Tim Daly Jr. <tim@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
+
2013-04-27 Paul Eggert <eggert@cs.ucla.edu>
Merge from gnulib, incorporating:
=== modified file 'lisp/comint.el'
*** lisp/comint.el 2013-04-21 03:13:04 +0000
--- lisp/comint.el 2013-04-28 22:01:31 +0000
*************** Moves relative to START, or `comint-inpu
*** 1175,1180 ****
--- 1175,1183 ----
(process-mark (get-buffer-process (current-buffer))))
(point-max)))
+ (defvar comint-history-isearch-in-progress nil
+ "Indicates that a comint history search is currently running.")
+
(defun comint-previous-matching-input (regexp n)
"Search backwards through input history for match for REGEXP.
\(Previous history elements are earlier commands.)
*************** If N is negative, find the next or Nth n
*** 1191,1197 ****
(setq comint-stored-incomplete-input
(funcall comint-get-old-input)))
(setq comint-input-ring-index pos)
! (message "History item: %d" (1+ pos))
(comint-delete-input)
(insert (ring-ref comint-input-ring pos)))))
--- 1194,1201 ----
(setq comint-stored-incomplete-input
(funcall comint-get-old-input)))
(setq comint-input-ring-index pos)
! (unless comint-history-isearch-in-progress
! (message "History item: %d" (1+ pos)))
(comint-delete-input)
(insert (ring-ref comint-input-ring pos)))))
*************** Intended to be added to `isearch-mode-ho
*** 1433,1439 ****
'comint-history-isearch-wrap)
(set (make-local-variable 'isearch-push-state-function)
'comint-history-isearch-push-state)
! (add-hook 'isearch-mode-end-hook 'comint-history-isearch-end nil t)))
(defun comint-history-isearch-end ()
"Clean up the comint after terminating Isearch in comint."
--- 1437,1444 ----
'comint-history-isearch-wrap)
(set (make-local-variable 'isearch-push-state-function)
'comint-history-isearch-push-state)
! (add-hook 'isearch-mode-end-hook 'comint-history-isearch-end nil t)
! (setq comint-history-isearch-in-progress t)))
(defun comint-history-isearch-end ()
"Clean up the comint after terminating Isearch in comint."
*************** Intended to be added to `isearch-mode-ho
*** 1444,1450 ****
(setq isearch-message-function nil)
(setq isearch-wrap-function nil)
(setq isearch-push-state-function nil)
! (remove-hook 'isearch-mode-end-hook 'comint-history-isearch-end t))
(defun comint-goto-input (pos)
"Put input history item of the absolute history position POS."
--- 1449,1456 ----
(setq isearch-message-function nil)
(setq isearch-wrap-function nil)
(setq isearch-push-state-function nil)
! (remove-hook 'isearch-mode-end-hook 'comint-history-isearch-end t)
! (setq comint-history-isearch-in-progress nil))
(defun comint-goto-input (pos)
"Put input history item of the absolute history position POS."
next prev parent reply other threads:[~2013-04-28 22:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-19 6:39 bug#13223: 24.2; comint history rendered useless by messages Tim Daly Jr.
2013-04-28 22:27 ` Tim Daly Jr. [this message]
2013-04-29 6:45 ` bug#13223: patch to fix this bug Juri Linkov
2013-05-01 1:35 ` Tim Daly Jr.
2013-04-28 23:13 ` bug#13223: resending the patch as text/plain Tim Daly Jr.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=96A9F7F8-2C61-422F-A18E-9C95511F260F@tenkan.org \
--to=tim@tenkan.org \
--cc=13223@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).