* lisp/files.el (hack-one-local-variable): Use `set-auto-mode-0`
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 25 Feb 2024 16:35:44 +0000 (11:35 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 25 Feb 2024 16:35:44 +0000 (11:35 -0500)
This fixes bug#69373.

lisp/files.el

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