GNU bug report logs - #63740
broken and questionable attribute normalisation in xml.el

Previous Next

Package: emacs;

Reported by: Mattias Engdegård <mattias.engdegard <at> gmail.com>

Date: Fri, 26 May 2023 15:16:02 UTC

Severity: normal

Done: Mattias Engdegård <mattiase <at> acm.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 63740 in the body.
You can then email your comments to 63740 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#63740; Package emacs. (Fri, 26 May 2023 15:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mattias Engdegård <mattias.engdegard <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 26 May 2023 15:16:02 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Emacs Bug Report <bug-gnu-emacs <at> gnu.org>
Cc: Juanma Barranquero <lekktu <at> gmail.com>,
 "Mark A. Hershberger" <mah <at> everybody.org>
Subject: broken and questionable attribute normalisation in xml.el
Date: Fri, 26 May 2023 17:14:53 +0200
In `xml-parse-attlist`, we see:

      ;; Multiple whitespace characters should be replaced with a single one
      ;; in the attributes
      (let ((string (match-string-no-properties 1)))
	(replace-regexp-in-string "\\s-\\{2,\\}" " " string)
        ...

The call to `replace-regexp-in-string` is of course useless and there is now a compiler warning telling us, which is how this came to light.

However, should we really collapse whitespace here? If I'm reading the spec correctly, it's not done for CDATA attributes and we have no reason to believe any other type, do we?

I'm no XML expert but it looks like the code is correct and we can just remove the call to `replace-regexp-in-string` (and the misleading comment). Or?





Reply sent to Mattias Engdegård <mattiase <at> acm.org>:
You have taken responsibility. (Tue, 30 May 2023 15:51:02 GMT) Full text and rfc822 format available.

Notification sent to Mattias Engdegård <mattias.engdegard <at> gmail.com>:
bug acknowledged by developer. (Tue, 30 May 2023 15:51:02 GMT) Full text and rfc822 format available.

Message #10 received at 63740-done <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: 63740-done <at> debbugs.gnu.org
Subject: bug#63740: broken and questionable attribute normalisation in xml.el
Date: Tue, 30 May 2023 17:50:01 +0200
I decided that the attempt to collapse whitespace in attributes is wrong and removed the ineffective attempt to do so in 9ae212fb1e. Bug closed.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 28 Jun 2023 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 274 days ago.

Previous Next


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