From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: despen@verizon.net Newsgroups: gmane.emacs.help Subject: Re: Very simple IDE for programming newbie Date: Sun, 03 Jan 2010 16:49:56 -0500 Organization: A noiseless patient Spider Message-ID: References: <87pr5susfb.fsf@hubble.informatimago.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1262558504 22792 80.91.229.12 (3 Jan 2010 22:41:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Jan 2010 22:41:44 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 03 23:41:37 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.50) id 1NRZ8f-0007Cv-Je for geh-help-gnu-emacs@m.gmane.org; Sun, 03 Jan 2010 23:41:33 +0100 Original-Received: from localhost ([127.0.0.1]:54757 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NRZ8g-00076D-6X for geh-help-gnu-emacs@m.gmane.org; Sun, 03 Jan 2010 17:41:34 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.straub-nv.de!feeder.eternal-september.org!eternal-september.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 42 Original-X-Trace: news.eternal-september.org U2FsdGVkX18hFLj9SXcy1NODxRb2971HrAgsYb23zomC3KXC5vXP8Dp1op7QPm7L1pEQRF3xOMUDwOGRoh3D2aWyv20KkQimd8cVxyx+IYpSNwrE4H4lMEvDD+tIBmQAZUEodQ+Mob0= Original-X-Complaints-To: abuse@eternal-september.org Original-NNTP-Posting-Date: Sun, 3 Jan 2010 21:49:56 +0000 (UTC) X-Auth-Sender: U2FsdGVkX185fLXWgZ9vXo6MhjcG09uTcfmSGjfeAszsUoqeKJ/vFQ== Cancel-Lock: sha1:9O4xWe+ObhUPgjEurXySaVUc+Jk= sha1:5Z+wpiBMLXvkdUqmGSdMyJ/zkVI= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Original-Xref: news.stanford.edu gnu.emacs.help:175966 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:71038 Archived-At: Sean McAfee writes: > Peter Dyballa writes: > >> Am 03.01.2010 um 17:10 schrieb Sean McAfee: >>> I know; my question was how to a) know when the asynchronous >>> compilation process has finished, and b) tell whether there were any >>> errors, so that if there were none, I can immediately launch the >>> newly-compiled program in a terminal emulator. >> >> >> The *compilation* buffer's mode-line expresses such things. > > Actually, by "I" above I meant the special compilation function I'm > planning to write. Something like: > > (defun my-compile () > (interactive) > (compile (format "gcc %s" (file-name-nondirectory (buffer-file-name)))) > (when-compilation-is-complete > (lambda () > (when (not (there-were-errors)) > (kill-buffer "*term*") > (term "./a.out"))))) > > What I'm not quite clear on at the moment is how to write the > when-compilation-is-complete and there-were-errors functions. > > Actually, for there-were-errors I could obviously parse the content of > the *compilation* buffer, but I was hoping the same information might > be available more directly. You know a compilation is good by it's return code. If you set compilation command to "make", this would check the return code and run the test: make && ./myprog But smarter is to create a Makefile and make running of the test dependent on the compile. You don't need to parse for errors, all that's already built in.