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

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

Re: compilation/grep buffer advice


From: Phil Carmody
Subject: Re: compilation/grep buffer advice
Date: Fri, 08 Aug 2008 13:20:21 +0300
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Kevin Rodgers <kevin.d.rodgers@gmail.com> writes:
>> What other kinds of functions apart from grep use compilation mode?
>
> Compilation mode is highly generalized so that many other modes
> can be implemented on top of it.  Such modes ought to set major-mode
> via compilation-start's MODE, so I think you'd be better of testing
> (eq major-mode 'compilation-mode).
>
> You might also consider moving the test out of the
> compilation-finish-function and into compilation-mode-hook:
>
> (defun my-compilation-finish-function (buffer string)
>   (if (string-match "exited abnormally" string)
>       (message (substitute-command-keys
>               "Compilation errors, type \\[next-error] to visit"))
>     (run-at-time 1 nil 'delete-windows-on buffer)
>     (message "No compilation errors")))
>
> (add-hook 'compilation-mode-hook
>         (lambda ()
>           (if (eq major-mode 'compilation-mode)
>               (set (make-local-variable 'compilation-finish-function)
>                    'my-compilation-finish-function))))

Nice. Many thanks Kevin, I'm running with the above now.
Phil
-- 
Dear aunt, let's set so double the killer delete select all.
-- Microsoft voice recognition live demonstration


reply via email to

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