From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rami A Newsgroups: gmane.emacs.help Subject: Re: Waiting on compilation to finish before executing another function Date: Thu, 15 Aug 2013 16:03:54 -0700 (PDT) Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1376607920 11104 80.91.229.3 (15 Aug 2013 23:05:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Aug 2013 23:05:20 +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 16 01:05:23 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VA6bY-0005tH-R3 for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Aug 2013 01:05:20 +0200 Original-Received: from localhost ([::1]:55887 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VA6bY-0005RZ-Ci for geh-help-gnu-emacs@m.gmane.org; Thu, 15 Aug 2013 19:05:20 -0400 X-Received: by 10.224.2.202 with SMTP id 10mr14704qak.8.1376607835002; Thu, 15 Aug 2013 16:03:55 -0700 (PDT) X-Received: by 10.49.70.170 with SMTP id n10mr121109qeu.22.1376607834962; Thu, 15 Aug 2013 16:03:54 -0700 (PDT) Original-Path: usenet.stanford.edu!fx3no2631033qab.0!news-out.google.com!he10ni2163qab.0!nntp.google.com!fx3no2631026qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=148.87.19.198; posting-account=HZ4YzgoAAABkTSCruZ7Bs4hufjlOUmBF Original-NNTP-Posting-Host: 148.87.19.198 User-Agent: G2/1.0 Injection-Date: Thu, 15 Aug 2013 23:03:54 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:200650 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:92917 Archived-At: Ok. I fixed it: (setq compilevar "Bad") (defun compile-hgpull () (interactive) (save-all-buffers) (setq compilevar "Good") (compile-pkg "hg pull -u")) (defun notify-compilation-result () (if (string-match "Good" compilevar) (progn (setq compilevar "Bad") (revert-all-buffers)))) (add-to-list 'compilation-finish-functions 'notify-compilation-result)