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

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

Re: Per-directory customizations?


From: Johan Bockgård
Subject: Re: Per-directory customizations?
Date: Sat, 01 May 2004 01:54:50 +0200
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.2 (usg-unix-v)

Kevin Rodgers <ihs_4664@yahoo.com> writes:

> Roy Smith wrote:
>> Kevin Rodgers <ihs_4664@yahoo.com> wrote:
>>> Why not set compile-command in the mode hook, as suggested in it's doc
>>> string:
>>>
>>> (add-hook 'java-mode-hook
>>>       (lambda ()
>>>         (when (string-match "\\`~/dev/foo/" default-directory)
>>>           (set (make-local-variable 'compile-command)
>>>        "cd ~/dev/foo; ant"))))
>>
>> The problem there, is it only works for java files. I've got all
>> sorts of files in my project directory tree (html, css, jsp, etc,
>> etc). I want the compile command tied to the directory tree, not
>> the file type.
>
> The use find-file-hooks instead of jave-mode-hook.

There is another way, using

(setq compile-command
      '<lisp expression that evaluates to a string>)

like

(setq compile-command
      '(cond ((string-match "\\`~/dev/foo/" default-directory)
              "cd ~/dev/foo; ant")
             (...)
             ...
             (t "make -k")))

etc.

-- 
Johan Bockgård


reply via email to

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