[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dir-local vs major-mode setting
From: |
Stefan Monnier |
Subject: |
Re: dir-local vs major-mode setting |
Date: |
Wed, 14 Nov 2018 22:27:50 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
>>> If the project is expected to contain .tex files then the above would
>>> constitute a bug in the .dir-locals.el file (which should contain mode-
>>> specific entries for exceptions to the global settings).
>>
>> The whole point of `nil` is that it's not mode-specific.
>
> Sorry, I shouldn't have said "global" there; that was confusing.
> I was referring to the nil case.
>
> i.e. I would expect the .dir-locals.el to have, say:
>
> ((nil . ((indent-tabs-mode . t)))
> (tex-mode . ((indent-tabs-mode . nil))))
>
> So that tex-mode files don't use tabs, but other modes will.
But having to add
(tex-mode . ((indent-tabs-mode . nil)))
when the major mode normally does it for you is kind of a let-down.
IOW, I think .dir-locals.el should offer some way to say "for files in
this directory, behave as if var `foo` was `setq-default` to `bar`".
> However, I've also just noticed that Emacs 26.1 appears to have broken/
> inverted the way that such overrides work.
>
> https://emacs.stackexchange.com/a/46005/454
That looks like a bug.
Stefan