branch: elpa/git-commit
commit f1da9c19bc5f6d0139c36493a53ac52dfad19266
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    magit-section--maybe-wash: Also bind magit-insert-section--current
    
    `magit-insert-section' binds both `magit-insert-section--current'
    and `magit-insert-section--parent' to the same section, which, while
    surprising, is actually correct.  The former is used by this macro
    itself and by closely related functions that deal with the "current"
    section being inserted.  The latter is for functions that wash output
    inserted inside the body of `magit-section-insert', and split that up
    into subsections.
    
    Also binding `magit-insert-section--current' means that the lambda that
    `magit-insert-section-body' creates and which may run delayed and thus
    outside the `magit-insert-section' from, can assume a more consisten
    environment.
    
    Previously we assumed that the BODY of all `magit-insert-section-body'
    are responsible for inserting subsections, for which we only need the
    "parent".  When that is not the case (when the washing is delayed but
    does not involve splitting into subsections) then the delayed code
    instead needs to know about the "current" section.
---
 lisp/magit-section.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/magit-section.el b/lisp/magit-section.el
index d42bbba403..b70d38908a 100644
--- a/lisp/magit-section.el
+++ b/lisp/magit-section.el
@@ -921,6 +921,7 @@ With a prefix argument also expand it." heading)
     (oset section washer nil)
     (let ((inhibit-read-only t)
           (magit-insert-section--parent section)
+          (magit-insert-section--current section)
           (content (oref section content)))
       (save-excursion
         (if (and content (< content (oref section end)))

Reply via email to