Function: magit-insert-section-body

magit-insert-section-body is a macro defined in magit-section.el.

Signature

(magit-insert-section-body &rest BODY)

Documentation

Use BODY to insert the section body, once the section is expanded.

If the section is expanded when it is created, then this is like progn. Otherwise BODY isn't evaluated until the section is explicitly expanded.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-section-20260330.1102/magit-section.el
(defmacro magit-insert-section-body (&rest body)
  "Use BODY to insert the section body, once the section is expanded.
If the section is expanded when it is created, then this is
like `progn'.  Otherwise BODY isn't evaluated until the section
is explicitly expanded."
  (declare (indent 0))
  (let ((f (gensym))
        (s (gensym))
        (l (gensym)))
    `(let ((,f (lambda () ,@body)))
       (if (oref magit-insert-section--current hidden)
           (oset magit-insert-section--current washer
                 (let ((,s magit-insert-section--current))
                   (lambda ()
                     (let ((,l (magit-section-lineage ,s t)))
                       (dolist (s ,l)
                         (set-marker-insertion-type (oref s end) t))
                       (funcall ,f)
                       (dolist (s ,l)
                         (set-marker-insertion-type (oref s end) nil))
                       (magit-section--set-section-properties ,s)
                       (magit-section-maybe-remove-heading-map ,s)
                       (magit-section-maybe-remove-visibility-indicator ,s)))))
         (funcall ,f)))))