Function: majutsu-section-hide

majutsu-section-hide is an interactive and natively compiled function defined in majutsu-section.el.

Signature

(majutsu-section-hide SECTION)

Documentation

Hide the body of SECTION.

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-section.el
(defun majutsu-section-hide (section)
  "Hide the body of SECTION."
  (interactive (list (magit-current-section)))
  (if (eq section magit-root-section)
      (user-error "Cannot hide root section")
    (oset section hidden t)
    (when-let* ((bounds (majutsu-section--hidden-bounds section)))
      (pcase-let ((`(,beg . ,end) bounds))
        (when (< beg (point) end)
          (goto-char (oref section start)))
        ;; Clear Magit-style [content, end) overlays too; see
        ;; `majutsu-section-show'.
        (remove-overlays beg (oref section end) 'invisible t)
        (let ((overlay (make-overlay beg end)))
          (overlay-put overlay 'evaporate t)
          (overlay-put overlay 'invisible t)
          (overlay-put overlay 'cursor-intangible t))))
    (magit-section-maybe-update-visibility-indicator section)
    (magit-section-maybe-cache-visibility section)))