[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Open compilation window only on errors?

From: Kevin Rodgers
Subject: Re: Open compilation window only on errors?
Date: Mon, 29 Sep 2003 16:10:55 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv: Gecko/20020406 Netscape6/6.2.2

Matthew Calhoun wrote:

When I compile using M-x compile, Emacs opens a new window for the compilation buffer when it's finished.

Really?  I think it displays the *compilation* buffer immediately.  You can see
that with `M-x compile RET C-a C-k sleep 10 RET'.

This is great when there are warnings or errors, but when there aren't I would like to prevent Emacs from opening the new window, and instead maybe just put a message in the minibuffer indicating that compilation was successful. Is there a variable I can set for this, or does anyone have elisp code that does something similar?

Well, you could undisplay the window when the compilation finishes by calling
delete-window or bury-buffer inside your own compilation-finish-function.  You
can access the EXIT-STATUS arg of compilation-handle-exit (which should be 0 for
a successful command), since Emacs variables have dynamic scope.

Or maybe you could do that inside
        (defadvice compile (after delete-window activate) ...)
and then (re)display the buffer within your compilation-finish-function.

Kevin Rodgers

reply via email to

[Prev in Thread] Current Thread [Next in Thread]