From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Hadron Newsgroups: gmane.emacs.help Subject: code for closing compilation buffers Date: Wed, 11 Jul 2007 16:08:50 +0200 Message-ID: <87fy3v58y5.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1184164855 6945 80.91.229.12 (11 Jul 2007 14:40:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 11 Jul 2007 14:40:55 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 11 16:40:54 2007 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 1I8dN6-0006wN-B6 for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jul 2007 16:40:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I8dN3-0003kb-V4 for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jul 2007 10:40:49 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 20 Original-X-Trace: individual.net ToOaTgAK3+TrdtmJyv1JwQedX5En2PQaBqjzPZCa60PdTPJ74Y X-Orig-Path: news.individual.net!news Cancel-Lock: sha1:sB6pvns9RiqLfHXdu6wwUdN56Xc= sha1:twOTel2EsXGhJgY6SM32biYXhYY= X-Face: 2h#||Cd#d%F*NCm59[_6/{1a@jy%; |j>{D~4^gKg(^i%7j0IK?+,/GmW&:CD5fEKb_! User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.91 (gnu/linux) Original-Xref: shelby.stanford.edu gnu.emacs.help:150013 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:45601 Archived-At: I googled up some code and then modified it to use the more recent compilation-finish-functions hook. Could someone take a peek that I did the "if then else" part right. If errors then jump to first error, else close the window. It *works* I would just be grateful if someone could comment on whether its done right: (add-hook 'compilation-finish-functions (lambda (buf str) (if (string-match "exited abnormally" str) (next-error) ;;no errors, make the compilation window go away in a few seconds (run-at-time "2 sec" nil 'delete-windows-on (get-buffer-create "*compilation*")) (message "No Compilation Errors!") ) ))