]> git.eshelyaron.com Git - emacs.git/commitdiff
sgml-mode: Only set sgml-xml-mode if guessed to be an XML file
authorPhilip K <philipk@posteo.net>
Wed, 14 Apr 2021 17:19:01 +0000 (19:19 +0200)
committerStefan Kangas <stefan@marxist.se>
Wed, 21 Apr 2021 13:27:19 +0000 (15:27 +0200)
* lisp/textmodes/sgml-mode.el (sgml-mode): Don't override
sgml-xml-mode if the result of the guess is used as the buffer local
value.  (Bug#47877)

lisp/textmodes/sgml-mode.el

index 67f731917e25dd61359aae76cdcd80b51713ae80..d5930e82df3ed0296547c64e9da5a3de25451a28 100644 (file)
@@ -623,7 +623,8 @@ Do \\[describe-key] on the following bindings to discover what they do.
   (setq-local syntax-propertize-function #'sgml-syntax-propertize)
   (setq-local syntax-ppss-table sgml-tag-syntax-table)
   (setq-local facemenu-add-face-function 'sgml-mode-facemenu-add-face-function)
-  (setq-local sgml-xml-mode (sgml-xml-guess))
+  (when (sgml-xml-guess)
+    (setq-local sgml-xml-mode t))
   (unless sgml-xml-mode
     (setq-local skeleton-transformation-function sgml-transformation-function))
   ;; This will allow existing comments within declarations to be