aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Kaludercic2026-02-06 22:50:49 +0100
committerPhilip Kaludercic2026-02-06 22:50:49 +0100
commitbc413b3507c19a376af08808c4e00c3e5842d4b7 (patch)
treeee542532fedaefc2438b9bd6977dfc6136d76c04
parent6314c08c6b0aeed078061d1adb97ce80a7355964 (diff)
downloademacs-bc413b3507c19a376af08808c4e00c3e5842d4b7.tar.gz
emacs-bc413b3507c19a376af08808c4e00c3e5842d4b7.zip
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.
-rw-r--r--lisp/emacs-lisp/package-activate.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/package-activate.el b/lisp/emacs-lisp/package-activate.el
index cc73860708d..3965906f5d8 100644
--- a/lisp/emacs-lisp/package-activate.el
+++ b/lisp/emacs-lisp/package-activate.el
@@ -588,7 +588,7 @@ what command to invoke to enable the package."
588 `(,(pred package-installed-p) . ,_)) 588 `(,(pred package-installed-p) . ,_))
589 nil) 589 nil)
590 (`(,_ auto-mode-alist ,ext . ,_) 590 (`(,_ auto-mode-alist ,ext . ,_)
591 (and (string-match-p ext (buffer-name)) t)) 591 (and (buffer-file-name) (string-match-p ext (buffer-file-name)) t))
592 (`(,_ magic-mode-alist ,mag . ,_) 592 (`(,_ magic-mode-alist ,mag . ,_)
593 (without-restriction 593 (without-restriction
594 (save-excursion 594 (save-excursion