Function: org-mark-subtree

org-mark-subtree is an interactive and byte-compiled function defined in org.el.gz.

Signature

(org-mark-subtree &optional UP)

Documentation

Mark the current subtree.

This puts point at the start of the current subtree, and mark at the end. If a numeric prefix UP is given, move up into the hierarchy of headlines by UP levels before marking the subtree.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defun org-mark-subtree (&optional up)
  "Mark the current subtree.
This puts point at the start of the current subtree, and mark at
the end.  If a numeric prefix UP is given, move up into the
hierarchy of headlines by UP levels before marking the subtree."
  (interactive "P")
  (org-with-limited-levels
   (cond ((org-at-heading-p) (beginning-of-line))
	 ((org-before-first-heading-p) (user-error "Not in a subtree"))
	 (t (outline-previous-visible-heading 1))))
  (when up (while (and (> up 0) (org-up-heading-safe)) (cl-decf up)))
  (if (called-interactively-p 'any)
      (call-interactively 'org-mark-element)
    (org-mark-element)))