]> git.eshelyaron.com Git - emacs.git/commit
Rewrite Speedbar expansion for all descendants (bug#73533)
authorMorgan Willcock <morgan@ice9.digital>
Sat, 5 Oct 2024 17:33:51 +0000 (18:33 +0100)
committerEshel Yaron <me@eshelyaron.com>
Tue, 22 Oct 2024 18:55:17 +0000 (20:55 +0200)
commit8d740bbf0f8adf97e070ea461118c15287de4133
treef39fec0e8a65076b7337ccfbe53aa052637ca9c1
parente8c3329f2b25b8815a29d148c3b46d3cd9b70dec
Rewrite Speedbar expansion for all descendants (bug#73533)

Rewrite 'speedbar-expand-line-descendants' to avoid getting into
an infinite loop by reaching max-lisp-eval-depth.  The new
method avoids querying and displaying information for every
movement, instead using a single message to indicate that
expansion is in progress, and so is significantly faster.  The
narrowing per item introduced by the fix for bug#35014 is
removed because it prevented expanded descendant items when the
top-level item was already expanded.
* lisp/speedbar.el (speedbar--get-line-indent-level): New
function to return the indentation level of the current line.
(speedbar-expand-line-descendants): Use simpler line motion and
no recursion.  Output messages indicating when expansion is in
progress and when it is completed.  Fix expansion of descendants
where the top-level item was already expanded.

(cherry picked from commit bcc4e64fa7aab9f44e3a7bcdf651a32ec52866c2)
lisp/speedbar.el