aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Ingebrigtsen2022-08-22 12:48:37 +0200
committerLars Ingebrigtsen2022-08-22 12:48:37 +0200
commitcc33c6cf3a4868ab8cd3cc52679985026a42d176 (patch)
tree543b010ab183f10f6698f83667310002c2b5b201 /src
parentb04ec9a7d3a7c823427609abc67cd811424f9e06 (diff)
downloademacs-cc33c6cf3a4868ab8cd3cc52679985026a42d176.tar.gz
emacs-cc33c6cf3a4868ab8cd3cc52679985026a42d176.zip
Make start/end in libxml-parse-html-region optional
* doc/lispref/text.texi (Parsing HTML/XML): Adjust. * src/xml.c (parse_region): Default start/end to point-min/point-max. (Flibxml_parse_html_region, Flibxml_parse_xml_region): Make start/end optional.
Diffstat (limited to 'src')
-rw-r--r--src/xml.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/xml.c b/src/xml.c
index 522efd224c6..2cccff12331 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -186,6 +186,12 @@ parse_region (Lisp_Object start, Lisp_Object end, Lisp_Object base_url,
186 186
187 xmlCheckVersion (LIBXML_VERSION); 187 xmlCheckVersion (LIBXML_VERSION);
188 188
189 if (NILP (start))
190 start = Fpoint_min ();
191
192 if (NILP (end))
193 end = Fpoint_max ();
194
189 validate_region (&start, &end); 195 validate_region (&start, &end);
190 196
191 istart = XFIXNUM (start); 197 istart = XFIXNUM (start);
@@ -269,8 +275,11 @@ xml_cleanup_parser (void)
269 275
270DEFUN ("libxml-parse-html-region", Flibxml_parse_html_region, 276DEFUN ("libxml-parse-html-region", Flibxml_parse_html_region,
271 Slibxml_parse_html_region, 277 Slibxml_parse_html_region,
272 2, 4, 0, 278 0, 4, 0,
273 doc: /* Parse the region as an HTML document and return the parse tree. 279 doc: /* Parse the region as an HTML document and return the parse tree.
280If START is nil, it defaults to `point-min'. If END is nil, it
281defaults to `point-max'.
282
274If BASE-URL is non-nil, it is used to expand relative URLs. 283If BASE-URL is non-nil, it is used to expand relative URLs.
275 284
276If you want comments to be stripped, use the `xml-remove-comments' 285If you want comments to be stripped, use the `xml-remove-comments'
@@ -284,8 +293,11 @@ function to strip comments before calling this function. */)
284 293
285DEFUN ("libxml-parse-xml-region", Flibxml_parse_xml_region, 294DEFUN ("libxml-parse-xml-region", Flibxml_parse_xml_region,
286 Slibxml_parse_xml_region, 295 Slibxml_parse_xml_region,
287 2, 4, 0, 296 0, 4, 0,
288 doc: /* Parse the region as an XML document and return the parse tree. 297 doc: /* Parse the region as an XML document and return the parse tree.
298If START is nil, it defaults to `point-min'. If END is nil, it
299defaults to `point-max'.
300
289If BASE-URL is non-nil, it is used to expand relative URLs. 301If BASE-URL is non-nil, it is used to expand relative URLs.
290 302
291If you want comments to be stripped, use the `xml-remove-comments' 303If you want comments to be stripped, use the `xml-remove-comments'