Function: org-inlinetask-demote

org-inlinetask-demote is an interactive and byte-compiled function defined in org-inlinetask.el.gz.

Signature

(org-inlinetask-demote)

Documentation

Demote the inline task at point.

If the task has an end part, also demote it.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-inlinetask.el.gz
(defun org-inlinetask-demote ()
  "Demote the inline task at point.
If the task has an end part, also demote it."
  (interactive)
  (if (not (org-inlinetask-in-task-p))
      (user-error "Not in an inline task")
    (save-excursion
      (let* ((lvl (org-inlinetask-get-task-level))
	     (next-lvl (org-get-valid-level lvl 1))
	     (diff (- next-lvl lvl))
	     (down-task (concat (make-string next-lvl ?*)))
	     beg)
	(org-inlinetask-goto-beginning)
	(setq beg (point))
	(replace-match down-task nil t nil 1)
	(org-inlinetask-goto-end)
        (if (and (eobp) (looking-back "END\\s-*" (line-beginning-position)))
            (forward-line 0)
          (forward-line -1))
	(unless (= (point) beg)
          (looking-at (org-inlinetask-outline-regexp))
	  (replace-match down-task nil t nil 1)
	  (when (eq org-adapt-indentation t)
	    (goto-char beg)
	    (org-fixup-indentation diff)))))))