emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master a6be184: Fix indentation of non-comment HTML with -- in it


From: Lars Ingebrigtsen
Subject: master a6be184: Fix indentation of non-comment HTML with -- in it
Date: Mon, 1 Feb 2021 04:42:31 -0500 (EST)

branch: master
commit a6be18461471b0889ded6084693664927a041704
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix indentation of non-comment HTML with -- in it
    
    * 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 | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index 3e29f05..7051f52 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]