branch: elpa/magit
commit 32d7beb5f9a58c32c66caf4d45bcc258c93b481c
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
magit-section-reveal: New function
---
lisp/magit-diff.el | 5 +----
lisp/magit-section.el | 6 ++++++
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index 469a09c2314..f8e743158a5 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -1459,10 +1459,7 @@ for a revision."
(t
(goto-char (oref section start))
(setq section (oref section parent))))
- (while section
- (when (oref section hidden)
- (magit-section-show section))
- (setq section (oref section parent))))
+ (magit-section-reveal section))
t))
;;;; Setting Commands
diff --git a/lisp/magit-section.el b/lisp/magit-section.el
index 003cacd114d..a2225e9e4ac 100644
--- a/lisp/magit-section.el
+++ b/lisp/magit-section.el
@@ -2102,6 +2102,12 @@ When `magit-section-preserve-visibility' is nil, return
nil."
(setq magit-section--opened-sections nil))
(funcall fn)))
+(defun magit-section-reveal (section)
+ (while section
+ (when (oref section hidden)
+ (magit-section-show section))
+ (setq section (oref section parent))))
+
;;; Utilities
(cl-defun magit-section-selected-p (section &optional (selection nil
sselection))