UP | HOME

Org API

Table of Contents

Org-List API functions (org-list.el)

org-list-at-regexp-after-bullet-p regexp

Is point at a list item with regexp after bullet?

org-list-bullet-string bullet

Return bullet with the correct number of whitespaces. It determines the number of whitespaces to append by looking at org-list-two-spaces-after-bullet-regexp.

org-list-context

Determine context, and its boundaries, around point.

Context will be a cell like (MIN MAX CONTEXT) where MIN and MAX are boundaries and CONTEXT is a symbol among drawer, block, invalid, inlinetask and nil.

Contexts block and invalid refer to org-list-forbidden-blocks.

org-list-delete-item item struct

Remove item from the list and return the new structure.

struct is the list structure.

org-list-get-all-items item struct prevs

List all items in the same sub-list as item. struct is the list structure. prevs is the alist of previous items, as returned by org-list-prevs-alist.

org-list-get-bottom-point struct

Return point at bottom of list. struct is the list structure.

org-list-get-bullet item struct

Return bullet of item in struct.

org-list-get-checkbox item struct

Return checkbox of item in struct or nil.

org-list-get-children item struct parents

List all children of item, or nil. struct is the list structure. parents is the alist of parents, as returned by org-list-parents-alist.

org-list-get-counter item struct

Return counter of item in struct.

org-list-get-first-item item struct prevs

Return point at beginning of sub-list item belongs. struct is the list structure. prevs is the alist of previous items, as returned by org-list-prevs-alist.

org-list-get-ind item struct

Return indentation of item in struct.

org-list-get-item-begin

Return item beginning position when in a plain list, nil otherwise.

org-list-get-item-end item struct

Return end position of item in struct.

org-list-get-item-end-before-blank item struct

Return point at end of item in struct, before any blank line. Point returned is at end of line.

org-list-get-item-number item struct prevs parents

Return item's sequence number.

struct is the list structure. prevs is the alist of previous items, as returned by org-list-prevs-alist. parents is the alist of ancestors, as returned by org-list-parents-alist.

Return value is a list of integers. Counters have an impact on that value.

org-list-get-last-item item struct prevs

Return point at last item of sub-list item belongs. struct is the list structure. prevs is the alist of previous items, as returned by org-list-prevs-alist.

org-list-get-list-begin item struct prevs

Return point at beginning of sub-list item belongs. struct is the list structure. prevs is the alist of previous items, as returned by org-list-prevs-alist.

org-list-get-list-end item struct prevs

Return point at end of sub-list item belongs. struct is the list structure. prevs is the alist of previous items, as returned by org-list-prevs-alist.

org-list-get-list-type item struct prevs

Return the type of the list containing item, as a symbol.

struct is the list structure. prevs is the alist of previous items, as returned by org-list-prevs-alist.

Possible types are descriptive, ordered and unordered. The type is determined by the first item of the list.

org-list-get-next-item item struct prevs

Return next item in same sub-list as item, or nil. struct is the list structure. prevs is the alist of previous items, as returned by org-list-prevs-alist.

org-list-get-nth n key struct

Return the n=th value of =key in struct.

org-list-get-parent item struct parents

Return parent of item or nil. struct is the list structure. parents is the alist of parents, as returned by org-list-parents-alist.

org-list-get-prev-item item struct prevs

Return previous item in same sub-list as item, or nil. struct is the list structure. prevs is the alist of previous items, as returned by org-list-prevs-alist.

org-list-get-subtree item struct

List all items having item as a common ancestor, or nil. struct is the list structure.

org-list-get-tag item struct

Return end position of item in struct.

org-list-get-top-point struct

Return point at beginning of list. struct is the list structure.

org-list-has-child-p item struct

Non-nil if item has a child.

struct is the list structure.

Value returned is the position of the first child of item.

org-list-in-valid-context-p

Is point in a context where lists are allowed?

org-list-inc-bullet-maybe bullet

Increment bullet if applicable.

org-list-indent-item-generic arg no-subtree struct

Indent a local list item including its children. When number arg is a negative, item will be outdented, otherwise it will be indented.

If a region is active, all items inside will be moved.

If no-subtree is non-nil, only indent the item itself, not its children.

struct is the list structure.

Return t if successful.

org-list-insert-item pos struct prevs &optional checkbox after-bullet

Insert a new list item at pos and return the new structure. If pos is before first character after bullet of the item, the new item will be created before the current one.

struct is the list structure. prevs is the the alist of previous items, as returned by org-list-prevs-alist.

Insert a checkbox if checkbox is non-nil, and string after-bullet after the bullet. Cursor will be after this text once the function ends.

This function modifies struct.

org-list-insert-radio-list

Insert a radio list template appropriate for this major mode.

org-list-item-body-column item

Return column at which body of item should start.

org-list-item-trim-br item

Trim line breaks in a list item.

org-list-make-subtree

Convert the plain list at point into a subtree.

org-list-parents-alist struct

Return alist between item and parent in struct.

org-list-parse-list &optional delete

Parse the list at point and maybe delete it.

Return a list whose car is a symbol of list type, among ordered, unordered and descriptive. Then, each item is a list whose car is counter, and cdr are strings and other sub-lists. Inside strings, check-boxes are replaced by "[CBON]", "[CBOFF]" and "[CBTRANS]".

For example, the following list:

  1. first item
+ sub-item one
+ [X] sub-item two
more text in first item
  1. last item

will be parsed as:

(ordered

(nil "first item"
(unordered
  (nil "sub-item one")
  (nil "[CBON] sub-item two"))
"more text in first item")
(3 "last item"))

Point is left at list end.

org-list-prevs-alist struct

Return alist between item and previous item in struct.

org-list-repair

Fix indentation, bullets and checkboxes is the list at point.

org-list-search-backward regexp &optional bound noerror

Like re-search-backward but stop only where lists are recognized. Arguments regexp, bound and noerror are similar to those used in re-search-backward.

org-list-search-forward regexp &optional bound noerror

Like re-search-forward but stop only where lists are recognized. Arguments regexp, bound and noerror are similar to those used in re-search-forward.

org-list-search-generic search re bound noerr

Search a string in valid contexts for lists. Arguments search, re, bound and noerr are similar to those used in re-search-forward.

org-list-send-item item dest struct

Send item to destination dest.

struct is the list structure.

dest can have various values.

If dest is a buffer position, the function will assume it points to another item in the same list as item, and will move the latter just before the former.

If dest is begin (respectively end), item will be moved at the beginning (respectively end) of the list it belongs to.

If dest is a string like "N", where N is an integer, item will be moved at the Nth position in the list.

If dest is kill, item will be deleted and its body will be added to the kill-ring.

If dest is delete, item will be deleted.

This function returns, destructively, the new list structure.

org-list-send-list &optional maybe

Send a transformed version of this list to the receiver position. With argument maybe, fail quietly if no transformation is defined for this list.

org-list-separating-blank-lines-number pos struct prevs

Return number of blank lines that should separate items in list.

pos is the position of point where org-list-insert-item was called.

struct is the list structure. prevs is the alist of previous items, as returned by org-list-prevs-alist.

Assume point is at item's beginning. If the item is alone, apply some heuristics to guess the result.

org-list-set-bullet item struct bullet

Set bullet of item in struct to bullet.

This function modifies struct.

org-list-set-checkbox item struct checkbox

Set checkbox of item in struct to checkbox.

This function modifies struct.

org-list-set-ind item struct ind

Set indentation of item in struct to ind.

This function modifies struct.

org-list-set-item-visibility item struct view

Set visibility of item in struct to view.

Possible values are: folded, children or subtree. See org-cycle for more information.

org-list-set-nth n key struct new

Set the n=th value of =key in struct to new.

This function modifies struct.

org-list-struct

Return structure of list at point.

A list structure is an alist where key is point at item, and values are:

  1. indentation,
  2. bullet with trailing whitespace,
  3. bullet counter, if any,
  4. checkbox, if any,
  5. description tag, if any,
  6. position at item end.

Thus the following list, where numbers in parens are point-at-bol:

  • [X] first item (1)
1. sub-item 1                              (18)
5. [@5] sub-item 2                         (34)
some other text belonging to first item    (55)
  • last item (97)
+ tag :: description                       (109)
                                           (131)

will get the following structure:

((1 0 "- " nil "[X]" nil 97)

(18 2 "1. "  nil nil nil 34)
(34 2 "5. " "5" nil nil 55)
(97 0 "- "  nil nil nil 131)
(109 2 "+ " nil nil "tag" 131)

Assume point is at an item.

org-list-struct-apply-struct struct old-struct

Apply set difference between struct and old-struct to the buffer.

old-struct is the structure before any modifications, and struct the structure to be applied. The function will only modify parts of the list which have changed.

Initial position of cursor is restored after the changes.

org-list-struct-assoc-end struct end-list

Associate proper ending point to items in struct.

end-list is a pseudo-alist where car is indentation and cdr is ending position.

This function modifies struct.

org-list-struct-fix-box struct parents prevs &optional ordered

Verify and correct checkboxes in struct.

parents is the alist of parents and prevs is the alist of previous items, as returned by, respectively, org-list-parents-alist and org-list-prevs-alist.

If ordered is non-nil, a checkbox can only be checked when every checkbox before it is checked too. If there was an attempt to break this rule, the function will return the blocking item. In all others cases, the return value will be nil.

This function modifies struct.

org-list-struct-fix-bul struct prevs

Verify and correct bullets in struct. prevs is the alist of previous items, as returned by org-list-prevs-alist.

This function modifies struct.

org-list-struct-fix-ind struct parents &optional bullet-size

Verify and correct indentation in struct.

parents is the alist of parents, as returned by org-list-parents-alist.

If numeric optional argument bullet-size is set, assume all bullets in list have this length to determine new indentation.

This function modifies struct.

org-list-struct-fix-item-end struct

Verify and correct each item end position in struct.

This function modifies struct.

org-list-struct-indent start end struct parents prevs

Indent items between positions start and end.

struct is the list structure. parents is the alist of parents and prevs is the alist of previous items, returned by, respectively, org-list-parents-alist and org-list-prevs-alist.

start is included and end excluded.

struct may be modified if org-list-demote-modify-bullet matches bullets between start and end.

org-list-struct-outdent start end struct parents

Outdent items between positions start and end.

struct is the list structure. parents is the alist of items' parents, as returned by org-list-parents-alist.

start is included, end excluded.

org-list-swap-items beg-A beg-B struct

Swap item starting at beg-a with item starting at beg-b in struct. Blank lines at the end of items are left in place. Return the new structure after the changes.

Assume beg-a is lesser than beg-b and that beg-a and beg-b belong to the same sub-list.

This function modifies struct.

org-list-to-generic list params

Convert a list parsed through org-list-parse-list to other formats. Valid parameters params are:

:ustart String to start an unordered list :uend String to end an unordered list

:ostart String to start an ordered list :oend String to end an ordered list

:dstart String to start a descriptive list :dend String to end a descriptive list :dtstart String to start a descriptive term :dtend String to end a descriptive term :ddstart String to start a description :ddend String to end a description

:splice When set to t, return only list body lines, don't wrap them into :[u/o]start and :[u/o]end. Default is nil.

:istart String to start a list item. :icount String to start an item with a counter. :iend String to end a list item :isep String to separate items :lsep String to separate sublists :csep String to separate text from a sub-list

:cboff String to insert for an unchecked check-box :cbon String to insert for a checked check-box :cbtrans String to insert for a check-box in transitional state

:nobr Non-nil means remove line breaks in lists items.

Alternatively, each parameter can also be a form returning a string. These sexp can use keywords counter and depth, representing respectively counter associated to the current item, and depth of the current sub-list, starting at 0. Obviously, counter is only available for parameters applying to items.

org-list-to-html list &optional params

Convert list into a HTML list. list is as returned by org-list-parse-list. params is a property list with overruling parameters for org-list-to-generic.

org-list-to-latex list &optional params

Convert list into a LaTeX list. list is as returned by org-list-parse-list. params is a property list with overruling parameters for org-list-to-generic.

org-list-to-subtree list &optional params

Convert list into an Org subtree. list is as returned by org-list-parse-list. params is a property list with overruling parameters for org-list-to-generic.

org-list-to-texinfo list &optional params

Convert list into a Texinfo list. list is as returned by org-list-parse-list. params is a property list with overruling parameters for org-list-to-generic.

org-list-use-alpha-bul-p first struct prevs

Non-nil if list starting at first can have alphabetical bullets.

struct is list structure. prevs is the alist of previous items, as returned by org-list-prevs-alist.

org-list-write-struct struct parents &optional old-struct

Correct bullets, checkboxes and indentation in list at point.

struct is the list structure. parents is the alist of parents, as returned by org-list-parents-alist.

When non-nil, optional argument old-struct is the reference structure of the list. It should be provided whenever struct doesn't correspond anymore to the real list in buffer.

org-listtable-to-string tbl

Convert a listtable tbl to a string that contains the Org-mode table. The table still need to be aligned. The resulting string has no leading and tailing newline characters.

Documentation from the http://orgmode.org/worg/ website (either in its HTML format or in its Org format) is licensed under the GNU Free Documentation License version 1.3 or later. The code examples and css stylesheets are licensed under the GNU General Public License v3 or later.