[Top][All Lists]

[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 17:19:16 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> I use the major mode hooks to set my preferred behaviour for each
> mode, and dir-local settings to override them in cases where I should
> *not* be using the defaults (e.g. to enforce a particular project's
> coding standards).

I'm thinking of a case where the project says "you should use TABs" so
it sets

    ((nil . ((indent-tabs-mode . t))))

in the .dir-locals.el file.  But TABs in TeX files tend to behave funny,
so tex-mode.el sets indent-tabs-mode to nil.  Assuming the
.dir-locals.el setting was meant for "the majority of the files" and
those aren't .tex files, it would make sense to favor the major
mode's setting for the few .tex files.

I guess sometimes you want one and sometimes you want the other.
So maybe to handle that case we'd want to introduce another wildcard
that works like the `nil` above but implies it's applied before running
the major mode's setup function.


reply via email to

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