[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: moy-compilation-schedule-execute.el
From: |
Kevin Rodgers |
Subject: |
Re: moy-compilation-schedule-execute.el |
Date: |
Tue, 10 Feb 2004 09:49:24 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 |
Matthieu Moy wrote:
> In brief, this allows you to ask Emacs to execute something after a
> compilation launched with M-x compile RET is over.
>
> Comments/suggestions/feedback are welcome !
...
> ;;; Commentary:
>
> ;; Adds the notion of `compilation-end-hook-once' : A list of functions
> ;; that will be executed once (and then removed from the hook) at the
> ;; end of the running compilation.
...
> ;;;###autoload
> (defvar compilation-end-hook-once nil)
>
> ;;;###autoload
> (defvar compilation-end-hook nil)
>
> ;;;###autoload
> (defadvice compilation-handle-exit
> (after compilation-end-advice activate)
> (run-hooks compilation-end-hook)
> (mapcar '(lambda (x)
> (funcall x)
> (remove-hook 'compilation-end-hook-once x))
> compilation-end-hook-once))
Why are the functions removed from the hook? (That means they have to
be added again each time you compile, right?)
Why don't you use compilation-finish-functions, instead of defining a
new hook variable (that in turn requires you to advise
compilation-handle-exit to run it)?
--
Kevin Rodgers
- Re: moy-compilation-schedule-execute.el,
Kevin Rodgers <=