all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ruijie Yu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, 63125@debbugs.gnu.org
Subject: bug#63125: 30.0.50; [BUG] last argument of libxml-parse-html-region has no effect?
Date: Sat, 29 Apr 2023 08:58:03 +0800	[thread overview]
Message-ID: <sdvmt2rlc36.fsf@netyu.xyz> (raw)
In-Reply-To: <83ttx0qm3z.fsf@gnu.org>


Eli Zaretskii <eliz@gnu.org> writes:

>> From: Ruijie Yu <ruijie@netyu.xyz>
>> Cc: Eli Zaretskii <eliz@gnu.org>, 63125@debbugs.gnu.org
>> Date: Fri, 28 Apr 2023 18:40:35 +0800
>> 
>> > I have filed an issue [1] in libxml2.  We'll see what they say about it.
>> >
>> > FTR, [2] is the documentation of the libxml2's htmlReadMemory()
>> > function -- though it does not say much.
>> >
>> > [1]: https://gitlab.gnome.org/GNOME/libxml2/-/issues/525
>> > [2]:
>> > https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-HTMLparser.html#htmlReadMemory.
>> 
>> I just got a response from one of libxml2's maintainers.
>> 
>> It seems that the docstring for `libxml-parse-html-region' is wrong:
>> this argument has never served the purpose of resolving relative URLs.
>> It was only used for error messages.  So I suggest that we modify the
>> docstring of this function and `libxml-parse-xml-region' to reflect this
>> fact.
>
> The response doesn't say much.  What is this "base URL" argument used
> for, and why is it named "bas URL"?  What does it mean "used for error
> messages"?  And where is the up-to-date and accurate documentation of
> this function, which explains what is this argument for?
>
> Without knowing all that, we cannot fix our documentation, let alone
> code.

The "base-url" is an argument to the Elisp function
`libxml-parse-html-region'.  I added Lars to the CC, who originally
introduced this function according to git-blame, and who may have a
better idea.

The following portion are my impressions, but I'm happy to pass any
questions you still have to the libxml2 devs if you want (or you can
comment there directly in the linked issue on gnome's gitlab instance).

-----

As you pointed out, these arguments of the Elisp function are passed
with minimal transformations and sent to the libxml2 function
`htmlReadMemory()' function.  This C function takes an argument `url',
which is the string `base-url' or empty string if `base-url' is nil.

According to Nick (the libxml2 maintainer) and my interpretation, the
`url' parameter of the libxml2 function is simply stored inside the
`url' field of a `xmlDoc' struct, to be used when an error message needs
to be displayed.  So, the `url' parameter practically does nothing for
us, since we disable all libxml2-level warnings and errors in calling
`htmlReadMemory()'.

I put this url [1] to the issue assuming that it is the documentation,
and Nick doesn't have any comment regarding the url.  So this is
probably the up-to-date, albeit not very elaborate, documentation for
the function.

[1]: https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-HTMLparser.html#htmlReadMemory

-- 
Best,


RY

[Please note that this mail might go to spam due to some
misconfiguration in my mail server -- still investigating.]





  reply	other threads:[~2023-04-29  0:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27 16:19 bug#63125: 30.0.50; [BUG] last argument of libxml2-parse-html-region has no effect? Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-27 17:08 ` Eli Zaretskii
2023-04-28  1:30   ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-28 10:18     ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-28 10:40       ` bug#63125: 30.0.50; [BUG] last argument of libxml-parse-html-region " Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-28 11:31         ` Eli Zaretskii
2023-04-29  0:58           ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-04-29  6:40             ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=sdvmt2rlc36.fsf@netyu.xyz \
    --to=bug-gnu-emacs@gnu.org \
    --cc=63125@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=larsi@gnus.org \
    --cc=ruijie@netyu.xyz \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.