* lisp/files.el (hack-one-local-variable): Use set-auto-mode-0

This fixes bug#69373.
This commit is contained in:
Stefan Monnier 2024-02-25 11:35:44 -05:00
parent 0530800175
commit b7cef701cb

View file

@ -4238,10 +4238,8 @@ already the major mode."
(pcase var (pcase var
('mode ('mode
(let ((mode (intern (concat (downcase (symbol-name val)) (let ((mode (intern (concat (downcase (symbol-name val))
"-mode")))) "-mode"))))
(unless (eq (indirect-function mode) (set-auto-mode-0 mode t)))
(indirect-function major-mode))
(funcall mode))))
('eval ('eval
(pcase val (pcase val
(`(add-hook ',hook . ,_) (hack-one-local-variable--obsolete hook))) (`(add-hook ',hook . ,_) (hack-one-local-variable--obsolete hook)))