unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: patrick mc allister <pma@rdorte.org>
Cc: 21293@debbugs.gnu.org
Subject: bug#21293: 24.5; libxml-xml-parse-region and comments at end of file
Date: Tue, 01 Mar 2016 17:09:47 +1100	[thread overview]
Message-ID: <87vb56u3tg.fsf@gnus.org> (raw)
In-Reply-To: <20150819092903.GH2340@rdorte.org> (patrick mc allister's message of "Wed, 19 Aug 2015 11:29:03 +0200")

patrick mc allister <pma@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





  reply	other threads:[~2016-03-01  6:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-19  9:29 bug#21293: 24.5; libxml-xml-parse-region and comments at end of file patrick mc allister
2016-03-01  6:09 ` Lars Ingebrigtsen [this message]
2016-03-01 17:04   ` Ulf Jasper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vb56u3tg.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=21293@debbugs.gnu.org \
    --cc=pma@rdorte.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).