emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master ba8cce2 5/5: Fix the [ command in speedbar mode


From: Lars Ingebrigtsen
Subject: master ba8cce2 5/5: Fix the [ command in speedbar mode
Date: Wed, 19 Aug 2020 06:45:16 -0400 (EDT)

branch: master
commit ba8cce26c83c195972a6952dd9546f7153bf93d3
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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).
---
 lisp/speedbar.el | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index e9c15b7..5b98eb36 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]