emacs-devel
[Top][All Lists]
Advanced

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

Re: .dir-locals.el


From: Eric Schulte
Subject: Re: .dir-locals.el
Date: Wed, 07 Jan 2009 16:08:42 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Is there a good way to apply the variables set in .dir-locals.el when
changing into and out of a directory in eshell (or I suppose in other
Emacs shells as well)?

I've tried setting eshell as a mode in the .dir-locals.el file but with
no success.  I've also tried to define after-advice on the `cd' function
in eshell, but there doesn't appear to be any means for applying local
variables to a buffer which doesn't have a file-name.

(defadvice cd (after dir-locals-on-cd activate)
  "Apply the variables defined in .dir-locals.el when changing
into and outof a directory in eshell."
  (hack-dir-local-variables))

Fails because `hack-dir-local-variables' checks that the buffer is
visiting a file before applying the variables.

Is there a supported way to do this?

If not should I write a new function for this?

If so should it be included in the dir-locals.el functionality?

If not is there a reason to only allow setting local variables for
buffers visiting files?

Thanks -- Eric




reply via email to

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