From: Juri Linkov <juri@jurta.org>
Subject: recompile and grep
Date: Tue, 23 Aug 2005 22:38:06 +0300 [thread overview]
Message-ID: <87slx0a0zt.fsf@jurta.org> (raw)
grep-mode provides a menu item `Repeat grep' which is bound to
`recompile'. But using `recompile' on grep buffers has two problems:
1. grep command repeated with `recompile' uses compilation exit messages
instead of grep exit messages (`matches found/no matches found') which
leads to incorrect fontification.
2. new variable `compilation-disable-input' is nil in grep buffers
when grep is started by `recompile'. This is a minor problem but
it would be good to fix both problems with the following patch
which makes the variables `compilation-process-setup-function'
and `compilation-disable-input' buffer-local in grep buffers:
Index: lisp/progmodes/grep.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/grep.el,v
retrieving revision 1.47
diff -c -r1.47 grep.el
*** lisp/progmodes/grep.el 20 Aug 2005 21:47:40 -0000 1.47
--- lisp/progmodes/grep.el 23 Aug 2005 19:35:12 -0000
***************
*** 517,528 ****
;; Setting process-setup-function makes exit-message-function work
;; even when async processes aren't supported.
! (let ((compilation-process-setup-function 'grep-process-setup)
! (compilation-disable-input t))
! (compilation-start (if (and grep-use-null-device null-device)
! (concat command-args " " null-device)
! command-args)
! 'grep-mode nil highlight-regexp)))
;;;###autoload
(define-compilation-mode grep-mode "Grep"
--- 532,541 ----
;; Setting process-setup-function makes exit-message-function work
;; even when async processes aren't supported.
! (compilation-start (if (and grep-use-null-device null-device)
! (concat command-args " " null-device)
! command-args)
! 'grep-mode nil highlight-regexp))
;;;###autoload
(define-compilation-mode grep-mode "Grep"
***************
*** 532,537 ****
--- 545,553 ----
grep-hit-face)
(set (make-local-variable 'compilation-error-regexp-alist)
grep-regexp-alist)
+ (set (make-local-variable 'compilation-process-setup-function)
+ 'grep-process-setup)
+ (set (make-local-variable 'compilation-disable-input) t)
;; Set `font-lock-lines-before' to 0 to not refontify the previous
;; line where grep markers may be already removed.
(set (make-local-variable 'font-lock-lines-before) 0))
--
Juri Linkov
http://www.jurta.org/emacs/
next reply other threads:[~2005-08-23 19:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-23 19:38 Juri Linkov [this message]
2005-08-24 10:33 ` recompile and grep Richard M. Stallman
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87slx0a0zt.fsf@jurta.org \
--to=juri@jurta.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.