unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Directory Local Variables: Path to .dir-locals.el
@ 2009-12-12 15:11 Rüdiger Sonderfeld
  2009-12-12 15:46 ` Lennart Borgman
  0 siblings, 1 reply; 3+ messages in thread
From: Rüdiger Sonderfeld @ 2009-12-12 15:11 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

is there a way to get the location of the .dir-locals.el file inside the
.dir-locals.el file?

I try to do something like that

((c++-mode .
  ((compile-command (concat "cd " PATH-TO-DIR-LOCALS-EL " && make")))))

Basically I need something like default-directory but for the .dir-locals.el.

Regards,
Rüdiger






^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Directory Local Variables: Path to .dir-locals.el
  2009-12-12 15:11 Directory Local Variables: Path to .dir-locals.el Rüdiger Sonderfeld
@ 2009-12-12 15:46 ` Lennart Borgman
  2009-12-13 17:00   ` Rüdiger Sonderfeld
  0 siblings, 1 reply; 3+ messages in thread
From: Lennart Borgman @ 2009-12-12 15:46 UTC (permalink / raw)
  To: Rüdiger Sonderfeld; +Cc: help-gnu-emacs

On Sat, Dec 12, 2009 at 4:11 PM, Rüdiger Sonderfeld
<ruediger@c-plusplus.de> wrote:
> Hello,
>
> is there a way to get the location of the .dir-locals.el file inside the
> .dir-locals.el file?
>
> I try to do something like that
>
> ((c++-mode .
>  ((compile-command (concat "cd " PATH-TO-DIR-LOCALS-EL " && make")))))
>
> Basically I need something like default-directory but for the .dir-locals.el.


locate-dominating-file?




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Directory Local Variables: Path to .dir-locals.el
  2009-12-12 15:46 ` Lennart Borgman
@ 2009-12-13 17:00   ` Rüdiger Sonderfeld
  0 siblings, 0 replies; 3+ messages in thread
From: Rüdiger Sonderfeld @ 2009-12-13 17:00 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

Lennart Borgman <lennart.borgman <at> gmail.com> writes:
> locate-dominating-file?

Thank you!

My .dir-locals.el now looks like that

((c++-mode . ((compile-command . 
  (concat "cd " (file-name-directory (locate-dominating-file buffer-file-name
                                                             ".dir-locals.el"))
          " && make")))))

a bit complicated but it works :-).






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-13 17:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-12 15:11 Directory Local Variables: Path to .dir-locals.el Rüdiger Sonderfeld
2009-12-12 15:46 ` Lennart Borgman
2009-12-13 17:00   ` Rüdiger Sonderfeld

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).