help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to keep *compilation* buffer in background


From: William Xu
Subject: Re: How to keep *compilation* buffer in background
Date: Sun, 26 Oct 2008 02:12:09 +0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (darwin)

"stephan.zimmer" <stephan.zimmer@googlemail.com> writes:

> After invoking the "compile" command the *compilation* buffer pops up
> and occupies half of the emacs window. Is there any way to configure
> this command such that the buffer pops up in the background?
> Alternatively, is it possible to automatically let the buffer be
> closed after a successful compilation?

I got this from somewhere on emacswiki, slightly modified: 

  (defun xwl-compilation-exit-autoclose (status code msg)
    (if (and (eq status 'exit) (zerop code))
        (progn
          (run-at-time 0.5
                       nil
                       (lambda ()
                         (delete-window
                          (get-buffer-window
                           (get-buffer "*compilation*")))))
          (message "Compilation succeed"))
      (message "Compilation failed"))
    (cons msg code))
  
  (setq compilation-exit-message-function 'xwl-compilation-exit-autoclose)
  
-- 
William

http://williamxu.net9.org





reply via email to

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