unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Phil Sainty <psainty@orcon.net.nz>
Cc: emacs-devel@gnu.org
Subject: Re: dir-local vs major-mode setting
Date: Wed, 14 Nov 2018 22:00:34 -0500	[thread overview]
Message-ID: <jwvr2fn6obw.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <0d33ce0eeef685fe5e02725fcf99e563@webmail.orcon.net.nz> (Phil Sainty's message of "Thu, 15 Nov 2018 14:18:08 +1300")

> 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.

>> 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.
> If a "hack certain local vars before running hooks" facility was added,
> I wouldn't think it should be constrained to the nil case?

For the non-nil case, the need is much less severe: for any given major
mode, in 99% of the cases, an early setting will either have no effect
or have the same effect as a late setting.

This said, for parent major modes (e.g. prog-mode, text-mode), it can
still be useful in more than 1% of the cases, indeed.


        Stefan



  reply	other threads:[~2018-11-15  3:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-14 18:30 dir-local vs major-mode setting Stefan Monnier
2018-11-14 21:58 ` Phil Sainty
2018-11-14 22:19   ` Stefan Monnier
2018-11-15  1:18     ` Phil Sainty
2018-11-15  3:00       ` Stefan Monnier [this message]
2018-11-15  3:12         ` Phil Sainty
2018-11-15  3:27           ` Stefan Monnier
2018-11-16  9:36             ` Phil Sainty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvr2fn6obw.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=psainty@orcon.net.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).