diff options
| author | Eli Zaretskii | 2005-01-15 12:39:25 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2005-01-15 12:39:25 +0000 |
| commit | 8b3a75ac8f9fb619b3136a811b34e9d36ec4e2b8 (patch) | |
| tree | d338f1e54c3125312b9cd65e9880096e96784cb1 | |
| parent | 3c86abc0b617b1984a47e4245f56ee078679ae5c (diff) | |
| download | emacs-8b3a75ac8f9fb619b3136a811b34e9d36ec4e2b8.tar.gz emacs-8b3a75ac8f9fb619b3136a811b34e9d36ec4e2b8.zip | |
(ebrowse-class-in-tree): Return the tail of the tree
rather than the element found, thus enabling the tree to be
setcar'd.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/progmodes/ebrowse.el | 18 |
2 files changed, 15 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5bc8aada7de..567b5c5c9d5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2005-01-15 Alan Mackenzie <acm@muc.de> | ||
| 2 | |||
| 3 | * ebrowse.el (ebrowse-class-in-tree): Return the tail of the tree | ||
| 4 | rather than the element found, thus enabling the tree to be | ||
| 5 | setcar'd. | ||
| 6 | |||
| 1 | 2005-01-14 Carsten Dominik <dominik@science.uva.nl> | 7 | 2005-01-14 Carsten Dominik <dominik@science.uva.nl> |
| 2 | 8 | ||
| 3 | * textmodes/org.el (org-show-following-heading): New option. | 9 | * textmodes/org.el (org-show-following-heading): New option. |
diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el index 478ce403b31..bf11ea28514 100644 --- a/lisp/progmodes/ebrowse.el +++ b/lisp/progmodes/ebrowse.el | |||
| @@ -780,16 +780,16 @@ The class tree is found in the buffer-local variable `ebrowse--tree-obarray'." | |||
| 780 | 780 | ||
| 781 | (defun ebrowse-class-in-tree (class tree) | 781 | (defun ebrowse-class-in-tree (class tree) |
| 782 | "Search for a class with name CLASS in TREE. | 782 | "Search for a class with name CLASS in TREE. |
| 783 | Return the class found, if any. This function is used during the load | 783 | If CLASS is found, return the tail of TREE starting at CLASS. This function |
| 784 | phase where classes appended to a file replace older class | 784 | is used during the load phase where classes appended to a file replace older |
| 785 | information." | 785 | class information." |
| 786 | (let ((tclass (ebrowse-ts-class class)) | 786 | (let ((tclass (ebrowse-ts-class class)) |
| 787 | found) | 787 | found) |
| 788 | (while (and tree (not found)) | 788 | (while (and tree (not found)) |
| 789 | (let ((root (car tree))) | 789 | (let ((root-ptr tree)) |
| 790 | (when (string= (ebrowse-qualified-class-name (ebrowse-ts-class root)) | 790 | (when (string= (ebrowse-qualified-class-name (ebrowse-ts-class (car root-ptr))) |
| 791 | (ebrowse-qualified-class-name tclass)) | 791 | (ebrowse-qualified-class-name tclass)) |
| 792 | (setq found root)) | 792 | (setq found root-ptr)) |
| 793 | (setq tree (cdr tree)))) | 793 | (setq tree (cdr tree)))) |
| 794 | found)) | 794 | found)) |
| 795 | 795 | ||
| @@ -903,10 +903,10 @@ and TREE is a list of `ebrowse-ts' structures forming the class tree." | |||
| 903 | (let ((gc-cons-threshold 2000000)) | 903 | (let ((gc-cons-threshold 2000000)) |
| 904 | (while (not (progn (skip-chars-forward " \t\n\r") (eobp))) | 904 | (while (not (progn (skip-chars-forward " \t\n\r") (eobp))) |
| 905 | (let* ((root (read (current-buffer))) | 905 | (let* ((root (read (current-buffer))) |
| 906 | (old-root (ebrowse-class-in-tree root tree))) | 906 | (old-root-ptr (ebrowse-class-in-tree root tree))) |
| 907 | (ebrowse-show-progress "Reading data" (null tree)) | 907 | (ebrowse-show-progress "Reading data" (null tree)) |
| 908 | (if old-root | 908 | (if old-root-ptr |
| 909 | (setf (car old-root) root) | 909 | (setcar old-root-ptr root) |
| 910 | (push root tree))))) | 910 | (push root tree))))) |
| 911 | (garbage-collect) | 911 | (garbage-collect) |
| 912 | (list header tree))) | 912 | (list header tree))) |