+2005-01-15 Alan Mackenzie <acm@muc.de>
+
+ * ebrowse.el (ebrowse-class-in-tree): Return the tail of the tree
+ rather than the element found, thus enabling the tree to be
+ setcar'd.
+
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
* textmodes/org.el (org-show-following-heading): New option.
(defun ebrowse-class-in-tree (class tree)
"Search for a class with name CLASS in TREE.
-Return the class found, if any. This function is used during the load
-phase where classes appended to a file replace older class
-information."
+If CLASS is found, return the tail of TREE starting at CLASS. This function
+is used during the load phase where classes appended to a file replace older
+class information."
(let ((tclass (ebrowse-ts-class class))
found)
(while (and tree (not found))
- (let ((root (car tree)))
- (when (string= (ebrowse-qualified-class-name (ebrowse-ts-class root))
+ (let ((root-ptr tree))
+ (when (string= (ebrowse-qualified-class-name (ebrowse-ts-class (car root-ptr)))
(ebrowse-qualified-class-name tclass))
- (setq found root))
+ (setq found root-ptr))
(setq tree (cdr tree))))
found))
(let ((gc-cons-threshold 2000000))
(while (not (progn (skip-chars-forward " \t\n\r") (eobp)))
(let* ((root (read (current-buffer)))
- (old-root (ebrowse-class-in-tree root tree)))
+ (old-root-ptr (ebrowse-class-in-tree root tree)))
(ebrowse-show-progress "Reading data" (null tree))
- (if old-root
- (setf (car old-root) root)
+ (if old-root-ptr
+ (setcar old-root-ptr root)
(push root tree)))))
(garbage-collect)
(list header tree)))