branch: externals/idlwave commit 677dd1d6e3b7ed1c2ebbfaff3bc41bd71a15176c Author: JD Smith <jdtsm...@gmail.com> Commit: JD Smith <jdtsm...@gmail.com>
Deal with XML-parse's poor handling of underscores Can't handle X_Y in ATTLIST/ELEMENT. --- idlwave.el | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/idlwave.el b/idlwave.el index 63545a4cff..0cf570df99 100644 --- a/idlwave.el +++ b/idlwave.el @@ -4954,7 +4954,21 @@ Cache to disk for quick recovery." (if (not (file-readable-p catalog-file)) (error "Cannot read XML routine info file: %s" catalog-file))) (message "Reading XML routine info...") - (setq rinfo (xml-parse-file catalog-file)) + (require 'xml) + (setq rinfo + (let ((xml-validating-parser t)) + (condition-case nil + (xml-parse-file catalog-file) + (error ;; Deal with XML.el bug: underscores in ATTLIST/ELEMENT names hang + (setq xml-validating-parser nil) + (with-temp-buffer + (insert-file-contents catalog-file) + (while + (re-search-forward + "^\\s-*<!\\(ATTLIST\\|ELEMENT\\) * [A-Z]+_[A-Z]+.*>\\s-*[\r\n]" + nil t) + (replace-match "")) + (xml-parse-region (point-min) (point-max))))))) (message "Reading XML routine info...done") (setq rinfo (assq 'CATALOG rinfo)) (unless rinfo (error "Failed to parse XML routine info"))