GNU bug report logs -
#75961
set-auto-mode--apply-alist
Previous Next
Reported by: nat chapman <nat.chapman <at> proton.me>
Date: Fri, 31 Jan 2025 07:59:02 UTC
Severity: normal
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
Message #23 received at 75961 <at> debbugs.gnu.org (full text, mbox):
On Sunday, February 16th, 2025 at 00:19, Eli Zaretskii <eliz <at> gnu.org> wrote:
>
>
> > From: Stefan Monnier monnier <at> iro.umontreal.ca
>
> > Cc: nat chapman nat.chapman <at> proton.me, 75961 <at> debbugs.gnu.org,
> > tom <at> tromey.com
> > Date: Sat, 15 Feb 2025 18:53:16 -0500
> >
> > > > emacs -Q --eval '(progn (define-derived-mode test-mode fundamental-mode
> > > > "TEST" (message "Test mode called")) (add-to-list (quote auto-mode-alist)
> > > > (quote ("\\.test$" test-mode t))))' file.html.test file.test
> > > >
> > > > Buffer visiting file.html.test is in mhtml-mode, buffer visiting file.test
> > > > is in fundamental mode, no message is emitted.
> >
> > Yup.
> >
> > The patch below seems to do the trick. Any comment/objection?
>
>
> Not from me.
I'm not an expert, but the supplied test doesn't appear to check that text-mode is actually called when the mode falls through. I suspect that test would succeed even if you didn't make any change to set-auto-mode--apply alist, so I'm not sure it's useful (or at least not sufficient; maybe there wasn't a test of the (regexp mode t) behavior at all before).
This bug report was last modified 96 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.