GNU bug report logs -
#21293
24.5; libxml-xml-parse-region and comments at end of file
Previous Next
Reported by: patrick mc allister <pma <at> rdorte.org>
Date: Wed, 19 Aug 2015 09:30:03 UTC
Severity: normal
Found in version 24.5
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #10 received at 21293 <at> debbugs.gnu.org (full text, mbox):
patrick mc allister <pma <at> rdorte.org> writes:
> It seems something goes wrong with `libxml-parse-xml-region' when
> there are comments at the end of the file:
>
> emacs -Q
>
> then run this function to see the problem:
>
> (defun setup-problem ()
> (let ((testBuffer (get-buffer-create "*a libxml parse problem")))
> (with-current-buffer testBuffer
> (erase-buffer)
> (insert "<something />
> <!-- a comment -->
> <!-- another comment -->")
> (goto-char (point-min))
> (libxml-parse-xml-region (point-min) (point-max)))))
>
> (setup-problem) ;; (top nil (comment nil " a comment ") (comment nil " another comment "))
I'm unable to reproduce this problem with the current Emacs trunk. I get:
(top nil (something nil) (comment nil " a comment ") (comment nil " another comment "))
> So it seems the "something" element does not make it into the list?
> The problem only appears if there are more than two comments at the
> end. If there's only one, the region gets parsed as expected, and the
> last comment gets lost:
>
> (defun setup-problem-b ()
> (let ((testBuffer (get-buffer-create "*a libxml parse problem")))
> (with-current-buffer testBuffer
> (erase-buffer)
> (insert "<something />
> <!-- only one comment -->")
> (goto-char (point-min))
> (libxml-parse-xml-region (point-min) (point-max)))))
>
> (setup-problem-b) ;; (something nil)
And this seems to work, too.
This looks like it was fixed by Ulf Jasper a while ago, according to the
git log, so 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
This bug report was last modified 9 years and 81 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.