* recompile and grep
@ 2005-08-23 19:38 Juri Linkov
2005-08-24 10:33 ` Richard M. Stallman
0 siblings, 1 reply; 2+ messages in thread
From: Juri Linkov @ 2005-08-23 19:38 UTC (permalink / 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/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-08-24 10:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-23 19:38 recompile and grep Juri Linkov
2005-08-24 10:33 ` Richard M. Stallman
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.