From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Phil Carmody Newsgroups: gmane.emacs.help Subject: Re: compilation/grep buffer advice Date: Fri, 08 Aug 2008 13:20:21 +0300 Organization: Saunalahti Customer Message-ID: <873alf6c62.fsf@nonospaz.fatphil.org> References: <87r6906gxj.fsf@nonospaz.fatphil.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1218192255 15167 80.91.229.12 (8 Aug 2008 10:44:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Aug 2008 10:44:15 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 08 12:45:06 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KRPSr-00006b-O4 for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Aug 2008 12:44:58 +0200 Original-Received: from localhost ([127.0.0.1]:33969 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KRPRv-00071Y-Uv for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Aug 2008 06:44:00 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!goblin1!goblin.stu.neva.ru!feeder2.news.saunalahti.fi!reader1.news.saunalahti.fi!53ab2750!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Cancel-Lock: sha1:8CC1XxXlCRrcDN3lmvHcyxfnnWE= Original-Lines: 29 Original-NNTP-Posting-Host: 83.143.57.195 Original-X-Complaints-To: newsmaster@saunalahti.com Original-X-Trace: reader1.news.saunalahti.fi 1218190849 83.143.57.195 (Fri, 08 Aug 2008 13:20:49 EEST) Original-NNTP-Posting-Date: Fri, 08 Aug 2008 13:20:49 EEST Original-Xref: news.stanford.edu gnu.emacs.help:160954 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:56300 Archived-At: Kevin Rodgers writes: >> What other kinds of functions apart from grep use compilation mode? > > Compilation mode is highly generalized so that many other modes > can be implemented on top of it. Such modes ought to set major-mode > via compilation-start's MODE, so I think you'd be better of testing > (eq major-mode 'compilation-mode). > > You might also consider moving the test out of the > compilation-finish-function and into compilation-mode-hook: > > (defun my-compilation-finish-function (buffer string) > (if (string-match "exited abnormally" string) > (message (substitute-command-keys > "Compilation errors, type \\[next-error] to visit")) > (run-at-time 1 nil 'delete-windows-on buffer) > (message "No compilation errors"))) > > (add-hook 'compilation-mode-hook > (lambda () > (if (eq major-mode 'compilation-mode) > (set (make-local-variable 'compilation-finish-function) > 'my-compilation-finish-function)))) Nice. Many thanks Kevin, I'm running with the above now. Phil -- Dear aunt, let's set so double the killer delete select all. -- Microsoft voice recognition live demonstration