From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.help Subject: Re: Compilation buffer Date: Thu, 25 Nov 2010 15:34:14 +0100 Message-ID: <87eia9jwux.fsf@ambire.localdomain> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1290695994 24326 80.91.229.12 (25 Nov 2010 14:39:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 25 Nov 2010 14:39:54 +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 Nov 25 15:39:49 2010 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.69) (envelope-from ) id 1PLczC-0002s9-1V for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Nov 2010 15:39:46 +0100 Original-Received: from localhost ([127.0.0.1]:43376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PLczB-0008Kt-53 for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Nov 2010 09:39:45 -0500 Original-Received: from [140.186.70.92] (port=57081 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PLcyQ-0008JN-F8 for help-gnu-emacs@gnu.org; Thu, 25 Nov 2010 09:38:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PLcyP-00020F-8M for help-gnu-emacs@gnu.org; Thu, 25 Nov 2010 09:38:58 -0500 Original-Received: from smtp206.alice.it ([82.57.200.102]:50732) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PLcyO-0001yP-SG for help-gnu-emacs@gnu.org; Thu, 25 Nov 2010 09:38:57 -0500 Original-Received: from ambire.localdomain (82.48.1.144) by smtp206.alice.it (8.5.124.08) id 4C1A268C0AF64138 for help-gnu-emacs@gnu.org; Thu, 25 Nov 2010 15:38:54 +0100 Original-Received: from ttn by ambire.localdomain with local (Exim 4.69) (envelope-from ) id 1PLctq-0003Al-9H for help-gnu-emacs@gnu.org; Thu, 25 Nov 2010 15:34:14 +0100 In-Reply-To: (Andrea Crotti's message of "Thu, 25 Nov 2010 00:17:00 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Windows 98 (1) 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:75431 Archived-At: () Andrea Crotti () Thu, 25 Nov 2010 00:17:00 +0100 I stole this nice trick somewhere (defun kill-compile-buffer-if-successful (buffer string) (if (string-match "finished" string) ^ (run-with-timer 1 nil | 'kill-buffer | buffer))) | | (add-hook 'compilation-finish-functions 'kill | ompile-buffer-if-successful) | And actually it's very nice, in short if the co | ilation succeeds the buffer is killed, but there are two small probl | s: | - not just "compile" uses compilation mode, for | xample grep also does but then the buffer disappears too soon. | Is there a way to distiguish between those di | erent things? | The first arg to the function is the buffer. ------+ You can test that.