changeset 59550:ab8776511cbc

(ebrowse-class-in-tree): Return the tail of the tree rather than the element found, thus enabling the tree to be setcar'd.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 15 Jan 2005 12:38:08 +0000
parents eda381049620
children c759f8859f72
files lisp/progmodes/ebrowse.el
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/ebrowse.el	Sat Jan 15 11:48:58 2005 +0000
+++ b/lisp/progmodes/ebrowse.el	Sat Jan 15 12:38:08 2005 +0000
@@ -780,16 +780,16 @@
 
 (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))
 
@@ -903,10 +903,10 @@
     (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)))