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-Tag: archive/raspbian/1%29.4+1-4+rpi1~1^2~2^2~18^2~39 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b7cef701cb587ecb66f192e4d41aa202645560e0;p=emacs.git * lisp/files.el (hack-one-local-variable): Use `set-auto-mode-0` This fixes bug#69373. --- diff --git a/lisp/files.el b/lisp/files.el index 1e7f00e4254..c0d26b2343c 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -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)))