emacs-devel
[Top][All Lists]
Advanced

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

Re: Allowing .dir-locals-N.el


From: John Wiegley
Subject: Re: Allowing .dir-locals-N.el
Date: Wed, 04 Nov 2015 11:24:05 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin)

>>>>> Kaushal Modi <address@hidden> writes:

> That's not a bad idea as long as the `C-h v` buffer shows what all .
> dir-locals*.el files are affecting that variable in that buffer.

I like this idea. For example, Git allows you to ignore files via two file
within a project:

    .gitignore
    .git/info/exclude

This allows both a project exclusion, and a user exclusion. Since
.dir-locals.el is often used to set project-wide standards, it seems natural
to allow an override.

I'm not sure about detecting such extra files by a naming convention. I'd
rather see `dir-locals-file-alist' with the following customization:

    (list (list regexp (choice file function) boolean))

The REGEXP matches directories, the FILE specifies a `.dir-locals.el` file to
use for that directory (or FUNCTION to determine the file), plus a BOOLEAN
indicating whether the alist should continue to be searched -- or, if we reach
the end of the list, we should also read .dir-locals.el from the expected
location.

The list of of `.dir-locals.el` files found in this fashion would be loaded in
reverse, so that the first one matching can override anything from the others
(after the manner of CSS).

How does that sound?

John



reply via email to

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