aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2020-08-19 12:45:05 +0200
committerLars Ingebrigtsen2020-08-19 12:45:05 +0200
commitba8cce26c83c195972a6952dd9546f7153bf93d3 (patch)
treef459d086f8cdaab7a96fb2ddc4c768aa5e2b6c51
parentb4e76ac077fabbdaad56223ff885ba4264c32534 (diff)
downloademacs-ba8cce26c83c195972a6952dd9546f7153bf93d3.tar.gz
emacs-ba8cce26c83c195972a6952dd9546f7153bf93d3.zip
Fix the [ command in speedbar mode
* lisp/speedbar.el (speedbar-expand-line-descendants): Expand only the current line -- not all subsequent lines in the speedbar buffer (bug#35014).
-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."