Function: org-move-item-up
org-move-item-up is an interactive and byte-compiled function defined
in org-list.el.gz.
Signature
(org-move-item-up)
Documentation
Move the item at point up, i.e. swap with previous item.
Sub-items (items with larger indentation) are considered part of the item, so this really moves item trees.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/org/org-list.el.gz
(defun org-move-item-up ()
"Move the item at point up, i.e. swap with previous item.
Sub-items (items with larger indentation) are considered part of
the item, so this really moves item trees."
(interactive)
(unless (org-at-item-p) (error "Not at an item"))
(let* ((col (current-column))
(item (point-at-bol))
(struct (org-list-struct))
(prevs (org-list-prevs-alist struct))
(prev-item (org-list-get-prev-item (point-at-bol) struct prevs)))
(unless (or prev-item org-list-use-circular-motion)
(user-error "Cannot move this item further up"))
(if (not prev-item)
(setq struct (org-list-send-item item 'end struct))
(setq struct (org-list-swap-items prev-item item struct)))
(org-list-write-struct struct (org-list-parents-alist struct))
(org-move-to-column col)))