Function: majutsu-section-show-level

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

Signature

(majutsu-section-show-level LEVEL)

Documentation

Show surrounding sections up to LEVEL.

Likewise hide sections at higher levels. If LEVEL is negative, show all sections up to the absolute value of that, not just surrounding sections.

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-show-level (level)
  "Show surrounding sections up to LEVEL.
Likewise hide sections at higher levels.  If LEVEL is negative, show all
sections up to the absolute value of that, not just surrounding sections."
  (interactive "p")
  (if (< level 0)
      (let ((section (magit-current-section)))
        (setq level (- level))
        (while (> (1- (length (magit-section-ident section))) level)
          (setq section (oref section parent))
          (goto-char (oref section start)))
        (majutsu-section-show-children magit-root-section (1- level)))
    (dolist (section (or (magit-region-sections)
                         (list (magit-current-section))))
      (cl-do* ((current section
                        (oref current parent))
               (index (1- (length (magit-section-ident current)))
                      (cl-decf index)))
          ((cond ((< index level)
                  (majutsu-section-show-children current (- level index 1))
                  t)
                 ((= index level)
                  (majutsu-section-hide current)
                  t))
           (magit-section-goto current))))))