emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/idlwave 677dd1d6e3 278/360: Deal with XML-parse's poor


From: ELPA Syncer
Subject: [elpa] externals/idlwave 677dd1d6e3 278/360: Deal with XML-parse's poor handling of underscores
Date: Sun, 28 Apr 2024 00:59:33 -0400 (EDT)

branch: externals/idlwave
commit 677dd1d6e3b7ed1c2ebbfaff3bc41bd71a15176c
Author: JD Smith <jdtsmith@gmail.com>
Commit: JD Smith <jdtsmith@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"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]