unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Shynur Xie <one.last.kiss@outlook.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: "64415@debbugs.gnu.org" <64415@debbugs.gnu.org>
Subject: bug#64415: [PATCH] Use first match in dir-local `auto-mode-alist'
Date: Sun, 2 Jul 2023 11:16:17 +0000	[thread overview]
Message-ID: <PH0PR11MB7470BFC8C89BAD4EF2FA46C1D728A@PH0PR11MB7470.namprd11.prod.outlook.com> (raw)
In-Reply-To: <83o7kuo9zv.fsf@gnu.org>

GNU Emacs Manual, 49.2.5 Per-Directory Local Variables:

> The special key auto-mode-alist in a .dir-locals.el ... works much
> like the variable auto-mode-alist (see Choosing File Modes).

GNU Emacs Lisp Reference Manual, 24.2.2 How Emacs Chooses a Major
Mode:

> If auto-mode-alist has more than one element whose regexp matches
> the file name, Emacs will use the first match.

___

> Eli> Isn't that an incompatible change in long-time behavior?

That is a bug fix.  What do you mean by ‘long-time behavior’?  To be
honest, it is a long-time bug IMO.

> Eli> someone else, who relies on the current behavior, will not be.

Yes, so just let them know that this behavior has changed in NEWS.
They just need to reverse their original alist, is that very
difficult?  Not to mention that the original behavior was not
guaranteed at all.

You can of course refuse that patch, and the inconsistency between
‘auto-mode-alist’ and dir-local ‘auto-mode-alist’ will last forever.




  reply	other threads:[~2023-07-02 11:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-02 10:29 bug#64415: [PATCH] Use first match in dir-local `auto-mode-alist' Shynur Xie
2023-07-02 10:58 ` Eli Zaretskii
2023-07-02 11:16   ` Shynur Xie [this message]
2023-07-02 11:29   ` Shynur Xie
2024-06-08 23:38 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=PH0PR11MB7470BFC8C89BAD4EF2FA46C1D728A@PH0PR11MB7470.namprd11.prod.outlook.com \
    --to=one.last.kiss@outlook.com \
    --cc=64415@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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).