From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 04 09:56:04 2015 Received: (at submit) by debbugs.gnu.org; 4 Mar 2015 14:56:04 +0000 Received: from localhost ([127.0.0.1]:35127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YTAiR-0004yY-SK for submit@debbugs.gnu.org; Wed, 04 Mar 2015 09:56:04 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33464) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YTAiM-0004yB-Ud for submit@debbugs.gnu.org; Wed, 04 Mar 2015 09:55:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YTAiG-00071R-Je for submit@debbugs.gnu.org; Wed, 04 Mar 2015 09:55:53 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:51181) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTAiG-00071G-Gi for submit@debbugs.gnu.org; Wed, 04 Mar 2015 09:55:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTAiF-0008JA-HY for bug-gnu-emacs@gnu.org; Wed, 04 Mar 2015 09:55:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YTAiE-0006wU-7f for bug-gnu-emacs@gnu.org; Wed, 04 Mar 2015 09:55:51 -0500 Received: from mail-ie0-x22f.google.com ([2607:f8b0:4001:c03::22f]:42172) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTAiD-0006t3-PZ for bug-gnu-emacs@gnu.org; Wed, 04 Mar 2015 09:55:49 -0500 Received: by iecvy18 with SMTP id vy18so3673073iec.9 for ; Wed, 04 Mar 2015 06:55:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=Yq5N6ZNgVtzj90u9xzbHv2f1Zg4Cc5yu9UqHrf4pZtM=; b=uDzZlwsFPZj2n3f7a/xIB2+NTy4mYei5w1ZEzLxK6dzIdl/yaYv5rfmkWzF2HmfgFM mq30aTubnZiVrJl6e20p4omhvCA72LLyFn0SNWiBHXw5SfY7K+rlAe4XtjDFa2sfIHs8 8/5viUn93LS2243sr7qusKoPsU6wd70510ppGrtqzYLS7yB1AAne0ETc9XwftwGwVN0U dqo9SwrQoi+MlvMqdxyHu1nqsTE9z+EqE8rSMgfghZKG5o/bsiICQT68ya5VLZqt6eOD rDnrLmCocba4KjwrKCV8JjlDKfkVAPLbtRwdNu3Qk5G56xtLm/an6QZU5mPiicyPApXX hk3w== MIME-Version: 1.0 X-Received: by 10.50.142.38 with SMTP id rt6mr38011359igb.17.1425480948511; Wed, 04 Mar 2015 06:55:48 -0800 (PST) Received: by 10.36.39.138 with HTTP; Wed, 4 Mar 2015 06:55:48 -0800 (PST) Date: Wed, 4 Mar 2015 15:55:48 +0100 Message-ID: Subject: Wrong commenting of comments in nXML mode From: Paul Pogonyshev To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=001a11c3a95091f904051077a551 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --001a11c3a95091f904051077a551 Content-Type: text/plain; charset=UTF-8 $ emacs -q Create an XML buffer with the following: Now C-x h M-; to comment out everything. Text becomes this: which is not valid XML. This is even suggested by the mode itself. "<\!--" should be "
$ emacs -q

Create an= XML buffer with the following:

<foo>
=C2=A0 <!-- commen= t -->
</foo>

Now C-x h M-; to comment out everythi= ng. Text becomes this:

<!-- <foo> -->
<!--=C2=A0= =C2=A0 <\!-- comment -\-> -->
<!-- </foo> -->
which is not valid XML. This is even suggested by the mode itself. = "<\!--" should be "<!-\-" instead. Uncommenting s= hould also take that into account.

Version: GNU Emacs 25.0.50.= 1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.9) of 2015-03-03

Paul
--001a11c3a95091f904051077a551-- From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 18 17:14:09 2015 Received: (at 20001) by debbugs.gnu.org; 18 Sep 2015 21:14:09 +0000 Received: from localhost ([127.0.0.1]:37330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zd2yu-00076d-B1 for submit@debbugs.gnu.org; Fri, 18 Sep 2015 17:14:09 -0400 Received: from mail-oi0-f43.google.com ([209.85.218.43]:36805) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zd2yq-00076M-6J; Fri, 18 Sep 2015 17:14:05 -0400 Received: by oibi136 with SMTP id i136so33329137oib.3; Fri, 18 Sep 2015 14:14:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=2kLTri9DmcR8LQolAjoqSLhl1HMa94j8wtZR7ge3P00=; b=ufyOsXCnIafjjR+ThGPHeKJoIADAScoR7ZVv5M0z+uqdxhxdIkAgrM33OP1AFc0QwD ZZy0BL2C+X+8CbA9K3oAyWsBu+lGz89O4NASrSb9EMnCtmkG5aAXGiCosZ0VD4qJfsC5 xQtS9QL8mAkPaymOKDg5arVIRvO9JSgH09XNaQFO77lpFYRO8L8WXgBdsU0sACUMFS/+ kfAi1gZidpz8Cb3mN3HSJL0oCbks2FVrXPwVOwQeHZlFAWvawvrwzwdX8XYYTzus2Q0L mOA8/uuCJ0DYyA/X094OyB0MrspMf2zA/SWCwHakbYSzBmnLDSU7r939itrVYC2pDQsO Pqtg== MIME-Version: 1.0 X-Received: by 10.202.81.136 with SMTP id f130mr4842970oib.94.1442610843655; Fri, 18 Sep 2015 14:14:03 -0700 (PDT) Received: by 10.202.169.13 with HTTP; Fri, 18 Sep 2015 14:14:03 -0700 (PDT) Date: Fri, 18 Sep 2015 15:14:03 -0600 Message-ID: Subject: Re: bug#6267: 23.1; invalid XML in nested comments produced by comment-region From: Ivan Andrus To: 6267@debbugs.gnu.org, patrik.h.hagglund@ericsson.com Content-Type: multipart/alternative; boundary=001a113b1954e2a61605200c0263 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 20001 Cc: 20001@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --001a113b1954e2a61605200c0263 Content-Type: text/plain; charset=UTF-8 I have a patch for this (and the duplicate bug #20001) that I would like some feedback on from a regular developer. I think the approach is reasonable, but any feedback would be welcome. I have commmit access, so I can commit it, but I've probably forgotten some important piece. It's not user facing (except fixing a bug), so I believe I don't need a NEWS entry. I'm not sure if or where it should be documented in the manual. There doesn't seem to be documentation for `comment-region-function' (at least I didn't find any with C-h S) which seemed the closest variable that I could think of. Thanks, Ivan Allow major-modes full control over quoting nested comments * newcomment.el (comment-quote-nested-function): New variable. (comment-quote-nested-default): New function. (comment-quote-nested): Use `comment-quote-nested-function'. --- lisp/newcomment.el | 66 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 22 deletions(-) diff --git a/lisp/newcomment.el b/lisp/newcomment.el index 60f35c8..4c01742 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -179,6 +179,11 @@ comments always start in column zero.") "Non-nil if nested comments should be quoted. This should be locally set by each major mode if needed.") +(defvar comment-quote-nested-function #'comment-quote-nested-default + "Function to quote nested comments in a region. +It takes the same arguments as `comment-quote-nested-default', +and is called with the buffer narrowed to a single comment.") + (defvar comment-continue nil "Continuation string to insert for multiline comments. This string will be added at the beginning of each line except the very @@ -412,28 +417,45 @@ function should first call this function explicitly." If UNP is non-nil, unquote nested comment markers." (setq cs (comment-string-strip cs t t)) (setq ce (comment-string-strip ce t t)) - (when (and comment-quote-nested (> (length ce) 0)) - (let ((re (concat (comment-quote-re ce unp) - "\\|" (comment-quote-re cs unp)))) - (goto-char (point-min)) - (while (re-search-forward re nil t) - (goto-char (match-beginning 0)) - (forward-char 1) - (if unp (delete-char 1) (insert "\\")) - (when (= (length ce) 1) - ;; If the comment-end is a single char, adding a \ after that - ;; "first" char won't deactivate it, so we turn such a CE - ;; into !CS. I.e. for pascal, we turn } into !{ - (if (not unp) - (when (string= (match-string 0) ce) - (replace-match (concat "!" cs) t t)) - (when (and (< (point-min) (match-beginning 0)) - (string= (buffer-substring (1- (match-beginning 0)) - (1- (match-end 0))) - (concat "!" cs))) - (backward-char 2) - (delete-char (- (match-end 0) (match-beginning 0))) - (insert ce)))))))) + (when (and comment-quote-nested + comment-quote-nested-function + (> (length ce) 0)) + (funcall comment-quote-nested-function cs ce unp))) + +(defun comment-quote-nested-default (cs ce unp) + "Quote comment delimiters in the buffer. +It expects to be called with the buffer narrowed to a single comment. +It is used as a default for `comment-quote-nested-function'. + +The arguments CS and CE are regular expressions matching comment +starting and ending delimiters respectively. + +If UNP is non-nil, comments are unquoted instead. + +To quote the delimiters, a \\ is inserted after the first +character of CS or CE. If CE is a single character it will +change CE into !CS." + (let ((re (concat (comment-quote-re ce unp) + "\\|" (comment-quote-re cs unp)))) + (goto-char (point-min)) + (while (re-search-forward re nil t) + (goto-char (match-beginning 0)) + (forward-char 1) + (if unp (delete-char 1) (insert "\\")) + (when (= (length ce) 1) + ;; If the comment-end is a single char, adding a \ after that + ;; "first" char won't deactivate it, so we turn such a CE + ;; into !CS. I.e. for pascal, we turn } into !{ + (if (not unp) + (when (string= (match-string 0) ce) + (replace-match (concat "!" cs) t t)) + (when (and (< (point-min) (match-beginning 0)) + (string= (buffer-substring (1- (match-beginning 0)) + (1- (match-end 0))) + (concat "!" cs))) + (backward-char 2) + (delete-char (- (match-end 0) (match-beginning 0))) + (insert ce))))))) ;;;; ;;;; Navigation -- 2.5.2 Properly quote nested xml comments (Bug#6267) (Bug#20001) * nxml-mode.el (nxml-comment-quote-nested): New function (nxml-mode): Set comment-quote-nested-function --- lisp/nxml/nxml-mode.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el index 6c5c85b..dc151a3 100644 --- a/lisp/nxml/nxml-mode.el +++ b/lisp/nxml/nxml-mode.el @@ -546,6 +546,8 @@ Many aspects this mode can be customized using (setq comment-end-skip "[ \t\r\n]*-->") (make-local-variable 'comment-line-break-function) (setq comment-line-break-function 'nxml-newline-and-indent) + (make-local-variable 'comment-quote-nested-function) + (setq comment-quote-nested-function 'nxml-comment-quote-nested) (use-local-map nxml-mode-map) (save-excursion (save-restriction @@ -1350,6 +1352,18 @@ of the inserted start-tag or nil if none was inserted." start-tag-indent))))) inserted-start-tag-pos)) +(defun nxml-comment-quote-nested (cs ce unp) + "Quote nested comments in buffer. +See `comment-quote-nested-function' for more information.") + (goto-char (point-min)) + (save-match-data + (while (re-search-forward "-[\\]*-" nil t) + (goto-char (match-beginning 0)) + (forward-char 1) + (if unp + (delete-char 1) + (insert "\\"))))) + ;;; Indentation (defun nxml-indent-line () -- 2.5.2 --001a113b1954e2a61605200c0263 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I have a = patch for this (and the duplicate bug #20001) that I would like
some fee= dback on from a regular developer.=C2=A0 I think the approach is
reasona= ble, but any feedback would be welcome.=C2=A0 I have commmit access,
so = I can commit it, but I've probably forgotten some important piece.
<= br>It's not user facing (except fixing a bug), so I believe I don't= need a
NEWS entry.=C2=A0 I'm not sure if or where it should be docu= mented in the
manual.=C2=A0 There doesn't seem to be documentation f= or
`comment-region-function' (at least I didn't find any with C-= h S) which
seemed the closest variable that I could think of.

Tha= nks,
Ivan


Allow major-modes full control over quoting nested = comments

* newcomment.el (comment-quote-nested-function): New variab= le.
(comment-quote-nested-default): New function.
(comment-quote-nest= ed): Use `comment-quote-nested-function'.
---
=C2=A0lisp/newcomme= nt.el | 66 ++++++++++++++++++++++++++++++++++++------------------
=C2=A0= 1 file changed, 44 insertions(+), 22 deletions(-)

diff --git a/lisp/= newcomment.el b/lisp/newcomment.el
index 60f35c8..4c01742 100644
--- = a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -179,6 +179,11 @@ co= mments always start in column zero.")
=C2=A0 =C2=A0"Non-nil if= nested comments should be quoted.
=C2=A0This should be locally set by e= ach major mode if needed.")
=C2=A0
+(defvar comment-quote-nested= -function #'comment-quote-nested-default
+ =C2=A0"Function to q= uote nested comments in a region.
+It takes the same arguments as `comme= nt-quote-nested-default',
+and is called with the buffer narrowed to= a single comment.")
+
=C2=A0(defvar comment-continue nil
=C2= =A0 =C2=A0"Continuation string to insert for multiline comments.
= =C2=A0This string will be added at the beginning of each line except the ve= ry
@@ -412,28 +417,45 @@ function should first call this function explic= itly."
=C2=A0If UNP is non-nil, unquote nested comment markers.&quo= t;
=C2=A0 =C2=A0(setq cs (comment-string-strip cs t t))
=C2=A0 =C2=A0= (setq ce (comment-string-strip ce t t))
- =C2=A0(when (and comment-quote= -nested (> (length ce) 0))
- =C2=A0 =C2=A0(let ((re (concat (comment-= quote-re ce unp)
- =C2=A0 = =C2=A0 =C2=A0 "\\|" (comment-quote-re cs unp))))
- =C2=A0 =C2= =A0 =C2=A0(goto-char (point-min))
- =C2=A0 =C2=A0 =C2=A0(while (re-searc= h-forward re nil t)
- (goto-= char (match-beginning 0))
- = (forward-char 1)
- (if unp (= delete-char 1) (insert "\\"))
- (when (=3D (length ce) 1)
- =C2=A0 ;; If the comment-end is a single char, adding a \ aft= er that
- =C2=A0 ;; "fi= rst" char won't deactivate it, so we turn such a CE
- =C2=A0 ;; into !CS.=C2=A0 I.e. for pasca= l, we turn } into !{
- =C2= =A0 (if (not unp)
- =C2=A0 = =C2=A0 =C2=A0 (when (string=3D (match-string 0) ce)
- (replace-match (concat "!" cs) t t))- =C2=A0 =C2=A0 (when (and (&= lt; (point-min) (match-beginning 0))
- =C2=A0 =C2=A0 =C2=A0 =C2=A0(string=3D (buffer-substring (1- (ma= tch-beginning 0))
- =C2= =A0 (1- (match-end 0)))
- (concat "!" cs)))
- =C2=A0 =C2=A0 =C2=A0 (backward-char 2)
- =C2=A0 =C2=A0 =C2=A0 (delete-char (- (match-end 0) (match-b= eginning 0)))
- =C2=A0 =C2= =A0 =C2=A0 (insert ce))))))))
+ =C2=A0(when (and comment-quote-nested+ =C2=A0 =C2=A0 =C2=A0comment-= quote-nested-function
+ =C2= =A0 =C2=A0 =C2=A0(> (length ce) 0))
+ =C2=A0 =C2=A0(funcall comment-q= uote-nested-function cs ce unp)))
+
+(defun comment-quote-nested-defa= ult (cs ce unp)
+ =C2=A0"Quote comment delimiters in the buffer.+It expects to be called with the buffer narrowed to a single comment.
= +It is used as a default for `comment-quote-nested-function'.
+
+= The arguments CS and CE are regular expressions matching comment
+starti= ng and ending delimiters respectively.
+
+If UNP is non-nil, comments= are unquoted instead.
+
+To quote the delimiters, a \\ is inserted a= fter the first
+character of CS or CE.=C2=A0 If CE is a single character= it will
+change CE into !CS."
+ =C2=A0(let ((re (concat (commen= t-quote-re ce unp)
+ =C2=A0= =C2=A0 "\\|" (comment-quote-re cs unp))))
+ =C2=A0 =C2=A0(got= o-char (point-min))
+ =C2=A0 =C2=A0(while (re-search-forward re nil t)+ =C2=A0 =C2=A0 =C2=A0(goto-char (match-beginning 0))
+ =C2=A0 =C2=A0 = =C2=A0(forward-char 1)
+ =C2=A0 =C2=A0 =C2=A0(if unp (delete-char 1) (in= sert "\\"))
+ =C2=A0 =C2=A0 =C2=A0(when (=3D (length ce) 1)+ ;; If the comment-end is a s= ingle char, adding a \ after that
+= ;; "first" char won't deactivate it, so we turn such = a CE
+ ;; into !CS.=C2=A0 I.= e. for pascal, we turn } into !{
+ = (if (not unp)
+ =C2= =A0 =C2=A0 (when (string=3D (match-string 0) ce)
+ =C2=A0 =C2=A0 =C2=A0 (replace-match (concat "!&= quot; cs) t t))
+ =C2=A0 (wh= en (and (< (point-min) (match-beginning 0))
+ =C2=A0 =C2=A0 =C2=A0(string=3D (buffer-substring (1- = (match-beginning 0))
+ = (1- (match-end 0)))
+ =C2= =A0 =C2=A0 =C2=A0 (concat "!" cs)))
+ =C2=A0 =C2=A0 (backward-char 2)
+ =C2=A0 =C2=A0 (delete-char (- (match-end 0) (matc= h-beginning 0)))
+ =C2=A0 = =C2=A0 (insert ce)))))))
=C2=A0
=C2=A0;;;;
=C2=A0;;;; Navigation--=C2=A0
2.5.2



Properly quote nested xml comments (Bug#= 6267) (Bug#20001)

* nxml-mode.el (nxml-comment-quote-nested): New fu= nction
(nxml-mode): Set comment-quote-nested-function
---
=C2=A0li= sp/nxml/nxml-mode.el | 14 ++++++++++++++
=C2=A01 file changed, 14 insert= ions(+)

diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el=
index 6c5c85b..dc151a3 100644
--- a/lisp/nxml/nxml-mode.el
+++ b/= lisp/nxml/nxml-mode.el
@@ -546,6 +546,8 @@ Many aspects this mode can be= customized using
=C2=A0 =C2=A0(setq comment-end-skip "[ \t\r\n]*--= >")
=C2=A0 =C2=A0(make-local-variable 'comment-line-break-fu= nction)
=C2=A0 =C2=A0(setq comment-line-break-function 'nxml-newline= -and-indent)
+ =C2=A0(make-local-variable 'comment-quote-nested-func= tion)
+ =C2=A0(setq comment-quote-nested-function 'nxml-comment-quot= e-nested)
=C2=A0 =C2=A0(use-local-map nxml-mode-map)
=C2=A0 =C2=A0(sa= ve-excursion
=C2=A0 =C2=A0 =C2=A0(save-restriction
@@ -1350,6 +1352,1= 8 @@ of the inserted start-tag or nil if none was inserted."
=C2=A0= =C2=A0 =C2=A0 start-tag-inde= nt)))))
=C2=A0 =C2=A0 =C2=A0inserted-start-tag-pos))
=C2=A0
+(defu= n nxml-comment-quote-nested (cs ce unp)
+ =C2=A0"Quote nested comme= nts in buffer.
+See `comment-quote-nested-function' for more informa= tion.")
+ =C2=A0(goto-char (point-min))
+ =C2=A0(save-match-data=
+ =C2=A0 =C2=A0(while (re-search-forward "-[\\]*-" nil t)
= + =C2=A0 =C2=A0 =C2=A0(goto-char (match-beginning 0))
+ =C2=A0 =C2=A0 = =C2=A0(forward-char 1)
+ =C2=A0 =C2=A0 =C2=A0(if unp
+ =C2=A0 (delete-char 1)
+ (insert "\\")))))
+
=C2=A0;;; In= dentation
=C2=A0
=C2=A0(defun nxml-indent-line ()
--=C2=A0
2.5.= 2


--001a113b1954e2a61605200c0263-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 19 00:07:43 2015 Received: (at 20001) by debbugs.gnu.org; 19 Sep 2015 04:07:43 +0000 Received: from localhost ([127.0.0.1]:37395 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zd9R9-0002M7-30 for submit@debbugs.gnu.org; Sat, 19 Sep 2015 00:07:43 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:39944) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zd9R6-0002Lw-Ff; Sat, 19 Sep 2015 00:07:41 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AxFgA731xV/2yixEVcgxCEAoVVu0CHSwQCAoE8OxIBAQEBAQEBgQpBBYNdAQEEViMQCw4mEhQYDSSIP88jAQEBAQYBAQEBHos6hQUHhC0FnxeDa5A9gUUjYYMzIoJ4AQEB X-IPAS-Result: A0AxFgA731xV/2yixEVcgxCEAoVVu0CHSwQCAoE8OxIBAQEBAQEBgQpBBYNdAQEEViMQCw4mEhQYDSSIP88jAQEBAQYBAQEBHos6hQUHhC0FnxeDa5A9gUUjYYMzIoJ4AQEB X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="165285987" Received: from 69-196-162-108.dsl.teksavvy.com (HELO ceviche.home) ([69.196.162.108]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 19 Sep 2015 00:07:39 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 32FA06619A; Sat, 19 Sep 2015 00:07:33 -0400 (EDT) From: Stefan Monnier To: Ivan Andrus Subject: Re: bug#6267: 23.1; invalid XML in nested comments produced by comment-region Message-ID: References: Date: Sat, 19 Sep 2015 00:07:33 -0400 In-Reply-To: (Ivan Andrus's message of "Fri, 18 Sep 2015 15:14:03 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 20001 Cc: 20001@debbugs.gnu.org, 6267@debbugs.gnu.org, patrik.h.hagglund@ericsson.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) The approach looks fine, thank you. > +(defvar comment-quote-nested-function #'comment-quote-nested-default [...] > + (when (and comment-quote-nested > + comment-quote-nested-function comment-quote-nested-function will always be a function so it should never be nil, so there's no need to test it here. > +The arguments CS and CE are regular expressions matching comment > +starting and ending delimiters respectively. AFAICT this is not true. They're just strings, not regexps. > + (make-local-variable 'comment-quote-nested-function) > + (setq comment-quote-nested-function 'nxml-comment-quote-nested) I know the rest of the file doesn't use it, but please in new code use: (setq-local comment-quote-nested-function #'nxml-comment-quote-nested) -- Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 23 20:02:55 2015 Received: (at 20001) by debbugs.gnu.org; 24 Sep 2015 00:02:56 +0000 Received: from localhost ([127.0.0.1]:43132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zetzz-0005kO-FS for submit@debbugs.gnu.org; Wed, 23 Sep 2015 20:02:55 -0400 Received: from mail-ig0-f174.google.com ([209.85.213.174]:36650) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zetzy-0005kE-9J; Wed, 23 Sep 2015 20:02:54 -0400 Received: by igcrk20 with SMTP id rk20so110805803igc.1; Wed, 23 Sep 2015 17:02:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:message-id:date :to:mime-version; bh=6m4mz+zJKbqWwvfExMxv+HKvNoa2fJEBn2LtyAkiUa4=; b=i+kjCyC6HJktqjO++4Um42yDKlfzKrQ580ot4Fh+BH3csJeGjhTNYMJVKJYGQ+c1Rj PRyNgRpwewydaisyJp6EX/cKRjzAk9qREsEgWxKEYiPAt/sOlkmC2d+lXohSgITzkxgR yE+tEqrcelw+Vrw3i3gjyr8N3/OsngX1MQJv0xn67f5PkW0oTUqjuFDvmchNxavNheYa k/6PqIGGUtO5gsmgkJybmq5xYofAZFIHYZWVcZFe9f7oXWjZFGa15YavOYSTFgdV3Dmp qmfM4nnFRKbUtq9tjxYRvAdK2b0KxLNqzhkAE2l9FYlunbQAigZ70vseQPoUhk8y8t3l 4AQQ== X-Received: by 10.50.143.10 with SMTP id sa10mr26533740igb.66.1443052973632; Wed, 23 Sep 2015 17:02:53 -0700 (PDT) Received: from [192.168.0.3] (97-117-23-179.slkc.qwest.net. [97.117.23.179]) by smtp.gmail.com with ESMTPSA id pl9sm4427309igb.8.2015.09.23.17.02.52 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Sep 2015 17:02:53 -0700 (PDT) From: Ivan Andrus Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: close bugs 6267 and 20001 Message-Id: Date: Wed, 23 Sep 2015 18:02:50 -0600 To: 20001@debbugs.gnu.org, 6267@debbugs.gnu.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) X-Mailer: Apple Mail (2.2104) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 20001 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) close 6267 25.1 close 20001 25.1 From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 23 20:50:26 2015 Received: (at control) by debbugs.gnu.org; 24 Sep 2015 00:50:26 +0000 Received: from localhost ([127.0.0.1]:43149 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zeujy-0006sx-8W for submit@debbugs.gnu.org; Wed, 23 Sep 2015 20:50:26 -0400 Received: from mail-ig0-f177.google.com ([209.85.213.177]:34492) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zeujv-0006sn-G5 for control@debbugs.gnu.org; Wed, 23 Sep 2015 20:50:23 -0400 Received: by igcpb10 with SMTP id pb10so4390562igc.1 for ; Wed, 23 Sep 2015 17:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:message-id:date :to:mime-version; bh=6m4mz+zJKbqWwvfExMxv+HKvNoa2fJEBn2LtyAkiUa4=; b=hp+p8P1zNKh6gzTGPUQ837JPmzYNgxGjXGnZaSmIWfsNOyU4rm0WPp6DlL0bn5+EcL Pu50zu7yMTxQmXmOKp+UtnE0+ypbGnd8VL/CQm8BpCY8uT1T8i+c74bBjmBNOMNPK4mg 8VMaMmSlMJLr3wF02KqxnH4ToHRd16pqQnojvR0AYrK/cRxFjibZmp/8j+IgmiiSinb8 7O2WPtnTpjwv8lPz+w5KX6tYvObgOWeJe8bcuvD5pcSZqHScUWDo02OQM7XXE/TNXPid +wnyynU7wF73uk1u7RFJKpSSJJHtZjXtPs/dmm56/m9aSdxDlP/QO+2a450qKpxNounh MsNA== X-Received: by 10.50.141.166 with SMTP id rp6mr14582854igb.29.1443055822953; Wed, 23 Sep 2015 17:50:22 -0700 (PDT) Received: from [192.168.0.3] (97-117-23-179.slkc.qwest.net. [97.117.23.179]) by smtp.gmail.com with ESMTPSA id 39sm4706921ioh.38.2015.09.23.17.50.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Sep 2015 17:50:22 -0700 (PDT) From: Ivan Andrus Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: close bugs 6267 and 20001 Message-Id: <7386510A-BFD4-4421-BAC9-5B77D320BDCF@gmail.com> Date: Wed, 23 Sep 2015 18:50:21 -0600 To: control@debbugs.gnu.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) X-Mailer: Apple Mail (2.2104) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) close 6267 25.1 close 20001 25.1 From unknown Mon Aug 18 11:10:43 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 22 Oct 2015 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator