]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix indentation of non-comment HTML with -- in it
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 1 Feb 2021 09:42:22 +0000 (10:42 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 1 Feb 2021 09:42:22 +0000 (10:42 +0100)
* lisp/textmodes/sgml-mode.el (sgml-comment-indent-new-line): Only
indent as if we're in a comment if syntax-ppss says that we're in
a comment (bug#36227).

lisp/textmodes/sgml-mode.el

index 3e29f055ece1948b07766ea1cc8afc4c9188747f..7051f520b909c072cc09668a64b1b9436e73ead5 100644 (file)
@@ -510,10 +510,12 @@ an optional alist of possible values."
 (with-no-warnings (defvar v2))                         ; free for skeleton
 
 (defun sgml-comment-indent-new-line (&optional soft)
-  (let ((comment-start "-- ")
-       (comment-start-skip "\\(<!\\)?--[ \t]*")
-       (comment-end " --")
-       (comment-style 'plain))
+  (if (ppss-comment-depth (syntax-ppss))
+      (let ((comment-start "-- ")
+           (comment-start-skip "\\(<!\\)?--[ \t]*")
+           (comment-end " --")
+           (comment-style 'plain))
+        (comment-indent-new-line soft))
     (comment-indent-new-line soft)))
 
 (defun sgml-mode-facemenu-add-face-function (face _end)