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

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

Re: code for closing compilation buffers


From: J. David Boyd
Subject: Re: code for closing compilation buffers
Date: Mon, 16 Jul 2007 11:34:47 -0400
User-agent: Gnus/5.1100000000000003 (Gnus v5.11) Emacs/22.1 (cygwin)

Hadron <address@hidden> writes:

> I googled up some code and then modified it to use the more recent
> compilation-finish-functions hook.
>
> Could someone take a peek that I did the "if then else" part right.
>
> If errors then jump to first error, else close the window. It *works* I
> would just be grateful if someone could comment on whether its done
> right:
>
>
> (add-hook 'compilation-finish-functions
>       (lambda (buf str)
>         (if (string-match "exited abnormally" str) 
>           (next-error)
>           ;;no errors, make the compilation window go away in a few seconds
>           (run-at-time "2 sec" nil 'delete-windows-on (get-buffer-create 
> "*compilation*"))
>           (message "No Compilation Errors!")
>         )
>       ))

I would say that, if it works, it _can't_ really be done wrong!

Dave





reply via email to

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