unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* compilation/grep buffer advice
@ 2008-08-07 14:25 Phil Carmody
  2008-08-08  3:19 ` Kevin Rodgers
       [not found] ` <mailman.16056.1218165582.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Phil Carmody @ 2008-08-07 14:25 UTC (permalink / raw)
  To: help-gnu-emacs

I like the idea of burying the result of a successful 
compilation, but keeping errors visible, and started 
using the code snippet that was recently posted here 
to achieve that.

However, I got annoyed by it burying grep results too.
This quick hack overcomes that limitation, but I'm not
sure what kind of condition to include to test the buffer
name:

(setq compilation-finish-function
      (lambda (buf str)
        (if (string-match "compilation" (buffer-name buf))
            (if (string-match "exited abnormally" str)
                (message "compilation errors, press C-x ` to visit")
              (run-at-time 1 nil 'delete-windows-on buf)
              (message "NO COMPILATION ERRORS!"))
          (message "didn't look like a compilation"))))


What other kinds of functions apart from grep use compilation 
mode? Is it better to have 'compilation' a special case to be
handled by optionally burying, or 'grep' the special case that
does nothing? 

Phil
-- 
Dear aunt, let's set so double the killer delete select all.
-- Microsoft voice recognition live demonstration


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

end of thread, other threads:[~2008-08-08 10:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-07 14:25 compilation/grep buffer advice Phil Carmody
2008-08-08  3:19 ` Kevin Rodgers
     [not found] ` <mailman.16056.1218165582.18990.help-gnu-emacs@gnu.org>
2008-08-08 10:20   ` Phil Carmody

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).