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).
This commit is contained in:
Lars Ingebrigtsen 2020-08-19 12:45:05 +02:00
parent b4e76ac077
commit ba8cce26c8

View file

@ -3240,19 +3240,21 @@ With universal argument ARG, flush cached data."
"Expand the line under the cursor and all descendants.
Optional argument ARG indicates that any cache should be flushed."
(interactive "P")
(speedbar-expand-line arg)
;; Now, inside the area expanded here, expand all subnodes of
;; the same descendant type.
(save-excursion
(speedbar-next 1) ;; Move into the list.
(let ((err nil))
(while (not err)
(condition-case nil
(progn
(speedbar-expand-line-descendants arg)
(speedbar-restricted-next 1))
(error (setq err t))))))
)
(save-restriction
(narrow-to-region (line-beginning-position)
(line-beginning-position 2))
(speedbar-expand-line arg)
;; Now, inside the area expanded here, expand all subnodes of
;; the same descendant type.
(save-excursion
(speedbar-next 1) ;; Move into the list.
(let ((err nil))
(while (not err)
(condition-case nil
(progn
(speedbar-expand-line-descendants arg)
(speedbar-restricted-next 1))
(error (setq err t))))))))
(defun speedbar-contract-line-descendants ()
"Expand the line under the cursor and all descendants."