aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/speedbar.el28
1 files changed, 15 insertions, 13 deletions
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index e9c15b71ce6..5b98eb36bb9 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -3240,19 +3240,21 @@ With universal argument ARG, flush cached data."
3240 "Expand the line under the cursor and all descendants. 3240 "Expand the line under the cursor and all descendants.
3241Optional argument ARG indicates that any cache should be flushed." 3241Optional argument ARG indicates that any cache should be flushed."
3242 (interactive "P") 3242 (interactive "P")
3243 (speedbar-expand-line arg) 3243 (save-restriction
3244 ;; Now, inside the area expanded here, expand all subnodes of 3244 (narrow-to-region (line-beginning-position)
3245 ;; the same descendant type. 3245 (line-beginning-position 2))
3246 (save-excursion 3246 (speedbar-expand-line arg)
3247 (speedbar-next 1) ;; Move into the list. 3247 ;; Now, inside the area expanded here, expand all subnodes of
3248 (let ((err nil)) 3248 ;; the same descendant type.
3249 (while (not err) 3249 (save-excursion
3250 (condition-case nil 3250 (speedbar-next 1) ;; Move into the list.
3251 (progn 3251 (let ((err nil))
3252 (speedbar-expand-line-descendants arg) 3252 (while (not err)
3253 (speedbar-restricted-next 1)) 3253 (condition-case nil
3254 (error (setq err t)))))) 3254 (progn
3255 ) 3255 (speedbar-expand-line-descendants arg)
3256 (speedbar-restricted-next 1))
3257 (error (setq err t))))))))
3256 3258
3257(defun speedbar-contract-line-descendants () 3259(defun speedbar-contract-line-descendants ()
3258 "Expand the line under the cursor and all descendants." 3260 "Expand the line under the cursor and all descendants."