* bug#63291: libxml-parse-{html, xml}-region help page incorrect argument lower bound
@ 2023-05-05 6:38 Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-05 7:13 ` Eli Zaretskii
0 siblings, 1 reply; 2+ messages in thread
From: Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-05-05 6:38 UTC (permalink / raw)
To: 63291
First of all, this is newest Emacs 30 in-source build (pulled and built
a few hours ago).
I'm reading the help page of `libxml-parse-xml-region' and noticed this:
--8<---------------cut here---------------start------------->8---
libxml-parse-xml-region is a built-in function in ‘src/xml.c’.
(libxml-parse-xml-region START END &optional BASE-URL)
Parse the region as an XML document and return the parse tree.
If START is nil, it defaults to ‘point-min’. If END is nil, it
defaults to ‘point-max’.
...
--8<---------------cut here---------------end--------------->8---
Notice the function signature: it implies that the first two arguments
are mandatory, even though the docstring proceeds to talk about what
happens when these two arguments are nil. Similarly for
`libxml-parse-html-region'.
However, both the C source code and experiments show that these two
functions do accept 0 arguments.
```emacs-lisp
(with-temp-buffer (insert "<html></html>")
(libxml-parse-html-region))
;=> (html nil)
```
I have zero knowledge of dealing with C defuns, so I'll leave fixing
this issue to someone more experienced at that.
--
Best,
RY
[Please note that this mail might go to spam due to some
misconfiguration in my mail server -- still investigating.]
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#63291: libxml-parse-{html, xml}-region help page incorrect argument lower bound
2023-05-05 6:38 bug#63291: libxml-parse-{html, xml}-region help page incorrect argument lower bound Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-05-05 7:13 ` Eli Zaretskii
0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2023-05-05 7:13 UTC (permalink / raw)
To: Ruijie Yu; +Cc: 63291-done
> Date: Fri, 05 May 2023 14:38:02 +0800
> From: Ruijie Yu via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>
> I'm reading the help page of `libxml-parse-xml-region' and noticed this:
>
> --8<---------------cut here---------------start------------->8---
> libxml-parse-xml-region is a built-in function in ‘src/xml.c’.
>
> (libxml-parse-xml-region START END &optional BASE-URL)
>
> Parse the region as an XML document and return the parse tree.
> If START is nil, it defaults to ‘point-min’. If END is nil, it
> defaults to ‘point-max’.
>
> ...
> --8<---------------cut here---------------end--------------->8---
>
> Notice the function signature: it implies that the first two arguments
> are mandatory, even though the docstring proceeds to talk about what
> happens when these two arguments are nil. Similarly for
> `libxml-parse-html-region'.
>
> However, both the C source code and experiments show that these two
> functions do accept 0 arguments.
This is because a recent change made the first 2 arguments optional,
but advertised-calling-convention of these functions in subr.el was
not adjusted to that change, and was overriding the effect of the
DEFUN macros, which say the truth: up to 4 arguments, with zero
mandatory ones.
Fixed on the emacs-29 branch.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-05 7:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-05 6:38 bug#63291: libxml-parse-{html, xml}-region help page incorrect argument lower bound Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-05 7:13 ` Eli Zaretskii
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.