Function: allout-hide-current-subtree

allout-hide-current-subtree is an interactive and byte-compiled function defined in allout.el.gz.

Signature

(allout-hide-current-subtree &optional JUST-CLOSE)

Documentation

Close the current topic, or containing topic if this one is already closed.

If this topic is closed and it's a top level topic, close this topic and its siblings.

If optional arg JUST-CLOSE is non-nil, do not close the parent or siblings, even if the target topic is already closed.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/allout.el.gz
;;;_   > allout-hide-current-subtree (&optional just-close)
(defun allout-hide-current-subtree (&optional just-close)
  "Close the current topic, or containing topic if this one is already closed.

If this topic is closed and it's a top level topic, close this topic
and its siblings.

If optional arg JUST-CLOSE is non-nil, do not close the parent or
siblings, even if the target topic is already closed."

  (interactive)
  (let* ((from (point))
         (sibs-msg "Top-level topic already closed -- closing siblings...")
         (current-exposed (not (allout-current-topic-collapsed-p t))))
    (cond (current-exposed (allout-flag-current-subtree t))
          (just-close nil)
          ((allout-ascend) (allout-hide-current-subtree))
          (t (goto-char 0)
             (message sibs-msg)
             (allout-goto-prefix-doublechecked)
             (allout-expose-topic '(0 :))
             (message (concat sibs-msg "  Done."))))
    (goto-char from)))