aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Kharlamov2024-06-25 12:26:12 +0300
committerStefan Kangas2024-07-25 10:48:03 +0200
commit9eea6be5abffa91d21ea299158d5a2cd6cfb5089 (patch)
tree8a16e1544f2336417177bc172f156b6e9fa50a06
parentb97786d9f6ec242501e8db40bb4da08f0f64d04d (diff)
downloademacs-9eea6be5abffa91d21ea299158d5a2cd6cfb5089.tar.gz
emacs-9eea6be5abffa91d21ea299158d5a2cd6cfb5089.zip
Don't produce invalid XML with multi-line commenting style
Both XML and HTML forbid double hyphens inside comments. However, nxml-mode was using a `!--' as a comment padding if `comment-style' was set to any of the styles that supposed to add padding. This infix was auto-derived due to `comment-continue' being nil. To fix that set `comment-continue' explicitly. It's unclear what padding should be used, but from looking at other editors it seems they don't typically add padding in XML, so let's be simple for now and just set `comment-continue' to empty string. * lisp/nxml/nxml-mode.el (nxml-mode): Make 'comment-continue' a buffer-local variable set to the empty string. (Bug#71772)
-rw-r--r--lisp/nxml/nxml-mode.el1
1 files changed, 1 insertions, 0 deletions
diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el
index 02391dc6968..a58d3f3c75f 100644
--- a/lisp/nxml/nxml-mode.el
+++ b/lisp/nxml/nxml-mode.el
@@ -531,6 +531,7 @@ Many aspects this mode can be customized using
531 (setq-local comment-end-skip "[ \t\r\n]*-->") 531 (setq-local comment-end-skip "[ \t\r\n]*-->")
532 (setq-local comment-line-break-function #'nxml-newline-and-indent) 532 (setq-local comment-line-break-function #'nxml-newline-and-indent)
533 (setq-local comment-quote-nested-function #'nxml-comment-quote-nested) 533 (setq-local comment-quote-nested-function #'nxml-comment-quote-nested)
534 (setq-local comment-continue "") ; avoid double-hyphens as a padding
534 (save-excursion 535 (save-excursion
535 (save-restriction 536 (save-restriction
536 (widen) 537 (widen)