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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user