[Top][All Lists]

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

Re: directory specific configuration

From: Peter Brett
Subject: Re: directory specific configuration
Date: Wed, 22 Jul 2009 08:13:02 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

giampi <address@hidden> writes:

> In a perfect world, at least IMHO, emacs would read by default a local
> .emacs file, if existent, on opening any file. All the configurations would
> therefore be local to that directory. I'm not sure if this would slow down
> opening a file.

Would something like this work (in your main .emacs file)?

(add-hook 'find-file-hook
          (function (lambda ()
                            ; Logic for loading directory-specific
                            ; .emacs file goes here

You'd probably need to define a directory-local variable in order to
check if you've already loaded the current directory's config this
session.  Also, don't forget that there is a security risk associated
with blindly running elisp code from anywhere on your disk; consider
putting a y-or-n-p in there somewhere.


Peter Brett <address@hidden>
Remote Sensing Research Group
Surrey Space Centre

reply via email to

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