[Top][All Lists]

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

Re: Allowing .dir-locals-N.el

From: Artur Malabarba
Subject: Re: Allowing .dir-locals-N.el
Date: Sun, 8 Nov 2015 11:37:59 +0000

> > EZ> Doesn't that mean ".dir-locals20.el: will be unable to override
> > EZ> ".dir-locals3.el"?

Yes. I'm honestly not concerned with this. That's just how file sorting works everywhere, from a simple “sorted-by-name” folder in Widows Explorer all the way to the order in which config files are loaded inside `/etc/*.d/' configuration directories. People might be caught off-guard by this occasionally, but it's fairly easy to understand.

On 7 Nov 2015 10:34 pm, "Juri Linkov" <address@hidden> wrote:
> Then maybe better to compare using version< like we do with ChangeLog.[0-9]?

The pattern used to find dir locals is configurable and completely general. We can't rely on the file name having any specific form whatsoever.
For instance, I'm setting the default value to .dir-locals*.el, but someone could configure theirs to be .project*?local-vars*.el?.

In this context, I feel like it would be insane to try to find a general sorting method more appropriate than string<.

The only alternative I see is to change the approach completely and not allow wildcards in the custom-file variable. Instead, we could say that any file whose name equals dir-locals-file appended with a dot and a number is also a valid dir-locals. For instance .dir-locals.el.20.

Then we could use proper numeric (or version) sorting on these.

reply via email to

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