[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: region sensitive Makefile compile-command
From: |
Kevin Rodgers |
Subject: |
Re: region sensitive Makefile compile-command |
Date: |
Mon, 06 Dec 2004 10:04:41 -0700 |
User-agent: |
Mozilla Thunderbird 0.9 (X11/20041105) |
Juri Linkov wrote:
> Dan Jacobson <jidanni@jidanni.org> writes:
>
>>Patch no good as I use Debian.
Not true, as Debian must provide Emacs source code, including
lisp/progmodes/compile.el. You could patch that and recompile it, since
compile.elc isn't dumped into the emacs executable. Or you could copy
it to your site-lisp directory (or other directory in your load-path),
then patch and compile the copy.
> You can happily put in your .emacs:
>
> (add-hook 'makefile-mode-hook
> (lambda ()
> (set (make-local-variable 'compile-command)
> '(save-excursion
> (beginning-of-line)
> (if (or (looking-at makefile-macroassign-regex)
> (looking-at makefile-dependency-regex)
> (makefile-previous-dependency))
> (concat "make -k "
(match-string-no-properties 1))
> (car compile-history))))))
Wow, I didn't know compile-command could be an expression that is
evaluated dynamically! That feature is not documented in the variable's
doc string, the Emacs manual, or the NEWS file -- which in itself is a
bug.
--
Kevin Rodgers