From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andrea Crotti Newsgroups: gmane.emacs.help Subject: Compilation buffer Date: Thu, 25 Nov 2010 00:17:00 +0100 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1290640668 31188 80.91.229.12 (24 Nov 2010 23:17:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 24 Nov 2010 23:17:48 +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 00:17:45 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 1PLOau-0008Gz-T1 for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Nov 2010 00:17:45 +0100 Original-Received: from localhost ([127.0.0.1]:52306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PLOau-0004Zv-5W for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Nov 2010 18:17:44 -0500 Original-Received: from [140.186.70.92] (port=43139 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PLOaX-0004Zm-T2 for help-gnu-emacs@gnu.org; Wed, 24 Nov 2010 18:17:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PLOaW-0003Sc-U8 for help-gnu-emacs@gnu.org; Wed, 24 Nov 2010 18:17:21 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:52525) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PLOaW-0003S7-OT for help-gnu-emacs@gnu.org; Wed, 24 Nov 2010 18:17:20 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PLOaQ-0007xf-G8 for help-gnu-emacs@gnu.org; Thu, 25 Nov 2010 00:17:14 +0100 Original-Received: from ip1-201.halifax.rwth-aachen.de ([137.226.108.201]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Nov 2010 00:17:14 +0100 Original-Received: from andrea.crotti.0 by ip1-201.halifax.rwth-aachen.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Nov 2010 00:17:14 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: ip1-201.halifax.rwth-aachen.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:gOnhgMgE3qHE/KgZXwoFqgnriZw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:75426 Archived-At: I stole this nice trick somewhere --8<---------------cut here---------------start------------->8--- (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-compile-buffer-if-successful) --8<---------------cut here---------------end--------------->8--- And actually it's very nice, in short if the compilation succeeds the buffer is killed, but there are two small problems: - not just "compile" uses compilation mode, for example grep also does but then the buffer disappears too soon. Is there a way to distiguish between those different things? - I would also like to see warnings if there are, so the "finished" maybe it's not enough, here now other ways that just doing "string-matching" right? Another thing it would be nice is a way to jump, from everywhere, to the next error/warning. Now I have to - go to the compilation buffer - go to the next error - press Enter Is there some function already to automate it or should I create a macro/function?