all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* synchronous M-x compile?
@ 2008-09-24 18:21 Dan Davison
  2008-09-25 11:14 ` Nikolaj Schumacher
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Davison @ 2008-09-24 18:21 UTC (permalink / raw)
  To: help-gnu-emacs mailing list

M-x compile runs the compile process asynchronously, and e.g.
(compile "make -k") always evaluates as true, even if there are
compilation errors. Is there a simple way to alter this behaviour so
that compile happens synchronously, and evaluates as false if there
are errors? I realise that one approach could be based on something
like (shell-command "make"), but ideally I'd like not to lose all the
other functionality in compile.el.

As an aside, I guess that the motivation for asynchronous compile is
the time taken for compilation? This has obviously decreased a lot
during the life of emacs and I wonder what the distribution of compile
times looks like now for emacs users? I only work on simple, small
projects for which compilation takes a few seconds, and so I'm happy
to not start another task during that time. But perhaps I have no idea
how long compilation takes for those working on large projects?

Dan

-- 
http://www.stats.ox.ac.uk/~davison




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: synchronous M-x compile?
       [not found] <mailman.19845.1222280468.18990.help-gnu-emacs@gnu.org>
@ 2008-09-24 20:06 ` Chetan
  2008-09-25 10:23   ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 4+ messages in thread
From: Chetan @ 2008-09-24 20:06 UTC (permalink / raw)
  To: help-gnu-emacs

Dan Davison <davison@stats.ox.ac.uk> writes:

> M-x compile runs the compile process asynchronously, and e.g.
> (compile "make -k") always evaluates as true, even if there are
> compilation errors. Is there a simple way to alter this behaviour so
> that compile happens synchronously, and evaluates as false if there
> are errors? I realise that one approach could be based on something
> like (shell-command "make"), but ideally I'd like not to lose all the
> other functionality in compile.el.
>
> As an aside, I guess that the motivation for asynchronous compile is
> the time taken for compilation? This has obviously decreased a lot
> during the life of emacs and I wonder what the distribution of compile
> times looks like now for emacs users? I only work on simple, small
> projects for which compilation takes a few seconds, and so I'm happy
> to not start another task during that time. But perhaps I have no idea
> how long compilation takes for those working on large projects?
>
> Dan
As a quick and dirty solution, doesn't M-x compile followed by
shell-command work? 

Chetan


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: synchronous M-x compile?
  2008-09-24 20:06 ` Chetan
@ 2008-09-25 10:23   ` Lennart Borgman (gmail)
  0 siblings, 0 replies; 4+ messages in thread
From: Lennart Borgman (gmail) @ 2008-09-25 10:23 UTC (permalink / raw)
  Cc: help-gnu-emacs

Chetan wrote:
> Dan Davison <davison@stats.ox.ac.uk> writes:
> 
>> M-x compile runs the compile process asynchronously, and e.g.
>> (compile "make -k") always evaluates as true, even if there are
>> compilation errors. Is there a simple way to alter this behaviour so
>> that compile happens synchronously, and evaluates as false if there
>> are errors? I realise that one approach could be based on something
>> like (shell-command "make"), but ideally I'd like not to lose all the
>> other functionality in compile.el.
>>
>> As an aside, I guess that the motivation for asynchronous compile is
>> the time taken for compilation? This has obviously decreased a lot
>> during the life of emacs and I wonder what the distribution of compile
>> times looks like now for emacs users? I only work on simple, small
>> projects for which compilation takes a few seconds, and so I'm happy
>> to not start another task during that time. But perhaps I have no idea
>> how long compilation takes for those working on large projects?
>>
>> Dan
> As a quick and dirty solution, doesn't M-x compile followed by
> shell-command work? 

Dan, maybe sentinels is what you are looking for? They do not do exactly
what you want, but you will know when compilation is ready.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: synchronous M-x compile?
  2008-09-24 18:21 synchronous M-x compile? Dan Davison
@ 2008-09-25 11:14 ` Nikolaj Schumacher
  0 siblings, 0 replies; 4+ messages in thread
From: Nikolaj Schumacher @ 2008-09-25 11:14 UTC (permalink / raw)
  To: help-gnu-emacs mailing list

Dan Davison <davison@stats.ox.ac.uk> wrote:

> Is there a simple way to alter this behaviour so that compile happens
> synchronously

Are you sure you need to make it synchronous?  You could just add the
code that uses the result to `compilation-finish-functions'.

> As an aside, I guess that the motivation for asynchronous compile is
> the time taken for compilation? This has obviously decreased a lot
> during the life of emacs and I wonder what the distribution of compile
> times looks like now for emacs users?

Software is getting slower more rapidly than hardware becomes faster.
(Wirth's Law) :)

But seriously.  Of course compilations have become faster.  Some
environments even offer real-time compilation while typing code.  But
even if it did only take a few seconds, what advantage would locking the
entire user interface have?  Asynchronous processes come at a small
price.

On the bright side, you can jump to the first error as soon as it
appears while the compiler is munching away on other files.

Since your interested, the average incremental compile time on my
current one-man project is about 30s, on a fairly new laptop.


regards,
Nikolaj Schumacher




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-09-25 11:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-24 18:21 synchronous M-x compile? Dan Davison
2008-09-25 11:14 ` Nikolaj Schumacher
     [not found] <mailman.19845.1222280468.18990.help-gnu-emacs@gnu.org>
2008-09-24 20:06 ` Chetan
2008-09-25 10:23   ` Lennart Borgman (gmail)

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.