]> git.eshelyaron.com Git - emacs.git/commitdiff
* 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)
committerEshel Yaron <me@eshelyaron.com>
Sun, 3 Mar 2024 17:03:18 +0000 (18:03 +0100)
This fixes bug#69373.

(cherry picked from commit b7cef701cb587ecb66f192e4d41aa202645560e0)

lisp/files.el

index bacb07f2a9f77e09a42555b9d0a82d903c3fc337..ba3f0349aec6dc5a8abd88a9bacc1dc8c433d07e 100644 (file)
@@ -4375,10 +4375,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)))