Function: org-demote

org-demote is a byte-compiled function defined in org.el.gz.

Signature

(org-demote)

Documentation

Demote the current heading lower down the tree.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defun org-demote ()
  "Demote the current heading lower down the tree."
  (org-with-wide-buffer
   (org-back-to-heading t)
   (let* ((after-change-functions (remq 'flyspell-after-change-function
					after-change-functions))
	  (level (save-match-data (funcall outline-level)))
	  (down-head (concat (make-string (org-get-valid-level level 1) ?*) " "))
	  (diff (abs (- level (length down-head) -1))))
     (org-fold-core-ignore-fragility-checks
       (replace-match (apply #'propertize down-head (text-properties-at (match-beginning 0))) t)
       (when org-auto-align-tags (org-align-tags))
       (when org-adapt-indentation (org-fixup-indentation diff)))
     (run-hooks 'org-after-demote-entry-hook))))