summaryrefslogtreecommitdiff
path: root/lisp/xml.el
Commit message (Collapse)AuthorAgeFilesLines
* Fix regexp branches that subsume other branchesPaul Eggert2019-04-191-1/+0
| | | | | | | | | | | | | | | Problems reported by Mattias Engdegård in: https://lists.gnu.org/r/emacs-devel/2019-04/msg00803.html * lisp/arc-mode.el (archive-rar-summarize): * lisp/eshell/em-hist.el (eshell-hist-word-designator): * lisp/info.el (Info-dir-remove-duplicates): * lisp/international/ja-dic-cnv.el (skkdic-convert-postfix) (skkdic-convert-prefix, skkdic-collect-okuri-nasi): * lisp/progmodes/cc-awk.el (c-awk-esc-pair-re): * lisp/xml.el (xml-att-type-re): Omit regexp branches that subsume other branches. * lisp/progmodes/cperl-mode.el (cperl-beautify-regexp-piece): $ and ^ aren’t simple-codes.
* Fix more regexp odditiesPaul Eggert2019-04-071-2/+2
| | | | | | | | | | | Problems reported by Mattias Engdegård in: https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00178.html * lisp/progmodes/sh-script.el (sh-get-indent-info): Reorder skip-chars-forward arg so that it does not look like a regexp. * lisp/progmodes/verilog-mode.el (verilog-sk-define-signal): Fix typo: the string is not a regexp. * lisp/vc/log-edit.el (log-edit-goto-eoh): Fix typo: stray ‘:’. * lisp/xml.el (xml-parse-dtd): Avoid ‘-’ right after char class.
* Minor xml.el tweaksPaul Eggert2019-03-271-2/+2
| | | | | | | | * lisp/xml.el (xml-name-start-char-re, xml-name-char-re): No need to call concat. (xml-name-char-re): Use \u escapes rather than chars inline, so that the code matches the comments better and is easier to audit.
* * lisp/xml.el (xml-name-char-re): Remove superfluous `-' in regexp.Mattias Engdegård2019-03-271-1/+1
|
* Merge from origin/emacs-26Paul Eggert2018-12-311-1/+1
|\ | | | | | | | | | | 2fcf2df Fix copyright years by hand 26bed8b Update copyright year to 2019 2814292 Fix value of default frame height. (Bug#33921)
| * Update copyright year to 2019Paul Eggert2019-01-011-1/+1
| | | | | | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* | Make DISCARD-COMMENTS in `libxml-parse-{html,xml}-region' obsoleteLars Ingebrigtsen2018-04-141-0/+13
|/ | | | | | | | | | | | * doc/lispref/text.texi (Parsing HTML/XML): Mention that discard-comments is obsolete. * lisp/xml.el (xml-remove-comments): New function (bug#27178). * src/xml.c (Flibxml_parse_html_region): Clarify what DISCARD-COMMENTS actually does, and say that the parameter is obsolete. (Flibxml_parse_xml_region): Ditto.
* Update copyright year to 2018Paul Eggert2018-01-011-1/+1
| | | | Run admin/update-copyright.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-131-1/+1
| | | | | | | | | | | | | Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
* xml: Properly handle symbol-qnames for attribute parsingDavid Engster2017-04-171-4/+3
| | | | | | | | | | * lisp/xml.el (xml-parse-attlist): Do not strip 'symbol-qnames from xml-ns argument (reverts aea67018) (Bug#26533). (xml-maybe-do-ns): Properly handle default namespace by not interning new symbol when 'special' flag is set. * tests/lisp/xml-tests.el (xml-parse-test--namespace-attribute-qnames) (xml-parse-namespace-attribute-qnames): Add test for Bug#26533.
* xml: Fix parsing of default namespace with quoted namesDavid Engster2017-01-241-2/+4
| | | | | | | * lisp/xml.el (xml-parse-attlist): Properly extract namespace when parsing is done with quoted symbol names (bug#23440). * test/lisp/xml-tests.el (xml-parse-test--default-namespace-qnames) (xml-parse-test-default-namespace-qnames): Test for the above.
* Merge from origin/emacs-25Paul Eggert2017-01-011-1/+1
|\ | | | | | | | | 2e2a806 Fix copyright years by hand 5badc81 Update copyright year to 2017
| * Update copyright year to 2017Paul Eggert2016-12-311-1/+1
| | | | | | | | Run admin/update-copyright.
* | Turn on more lexical-bindingMark Oteiza2016-09-281-3/+3
|/ | | | | | | | | | | | | | | | | | | | | * lisp/dom.el: * lisp/faces.el: * lisp/htmlfontify.el: Turn on lexical-binding. (htmlfontify-string): Use pushnew instead of add-to-list. * lisp/info-xref.el: * lisp/isearch.el: * lisp/man.el: * lisp/ps-def.el: * lisp/ps-print.el: * lisp/replace.el: Turn on lexical-binding. Require cl-lib at compile time. (multi-occur): Use cl-pushnew instead of add-to-list. (replace-match-string-symbols): Remove unused lexical variable. (replace-search, replace-highlight): Fix argument shadowing. * lisp/sort.el: * lisp/xml.el: Turn on lexical-binding. (xml--parse-buffer): Use push instead of add-to-list. * lisp/xt-mouse.el: Turn on lexical-binding.
* * lisp/xml.el (xml-parse-tag-1): Replace undefined function.Glenn Morris2016-03-161-1/+1
| | | | ; string-empty-p is defined in subr-x, but this file does not load it.
* Prevent infinite loop on not-well-formed xml. (Bug#16344)Ulf Jasper2016-03-021-1/+8
| | | | | | * lisp/xml.el (xml-parse-tag-1): Prevent inifinite loop. (Bug#16344) * test/automated/xml-parse-tests.el (xml-parse-tests--bad-data): Add test cases for Bug#16344.
* Update copyright year to 2016Paul Eggert2016-01-011-1/+1
| | | | Run admin/update-copyright.
* Fix docstring quoting problems with ‘ '’Paul Eggert2015-11-171-5/+5
| | | | | | | | | | | | | Problem reported by Artur Malabarba in: http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01513.html Most of these fixes are to documentation; many involve fixing longstanding quoting glitches that are independent of the recent substitute-command-keys changes. The changes to code are: * lisp/cedet/mode-local.el (mode-local-augment-function-help) (describe-mode-local-overload): Substitute docstrings before displaying them. * lisp/emacs-lisp/cl-macs.el (cl--transform-lambda): Quote the generated docstring for later substitution.
* Don't quote symbols 'like-this' in docstrings etc.Paul Eggert2015-08-201-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * admin/unidata/uvs.el (uvs-insert-fields-as-bytes): * lisp/allout-widgets.el (allout-widgets-count-buttons-in-region): * lisp/allout.el (allout-add-resumptions, allout-mode): * lisp/calculator.el (calculator-operators): * lisp/cedet/data-debug.el (dd-propertize): * lisp/cedet/ede/proj-prog.el (ede-proj-target-makefile-program): * lisp/cedet/semantic/analyze/debug.el: (semantic-analyzer-debug-global-miss-text): * lisp/cedet/semantic/lex-spp.el: (semantic-lex-spp-replace-or-symbol-or-keyword): * lisp/cedet/semantic/symref.el: (semantic-symref-cleanup-recent-buffers-fcn): * lisp/cedet/semantic/tag.el (semantic-tag-class): * lisp/cedet/srecode/el.el (srecode-semantic-handle-:el-custom): * lisp/gnus/nnmairix.el (nnmairix-propagate-marks-upon-close): * lisp/gnus/pop3.el (pop3-authentication-scheme): * lisp/help-fns.el (describe-function-orig-buffer): * lisp/imenu.el (imenu--history-list): * lisp/mail/feedmail.el (feedmail-confirm-outgoing) (feedmail-display-full-frame, feedmail-deduce-bcc-where) (feedmail-queue-default-file-slug) (feedmail-queue-buffer-file-name): * lisp/net/mairix.el (mairix-searches-mode-map): * lisp/net/newst-backend.el (newsticker-retrieval-method) (newsticker-auto-mark-filter-list): * lisp/obsolete/vi.el (vi-mode): * lisp/progmodes/cc-engine.el (c-literal-type): * lisp/progmodes/cpp.el (cpp-face): * lisp/progmodes/ebrowse.el (ebrowse-electric-list-looper): * lisp/progmodes/elisp-mode.el (elisp--xref-make-xref): * lisp/progmodes/pascal.el (pascal-auto-lineup): * lisp/progmodes/prog-mode.el (prog-widen): * lisp/progmodes/verilog-mode.el (verilog-regexp-words) (verilog-auto-lineup, verilog-auto-reset-widths) (verilog-auto-arg-format, verilog-auto-inst-template-numbers): * lisp/textmodes/flyspell.el (flyspell-maybe-correct-transposition) (flyspell-maybe-correct-doubling): * lisp/textmodes/table.el (table-justify, table-justify-cell) (table-justify-row, table-justify-column, table-insert-sequence) (table--justify-cell-contents): * lisp/url/url-auth.el (url-get-authentication): * lisp/window.el (display-buffer-record-window): * lisp/xml.el (xml-parse-file, xml-parse-region): * src/gfilenotify.c (Fgfile_add_watch): Don't quote symbols with apostrophes in doc strings. Use asymmetric quotes instead. * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): Likewise for symbol in diagnostic. * lisp/image.el (image-extension-data): * lisp/register.el (frame-configuration-to-register): * src/buffer.c (syms_of_buffer): Remove bogus apostrophes after symbols. * lisp/thumbs.el (thumbs-conversion-program): Quote Lisp string values using double-quotes, not apostrophes.
* Update copyright year to 2015Paul Eggert2015-01-011-1/+1
| | | | Run admin/update-copyright.
* Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-011-1/+1
|
* lisp/xml.el (xml-parse-tag-1): Use looking-at.Juanma Barranquero2013-08-121-1/+1
| | | | | (This reverts change in 2013-08-11T00:07:48Z!lekktu@gmail.com, which breaks the test suite). https://lists.gnu.org/archive/html/emacs-devel/2013-08/msg00263.html
* lisp/*.el: More lexical-binding warnings' cleanups.Juanma Barranquero2013-08-111-25/+23
| | | | | | | | | | | | | | | | | | | | | | * tutorial.el (tutorial--describe-nonstandard-key): Use string-match-p. (tutorial--detailed-help): Remove unused local variables. (tutorial--save-tutorial-to): Use ignore-errors. (help-with-tutorial): Use looking-at-p. * view.el (view-buffer-other-window, view-buffer-other-frame): Mark unused arguments. * woman.el (woman-parse-colon-path, woman-parse-colon-path) (woman-select-symbol-fonts, woman, woman-find-file) (woman-insert-file-contents, woman-non-underline-faces): Use string-match-p. (woman1-unquote): Move declaration. * xml.el (xml-parse-tag-1, xml-parse-string): Use looking-at-p. (xml-parse-dtd): Use looking-at-p, string-match-p. Mark unused argument. Remove unused local variable. (xml-parse-elem-type): Use string-match-p. (xml-substitute-numeric-entities): Use ignore-errors.
* * xml.el (xml-parse-string): Fix typo in handling of bad character references.Chong Yidong2013-02-131-2/+2
|
* * xml.el (xml-entity-or-char-ref-re): Fix regexp.Chong Yidong2013-01-231-1/+1
| | | | | | This bug was reported by Jae-oh Kim; it was posted to bug-gnu-emacs but didn't show up in the bug tracker for some reason. It is a regression against Emacs 24.2.
* Update copyright notices for 2013.Paul Eggert2013-01-011-1/+1
|
* * xml.el (xml-escape-string): Don't refer to xml-entity-alist.Chong Yidong2012-08-191-7/+19
| | | | Fixes: debbugs:12228
* Maybe return expanded XML qnames as plain symbols (Bug#11916).David Engster2012-07-281-13/+64
| | | | | | | | * xml.el (xml-node-name, xml-parse-file, xml-parse-region): Explanation of new 'symbol-qnames feature in doc-strings. (xml-maybe-do-ns): Return expanded names as plain symbols if 'symbol-qnames was provided in XML-NS argument (Bug#11916). (xml-parse-tag-1): Deal with new definition of PARSE-NS argument.
* Clean up syntax-table usage in xml.elChong Yidong2012-07-051-187/+190
| | | | | | | | | | | | | | | | | | | | * xml.el (xml--parse-buffer): Use xml-syntax-table. (xml-parse-tag): Likewise, and avoid changing entity tables. (xml-syntax-table): Define from scratch, making sure not to give x2000 and other Unicode spaces whitespace syntax, since those are not spaces in XML. (xml-parse-fragment): Delete unused function. (xml-name-start-char-re, xml-name-char-re, xml-name-re) (xml-names-re, xml-nmtoken-re, xml-nmtokens-re, xml-char-ref-re) (xml-entity-ref, xml-pe-reference-re) (xml-reference-re,xml-att-value-re, xml-tokenized-type-re) (xml-notation-type-re, xml-enumeration-re, xml-enumerated-type-re) (xml-att-type-re, xml-default-decl-re, xml-att-def-re) (xml-entity-value-re): Use syntax references in regexps where possible; no need to define inside a let-binding. (xml-parse-dtd): Use xml-pe-reference-re. (xml-entity-or-char-ref-re): New defconst. (xml-parse-string, xml-substitute-special): Use it.
* * lisp/xml.el (xml-name-regexp): Remove, redundant. Use xml-name-re.Stefan Monnier2012-07-031-5/+2
|
* * xml.el: Protect parser against XML bombs.Chong Yidong2012-07-031-6/+31
| | | | | | | | (xml-entity-expansion-limit): New variable. (xml-parse-string, xml-substitute-special): Use it. (xml-parse-dtd): Avoid infloop if the DTD is not terminated. * test/automated/xml-parse-tests.el: Update testcases.
* * lisp/xml.el: Handle entity and character reference expansion correctly.Chong Yidong2012-07-031-188/+184
| | | | | | | | | | | | | | | | | | | (xml-default-ns): New variable. (xml-entity-alist): Use XML spec definitions for lt and amp. (xml-parse-region): Make first two arguments optional. Discard text properties. (xml-parse-tag-1): New function, spun off from xml-parse-tag. All callers changed. (xml-parse-tag): Call xml-parse-tag-1. For backward compatibility, this function should not modify buffer contents. (xml-parse-tag-1): Fix opening-tag regexp. (xml-parse-string): Rewrite, handling entity and character references properly. (xml--entity-replacement-text): Signal an error if a parameter entity is undefined. * test/automated/xml-parse-tests.el (xml-parse-tests--data): More testcases.
* * xml.el (xml-parse-dtd): Use proper regexps for ELEMENT declarations.Chong Yidong2012-07-011-6/+9
| | | | | | * test/automated/xml-parse-tests.el: Update testcase. Fixes: debbugs:7172
* Improve xml parameter entity parsing, and add a new ERT test.Chong Yidong2012-07-011-73/+107
| | | | | | | | | | | | * test/automated/xml-parse-tests.el: New file. * lisp/xml.el (xml--parse-buffer): New function. Move most of xml-parse-region here. (xml-parse-region): Copy region into a temporary buffer, since parameter entity substitution requires changing buffer contents. Use xml--parse-buffer. (xml-parse-file): Use xml--parse-buffer. (xml-parse-dtd): Make parameter entity substitution work right.
* Fix use of eval-and-compile in regexps in xml.el.Chong Yidong2012-06-301-71/+83
| | | | | | * xml.el (xml-*-re): Convert defvars into defconsts, and eval-and-compile them so eval-and-compile works on derivatives. (xml--entity-replacement-text): Use eval-and-comple.
* xml.el: Fix last change.Chong Yidong2012-06-301-3/+2
|
* * xml.el: Implement XML parameter entities.Chong Yidong2012-06-301-108/+132
| | | | | | | | | | | | (xml-parameter-entity-alist): New variable. (xml-parse-region, xml-parse-fragment): Preserve previous values of xml-entity-alist and xml-parameter-entity-alist, so that repeated calls on different documents do not change them. (xml-parse-tag): Fix doctype regexp. (xml--entity-replacement-text): New function. (xml-parse-dtd): Use it. Don't handle system entities; doing that properly requires url retrieval which is unimplemented. (xml-escape-string): Doc fix.
* * xml.el (xml-parse-tag): Corrrectly handle comment embedded in non-tag text.Chong Yidong2012-06-241-1/+2
|
* Fix xml.el regression introduced by 2012-01-27 change.Chong Yidong2012-04-211-2/+4
| | | | | | | * lisp/xml.el (xml-parse-region, xml-parse-tag): Avoid errors due to reaching eob. Fixes: debbugs:11286
* * xml.el (xml-parse-tag): Fix parsing of comments.Alex Harsanyi2012-01-271-1/+2
| | | | Fixes: debbugs:10405
* Add 2012 to FSF copyright years for Emacs filesGlenn Morris2012-01-051-1/+1
|
* Fix typos.Juanma Barranquero2011-11-201-1/+1
|
* Spelling fixes.Paul Eggert2011-11-141-1/+1
|
* lisp/*.el: Lexical-binding cleanup.Juanma Barranquero2011-04-191-9/+8
|
* Convert consecutive FSF copyright years to ranges.Glenn Morris2011-01-241-2/+1
|
* Nuke arch-tags.Glenn Morris2011-01-151-1/+0
|
* Add 2011 to FSF/AIST copyright years.Glenn Morris2011-01-021-1/+1
|
* * xml.el (xml-parse-region): Avoid infloop (Bug#5281).Chong Yidong2010-06-301-12/+14
|
* Add 2010 to copyright years.Glenn Morris2010-01-131-1/+1
|
* Fixed Bug#5008.Ulf Jasper2009-12-061-0/+19
|