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: compilation/grep buffer advice Date: Thu, 07 Aug 2008 17:25:12 +0300 Organization: Saunalahti Customer Message-ID: <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 1218120062 26895 80.91.229.12 (7 Aug 2008 14:41:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Aug 2008 14:41:02 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 07 16:41:52 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 1KR6gL-0005Uq-Mq for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Aug 2008 16:41:37 +0200 Original-Received: from localhost ([127.0.0.1]:57077 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KR6fQ-0006R0-5r for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Aug 2008 10:40:40 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!feeder.erje.net!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:/kexpoSSd0DIZba+1CsD9L9JbJA= 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 1218119139 83.143.57.195 (Thu, 07 Aug 2008 17:25:39 EEST) Original-NNTP-Posting-Date: Thu, 07 Aug 2008 17:25:39 EEST Original-Xref: news.stanford.edu gnu.emacs.help:160891 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:56236 Archived-At: I like the idea of burying the result of a successful compilation, but keeping errors visible, and started using the code snippet that was recently posted here to achieve that. However, I got annoyed by it burying grep results too. This quick hack overcomes that limitation, but I'm not sure what kind of condition to include to test the buffer name: (setq compilation-finish-function (lambda (buf str) (if (string-match "compilation" (buffer-name buf)) (if (string-match "exited abnormally" str) (message "compilation errors, press C-x ` to visit") (run-at-time 1 nil 'delete-windows-on buf) (message "NO COMPILATION ERRORS!")) (message "didn't look like a compilation")))) What other kinds of functions apart from grep use compilation mode? Is it better to have 'compilation' a special case to be handled by optionally burying, or 'grep' the special case that does nothing? Phil -- Dear aunt, let's set so double the killer delete select all. -- Microsoft voice recognition live demonstration