[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to use an external dir-locals file?
From: |
Ted Zlatanov |
Subject: |
Re: how to use an external dir-locals file? |
Date: |
Thu, 21 Mar 2013 10:02:22 -0400 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) |
On Wed, 20 Mar 2013 18:13:42 -0400 Stefan Monnier <address@hidden> wrote:
>> I have a dir-locals file which I don't want to call .dir-locals.el (it
>> should not be the default, I just use it for reindenting code in a
>> particular way). How can I specify it when loading a file if it's not
>> even in the same directory?
SM> There's no such thing. You might like to M-x report-emacs-bug the
SM> feature request, but please describe more precisely what it should look
SM> like (e.g. I could imagine a special file-local setting which says "use
SM> the settings from dir-locals file <foo>", but I'm not sure if having to
SM> add a file-local setting is good enough for you).
I can implement it, no need for a bug report.
I imagined simply doing a dynamic let-bind around the call initially,
but if it's going to be a feature, then I could make it easier to
associate a dir-locals override with a file (matched by name). When
there's a match and the override file exists, we just short-circuit the
search for .dir-locals.el and look at the override file instead. When
the override file doesn't exist, I think we should not look at
.dir-locals.el, but behave as if none were found.
Does that makes sense? If yes I'll do it. Or would you rather just see
a let-bind of `dir-locals-file-override' for example? That would
certainly be easier to implement.
To answer the second question--we want to *reindent* with dir-locals,
but not make them active for everyone by default, as file-locals or in
`.dir-locals.el'.
Ted