unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Roy Smith <roy@panix.com>
Subject: Re: Per-directory customizations?
Date: Fri, 30 Apr 2004 15:27:05 -0400	[thread overview]
Message-ID: <roy-19ED1B.15270530042004@reader2.panix.com> (raw)
In-Reply-To: 4092A276.8060505@yahoo.com

In article <4092A276.8060505@yahoo.com>,
 Kevin Rodgers <ihs_4664@yahoo.com> wrote:

> [Please don't top-post.]
> 
> Kin Cho wrote:
>  > Roy Smith <roy@panix.com> writes:
>  >>Is there any way to do customizations on a per-directory basis?
>  >>
>  >>For example, I've got java project which lives in ~/dev/foo.  Anytime I
>  >>run M-X compile anywhere inside the ~/dev/foo hierarchy, I want the
>  >>command run to be "cd ~/dev/foo; ant".  I don't want to just set
>  >>compile-command in my .emacs file, because the right command varies
>  >>depending on which project (i.e. directory subtree) I'm in.
>  >>
>  >>Is there any way to do this?  I'm running GNU Emacs 21.2.1.
>  >
>  > I do something similar, with defadvice of compile-internal, and
>  > setq compile-command depending on default-directory.
> 
> 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.

  reply	other threads:[~2004-04-30 19:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-30 12:30 Per-directory customizations? Roy Smith
2004-04-30 15:38 ` Kin Cho
2004-04-30 19:01   ` Kevin Rodgers
2004-04-30 19:27     ` Roy Smith [this message]
2004-04-30 23:47       ` Kevin Rodgers
2004-04-30 23:54         ` Johan Bockgård
2004-05-01  0:11         ` Kin Cho
2004-05-03 14:12           ` Stefan Monnier
2004-05-03 16:19             ` Kin Cho
2004-04-30 17:13 ` Vagn Johansen
2004-04-30 21:14 ` Stefan Monnier

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=roy-19ED1B.15270530042004@reader2.panix.com \
    --to=roy@panix.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).