From: despen@verizon.net
To: help-gnu-emacs@gnu.org
Subject: Re: Very simple IDE for programming newbie
Date: Sun, 03 Jan 2010 16:49:56 -0500 [thread overview]
Message-ID: <ick4vy6epn.fsf@verizon.net> (raw)
In-Reply-To: m2d41q6gxc.fsf@sean-mcafees-macbook-pro.local.i-did-not-set--mail-host-address--so-tickle-me
Sean McAfee <mcafee@sean-mcafees-macbook-pro.local> writes:
> Peter Dyballa <Peter_Dyballa@Web.DE> 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.
prev parent reply other threads:[~2010-01-03 21:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-02 18:51 Very simple IDE for programming newbie Sean McAfee
2010-01-02 21:07 ` Pascal J. Bourguignon
2010-01-03 16:10 ` Sean McAfee
2010-01-03 16:44 ` Pascal J. Bourguignon
2010-01-03 17:17 ` Richard Riley
2010-01-03 19:24 ` Peter Dyballa
[not found] ` <mailman.662.1262546694.18930.help-gnu-emacs@gnu.org>
2010-01-03 21:02 ` Sean McAfee
2010-01-03 21:49 ` despen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ick4vy6epn.fsf@verizon.net \
--to=despen@verizon.net \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).