Function: org-item-re

org-item-re is a byte-compiled function defined in org-list.el.gz.

Signature

(org-item-re)

Documentation

Return the correct regular expression for plain lists.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-list.el.gz
(defsubst org-item-re ()
  "Return the correct regular expression for plain lists."
  (or (plist-get
       (plist-get org--item-re-cache
                  org-list-allow-alphabetical)
       org-plain-list-ordered-item-terminator)
      (let* ((term (cond
                    ((eq org-plain-list-ordered-item-terminator t) "[.)]")
                    ((= org-plain-list-ordered-item-terminator ?\)) ")")
                    ((= org-plain-list-ordered-item-terminator ?.) "\\.")
                    (t "[.)]")))
	     (alpha (if org-list-allow-alphabetical "\\|[A-Za-z]" ""))
             (re (concat "\\([ \t]*\\([-+]\\|\\(\\([0-9]+" alpha "\\)" term
                         "\\)\\)\\|[ \t]+\\*\\)\\([ \t]+\\|$\\)")))
        (setq org--item-re-cache
              (plist-put
               org--item-re-cache
               org-list-allow-alphabetical
               (plist-put
                (plist-get org--item-re-cache
                           org-list-allow-alphabetical)
                org-plain-list-ordered-item-terminator
                re)))
        re)))