GNU bug report logs - #13174
24.1; comment-region incorrectly handling XML comments already present

Previous Next

Package: emacs;

Reported by: Louis-Dominique Dubeau <ldd <at> lddubeau.com>

Date: Thu, 13 Dec 2012 16:58:04 UTC

Severity: normal

Found in version 24.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13174 in the body.
You can then email your comments to 13174 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#13174; Package emacs. (Thu, 13 Dec 2012 16:58:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Louis-Dominique Dubeau <ldd <at> lddubeau.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 13 Dec 2012 16:58:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Louis-Dominique Dubeau <ldd <at> lddubeau.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.1; comment-region incorrectly handling XML comments already present
Date: Thu, 13 Dec 2012 10:00:15 -0500
1. Execute:

$ emacs -Q

2. M-x nxml-mode.

3. Emtpy the buffer.

4. Enter the following text:

<!-- Blah -->

5. Select that text and issue M-x comment-region.

The text becomes: 

<!-- <\!-- Blah -\-> -->

which is invalid XML. Josse van der Plaat has a solution at:

http://emacswiki.org/emacs/mz-comment-fix.el

Using his solution yields:
 
<!-- <!-\- Blah -\-> -->

which is is valid XML.

This is a bug which has been circulating the internet since at least
2004. James Clark reported in 2004 having communicated with the
maintainer of newcomment.el but apparently nothing happened. See this
message:

http://tech.groups.yahoo.com/group/emacs-nxml-mode/message/661

Please integrate Josse van der Plaat's solution to emacs. Thank you.

In GNU Emacs 24.1.1 (x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2012-09-22 on batsu, modified by Debian
Windowing system distributor `The X.Org Foundation', version
11.0.11300000
Configured using:
 `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu'
 '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
 '--localstatedir=/var/lib' '--infodir=/usr/share/info'
 '--mandir=/usr/share/man' '--with-pop=yes'

'--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.1/site-lisp:/usr/share/emacs/site-lisp'
 '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes'
 '--with-x-toolkit=lucid' '--with-toolkit-scroll-bars' '--without-gconf'
 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector
 --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -O2'
 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: nXML

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-x n x m l - m o <tab> <return> C-SPC <C-up> C-w <down> 
<down> < ! - - SPC B l a h SPC - - > <return> <up> 
C-SPC <down> M-x <up> <up> <up> <down> C-k c o m m 
e n <tab> - <backspace> r <tab> <return> <help-echo> 
<help-echo> M-x <up> <down> e m a c <tab> b u <tab> 
<tab> <backspace> <tab> <backspace> <tab> <M-backspace> 
<M-backspace> <M-backspace> <M-backspace> r e e <tab> 
<backspace> p <tab> o <tab> r <tab> <return>

Recent messages:
Error during redisplay: (error "Invalid search bound (wrong side of
point)")
Mark set
Illegal char in prolog
byte-code: End of buffer [2 times]
No document element [8 times]
Mark activated
goto-history-element: Beginning of history; no preceding item [2 times]
kill-line: End of buffer
No document element
Making completion list... [2 times]

Load-path shadows:
/usr/share/emacs/24.1/site-lisp/debian-startup
hides /usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs/24.1/site-lisp/dictionaries-common/flyspell
hides /usr/share/emacs/24.1/lisp/textmodes/flyspell
/usr/share/emacs/24.1/site-lisp/dictionaries-common/ispell
hides /usr/share/emacs/24.1/lisp/textmodes/ispell

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils help-mode view newcomment nxml-uchnm rng-xsd
xsd-regexp rng-cmpct regexp-opt rng-nxml rng-valid rng-loc rng-uri
rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns
easymenu nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph nxml-enc
xmltok time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel
x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face files text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind dynamic-setting
system-font-setting font-render-setting x-toolkit x multi-tty emacs)






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13174; Package emacs. (Fri, 16 Aug 2019 07:24:02 GMT) Full text and rfc822 format available.

Message #8 received at 13174 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Louis-Dominique Dubeau <ldd <at> lddubeau.com>
Cc: 13174 <at> debbugs.gnu.org
Subject: Re: bug#13174: 24.1; comment-region incorrectly handling XML
 comments already present
Date: Fri, 16 Aug 2019 00:23:42 -0700
Louis-Dominique Dubeau <ldd <at> lddubeau.com> writes:

> 1. Execute:
>
> $ emacs -Q
>
> 2. M-x nxml-mode.
>
> 3. Emtpy the buffer.
>
> 4. Enter the following text:
>
> <!-- Blah -->
>
> 5. Select that text and issue M-x comment-region.
>
> The text becomes: 
>
> <!-- <\!-- Blah -\-> -->
>
> which is invalid XML. Josse van der Plaat has a solution at:
>
> http://emacswiki.org/emacs/mz-comment-fix.el
>
> Using his solution yields:
>
> <!-- <!-\- Blah -\-> -->
>
> which is is valid XML.

(I'm going through old bug reports that have unfortunately gotten no
responses yet.)

I tried your recipe in Emacs 27, and I got:

<!-- <!-\- Blah -\-> -->

So I'm going to go ahead and guess that this bug has been fixed at some
point in the years since the report was filed, and I'm closing this bug
report.  If you're still seeing this, please reopen.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 13174 <at> debbugs.gnu.org and Louis-Dominique Dubeau <ldd <at> lddubeau.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 16 Aug 2019 07:25:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 13 Sep 2019 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 282 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.