Source

psgml / psgml-info.el

Diff from to

psgml-info.el

 
 (defconst sgml-attr-col 18)
 
+(eval-when-compile (require 'cl))
 
 ;;;; Utility functions
 
 		    (sgml-pstate-dtd sgml-buffer-parse-state)
 		    t))
 
+
+(defun sgml-set-difference (l1 l2)
+  (if (or (null l1) (null l2))
+      l1
+    (let ((res nil))
+      (while l1
+	(or (member (car l1)
+		   l2)
+	    (push (car l1) res))
+	(pop l1))
+      res)))
+
+(defun sgml-union (l1 l2)
+  (cond ((null l1) l2) ((null l2) l1)
+	((equal l1 l2) l1)
+	(t
+	 (or (>= (length l1) (length l2))
+	     (setq l1 (prog1 l2 (setq l2 l1))))
+	 (while l2
+	   (or (member (car l2) l1)
+	       (push (car l2) l1))
+	   (pop l2))
+	 l1)))
+
 (defun sgml-eltype-refrenced-elements (eltype)
   "List of element types referenced in the model of ELTYPE."
   ;; Now with cache. Uses appdata prop re-cache.
 	   (loop for dfa in (sgml-and-node-dfas (car agenda)) do
 		 (sgml-add-last-unique dfa states))))
 	 (setq agenda (cdr agenda)))
-       (setq res (sort (copy-seq (set-difference
-                                  (union res (sgml-eltype-includes eltype))
-                                  (sgml-eltype-excludes eltype)))
-		       (function string-lessp)))
+       (setq res
+             (sort (copy-sequence (sgml-set-difference
+                                   (sgml-union res (sgml-eltype-includes eltype))
+                                   (sgml-eltype-excludes eltype)))
+                   (function string-lessp)))
        (setf (sgml-eltype-appdata eltype 're-cache) res)
        res)))))
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.