File: org-list.el.html

This file contains the code dealing with plain lists in Org mode.

The core concept behind lists is their structure. A structure is a snapshot of the list, in the shape of a data tree (see org-list-struct).

Once the list structure is stored, it is possible to make changes on it that will be mirrored to the real list or to get information about the list, using accessors and methods provided in the library. Most of them require the use of one or two helper functions, namely org-list-parents-alist and org-list-prevs-alist.

Structure is eventually applied to the buffer with org-list-write-struct. This function repairs (bullets, indentation, checkboxes) the list in the process. It should be called near the end of any function working on structures.

Thus, a function applying to lists should usually follow this template:

1. Verify point is in a list and grab item beginning (with the same
   function org-in-item-p). If the function requires the cursor
   to be at item's bullet, org-at-item-p is more selective. It
   is also possible to move point to the closest item with
   org-list-search-backward, or org-list-search-forward,
   applied to the function org-item-beginning-re.

2. Get list structure with org-list-struct.

3. Compute one, or both, helper functions,
   (org-list-parents-alist, org-list-prevs-alist) depending on
   needed accessors.

4. Proceed with the modifications, using methods and accessors.

5. Verify and apply structure to buffer, using
   org-list-write-struct.

6. If changes made to the list might have modified check-boxes,
   call org-update-checkbox-count-maybe.

Computing a structure can be a costly operation on huge lists (a few thousand lines long). Thus, code should follow the rule:
"collect once, use many". As a corollary, it is usually a bad idea
to use directly an interactive function inside the code, as those, being independent entities, read the whole list structure another time.

Defined variables (16)

org--item-re-cacheResults cache for ‘org-item-re’.
org-checkbox-hierarchical-statisticsNon-nil means checkbox statistics counts only the state of direct children.
org-checkbox-statistics-hookHook that is run whenever Org thinks checkbox statistics should be updated.
org-cycle-include-plain-listsWhen t, make TAB cycle visibility on plain list items.
org-list-allow-alphabeticalNon-nil means single character alphabetical bullets are allowed.
org-list-automatic-rulesNon-nil means apply set of rules when acting on lists.
org-list-checkbox-radio-modeNon-nil if Org-List-Checkbox-Radio mode is enabled.
org-list-checkbox-radio-mode-hookHook run after entering or leaving ‘org-list-checkbox-radio-mode’.
org-list-demote-modify-bulletDefault bullet type installed when demoting an item.
org-list-end-reRegex matching the end of a plain list.
org-list-forbidden-blocksNames of blocks where lists are not allowed.
org-list-full-item-reMatches a list item and puts everything into groups:
org-list-indent-offsetAdditional indentation for sub-items in a list.
org-list-two-spaces-after-bullet-regexpA regular expression matching bullets that should have 2 spaces after them.
org-list-use-circular-motionNon-nil means commands implying motion in lists should be cyclic.
org-plain-list-ordered-item-terminatorThe character that makes a line with leading number an ordered list item.

Defined functions (107)

org-apply-on-list(FUNCTION INIT-VALUE &rest ARGS)
org-at-item-bullet-p()
org-at-item-checkbox-p()
org-at-item-counter-p()
org-at-item-description-p()
org-at-item-p()
org-at-item-timer-p()
org-at-radio-list-p()
org-beginning-of-item()
org-beginning-of-item-list()
org-cycle-item-indentation()
org-cycle-list-bullet(&optional WHICH)
org-end-of-item()
org-end-of-item-list()
org-get-checkbox-statistics-face()
org-in-item-p()
org-indent-item()
org-indent-item-tree()
org-insert-item(&optional CHECKBOX)
org-item-beginning-re()
org-item-re()
org-list--delete-metadata()
org-list--depth(ELEMENT)
org-list--generic-eval(VALUE &rest ARGS)
org-list--to-generic-item(PARAMS)
org-list--to-generic-plain-list(PARAMS)
org-list--trailing-newlines(STRING)
org-list-at-regexp-after-bullet-p(REGEXP)
org-list-bullet-string(BULLET)
org-list-checkbox-radio-mode(&optional ARG)
org-list-context()
org-list-delete-item(ITEM STRUCT)
org-list-get-all-items(ITEM STRUCT PREVS)
org-list-get-bottom-point(STRUCT)
org-list-get-bullet(ITEM STRUCT)
org-list-get-checkbox(ITEM STRUCT)
org-list-get-children(ITEM STRUCT PARENTS)
org-list-get-counter(ITEM STRUCT)
org-list-get-first-item(ITEM STRUCT PREVS)
org-list-get-ind(ITEM STRUCT)
org-list-get-item-begin()
org-list-get-item-end(ITEM STRUCT)
org-list-get-item-end-before-blank(ITEM STRUCT)
org-list-get-item-number(ITEM STRUCT PREVS PARENTS)
org-list-get-last-item(ITEM STRUCT PREVS)
org-list-get-list-begin(ITEM STRUCT PREVS)
org-list-get-list-end(ITEM STRUCT PREVS)
org-list-get-list-type(ITEM STRUCT PREVS)
org-list-get-next-item(ITEM STRUCT PREVS)
org-list-get-nth(N KEY STRUCT)
org-list-get-parent(ITEM STRUCT PARENTS)
org-list-get-prev-item(ITEM STRUCT PREVS)
org-list-get-subtree(ITEM STRUCT)
org-list-get-tag(ITEM STRUCT)
org-list-get-top-point(STRUCT)
org-list-has-child-p(ITEM STRUCT)
org-list-in-valid-context-p()
org-list-inc-bullet-maybe(BULLET)
org-list-indent-item-generic(ARG NO-SUBTREE STRUCT)
org-list-insert-item(POS STRUCT PREVS &optional CHECKBOX AFTER-BULLET)
org-list-item-body-column(ITEM)
org-list-make-subtree()
org-list-parents-alist(STRUCT)
org-list-prevs-alist(STRUCT)
org-list-repair()
org-list-search-backward(REGEXP &optional BOUND NOERROR)
org-list-search-forward(REGEXP &optional BOUND NOERROR)
org-list-search-generic(SEARCH RE BOUND NOERR)
org-list-send-item(ITEM DEST STRUCT)
org-list-separating-blank-lines-number(POS STRUCT PREVS)
org-list-set-bullet(ITEM STRUCT BULLET)
org-list-set-checkbox(ITEM STRUCT CHECKBOX)
org-list-set-ind(ITEM STRUCT IND)
org-list-set-item-visibility(ITEM STRUCT VIEW)
org-list-set-nth(N KEY STRUCT NEW)
org-list-struct()
org-list-struct-apply-struct(STRUCT OLD-STRUCT)
org-list-struct-assoc-end(STRUCT END-LIST)
org-list-struct-fix-box(STRUCT PARENTS PREVS &optional ORDERED)
org-list-struct-fix-bul(STRUCT PREVS)
org-list-struct-fix-ind(STRUCT PARENTS &optional BULLET-SIZE)
org-list-struct-fix-item-end(STRUCT)
org-list-struct-indent(START END STRUCT PARENTS PREVS)
org-list-struct-outdent(START END STRUCT PARENTS)
org-list-swap-items(BEG-A BEG-B STRUCT)
org-list-to-generic(LIST PARAMS)
org-list-to-html(LIST &optional PARAMS)
org-list-to-latex(LIST &optional PARAMS)
org-list-to-lisp(&optional DELETE)
org-list-to-org(LIST &optional PARAMS)
org-list-to-subtree(LIST &optional START-LEVEL PARAMS)
org-list-to-texinfo(LIST &optional PARAMS)
org-list-use-alpha-bul-p(FIRST STRUCT PREVS)
org-list-write-struct(STRUCT PARENTS &optional OLD-STRUCT)
org-move-item-down()
org-move-item-up()
org-next-item()
org-outdent-item()
org-outdent-item-tree()
org-previous-item()
org-reset-checkbox-state-subtree()
org-sort-list(&optional WITH-CASE SORTING-TYPE GETKEY-FUNC COMPARE-FUNC INTERACTIVE?)
org-toggle-checkbox(&optional TOGGLE-PRESENCE)
org-toggle-item(ARG)
org-toggle-radio-button(&optional ARG)
org-update-checkbox-count(&optional ALL)
org-update-checkbox-count-maybe(&optional ALL)

Defined faces (0)