From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: recompile and grep Date: Tue, 23 Aug 2005 22:38:06 +0300 Organization: JURTA Message-ID: <87slx0a0zt.fsf@jurta.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1124827927 25793 80.91.229.2 (23 Aug 2005 20:12:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 23 Aug 2005 20:12:07 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 23 22:11:57 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1E7f3W-0006g7-SI for ged-emacs-devel@m.gmane.org; Tue, 23 Aug 2005 22:07:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E7f7J-0002b6-Ua for ged-emacs-devel@m.gmane.org; Tue, 23 Aug 2005 16:11:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E7f5h-00024Q-JV for emacs-devel@gnu.org; Tue, 23 Aug 2005 16:09:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E7f5b-00021o-ML for emacs-devel@gnu.org; Tue, 23 Aug 2005 16:09:47 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E7f5Y-0001xZ-9S for emacs-devel@gnu.org; Tue, 23 Aug 2005 16:09:40 -0400 Original-Received: from [194.126.101.111] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1E7eq0-0001Nk-HV for emacs-devel@gnu.org; Tue, 23 Aug 2005 15:53:36 -0400 Original-Received: from mail.neti.ee (80-235-39-20-dsl.mus.estpak.ee [80.235.39.20]) by Relayhost1.neti.ee (Postfix) with ESMTP id 1F5221F6B for ; Tue, 23 Aug 2005 22:52:49 +0300 (EEST) Original-To: emacs-devel@gnu.org User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:42366 Archived-At: 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/