1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-08 16:52:40 -08:00

Use 'buffer-file-name' when matching 'auto-mode-alist'

* lisp/emacs-lisp/package-activate.el (package--suggestion-applies-p):
The file name associated with a buffer is a better match for
entries in 'auto-mode-alist', so we use that instead of the
buffer name that can have additional noise to make the name unique.
This commit is contained in:
Philip Kaludercic 2026-02-06 22:50:49 +01:00
parent 6314c08c6b
commit bc413b3507
No known key found for this signature in database

View file

@ -588,7 +588,7 @@ what command to invoke to enable the package."
`(,(pred package-installed-p) . ,_))
nil)
(`(,_ auto-mode-alist ,ext . ,_)
(and (string-match-p ext (buffer-name)) t))
(and (buffer-file-name) (string-match-p ext (buffer-file-name)) t))
(`(,_ magic-mode-alist ,mag . ,_)
(without-restriction
(save-excursion