all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Phil Carmody <thefatphil_demunged@yahoo.co.uk>
To: help-gnu-emacs@gnu.org
Subject: Re: compilation/grep buffer advice
Date: Fri, 08 Aug 2008 13:20:21 +0300	[thread overview]
Message-ID: <873alf6c62.fsf@nonospaz.fatphil.org> (raw)
In-Reply-To: mailman.16056.1218165582.18990.help-gnu-emacs@gnu.org

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


      parent reply	other threads:[~2008-08-08 10:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=873alf6c62.fsf@nonospaz.fatphil.org \
    --to=thefatphil_demunged@yahoo.co.uk \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.