From: Stefan Monnier Date: Sun, 25 Feb 2024 16:35:44 +0000 (-0500) Subject: * lisp/files.el (hack-one-local-variable): Use `set-auto-mode-0` X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bae62f54cb60ed6767c608ddc1d2226748d71325;p=emacs.git * lisp/files.el (hack-one-local-variable): Use `set-auto-mode-0` This fixes bug#69373. (cherry picked from commit b7cef701cb587ecb66f192e4d41aa202645560e0) --- diff --git a/lisp/files.el b/lisp/files.el index bacb07f2a9f..ba3f0349aec 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -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)))