File: org-element.el.html

See <https://orgmode.org/worg/dev/org-syntax.html> for details about Org syntax.

Lisp-wise, a syntax object can be represented as a list. It follows the pattern (TYPE PROPERTIES CONTENTS), where:
  TYPE is a symbol describing the object.
  PROPERTIES is the property list attached to it. See docstring of
             appropriate parsing function to get an exhaustive list.
  CONTENTS is a list of syntax objects or raw strings contained
           in the current object, when applicable.

For the whole document, TYPE is org-data and PROPERTIES is nil.

The first part of this file defines constants for the Org syntax, while the second one provide accessors and setters functions.

The next part implements a parser and an interpreter for each element and object type in Org syntax.

The following part creates a fully recursive buffer parser. It also provides a tool to map a function to elements or objects matching some criteria in the parse tree. Functions of interest are org-element-parse-buffer, org-element-map and, to a lesser extent, org-element-parse-secondary-string.

The penultimate part is the cradle of an interpreter for the obtained parse tree: org-element-interpret-data.

The library ends by furnishing org-element-at-point function, and a way to give information about document structure around point with org-element-context. A cache mechanism is also provided for these functions.

Defined variables (73)

org-element--affiliated-reRegexp matching any affiliated keyword.
org-element--cacheAVL tree used to cache elements.
org-element--cache-avoid-synchronous-headline-re-parsingThis variable controls how buffer changes are handled by the cache.
org-element--cache-change-ticLast ‘buffer-chars-modified-tick’ for registered changes.
org-element--cache-change-warningNon-nil when a sensitive line is about to be changed.
org-element--cache-diagnosticsPrint detailed diagnostics of cache processing.
org-element--cache-diagnostics-levelDetail level of the diagnostics.
org-element--cache-diagnostics-ringRing containing last ‘org-element--cache-diagnostics-ring-size’
org-element--cache-diagnostics-ring-sizeSize of ‘org-element--cache-diagnostics-ring’.
org-element--cache-element-propertiesList of element properties used internally by cache.
org-element--cache-gaplessAn alist containing (granularity . ‘org-element--cache-change-tic’) elements.
org-element--cache-hash-leftCached elements from ‘org-element--cache’ for fast O(1) lookup.
org-element--cache-hash-nocacheNumber of calls to ‘org-element--cache-has’ with ‘both’ SIDE argument.
org-element--cache-hash-rightCached elements from ‘org-element--cache’ for fast O(1) lookup.
org-element--cache-hash-sizeCache size for recent cached calls to ‘org-element--cache-find’.
org-element--cache-hash-statisticsCons cell storing how Org makes use of ‘org-element--cache-find’ caching.
org-element--cache-interrupt-C-gWhen non-nil, allow the user to abort ‘org-element--cache-sync’.
org-element--cache-interrupt-C-g-countCurrent number of ‘org-element--cache-sync’ calls.
org-element--cache-interrupt-C-g-max-count‘C-g’ count to interrupt ‘org-element--cache-sync’.
org-element--cache-last-buffer-sizeLast value of ‘buffer-size’ for registered changes.
org-element--cache-map-statisticsPrint statistics for ‘org-element-cache-map’.
org-element--cache-map-statistics-thresholdTime threshold in seconds to log statistics for ‘org-element-cache-map’.
org-element--cache-non-modifying-commandsList of commands that are not expected to change the cache state.
org-element--cache-self-verifyActivate extra consistency checks for the cache.
org-element--cache-self-verify-frequencyFrequency of cache element verification.
org-element--cache-sensitive-reRegexp matching a sensitive line, structure wise.
org-element--cache-sizeSize of the ‘org-element--cache’.
org-element--cache-sync-keys-valueId value used to identify keys during synchronization.
org-element--cache-sync-requestsList of pending synchronization requests.
org-element--cache-sync-timerTimer used for cache synchronization.
org-element--footnote-separatorRegexp used as a footnote definition separator.
org-element--headline-cacheAVL tree used to cache headline and inlinetask elements.
org-element--headline-cache-sizeSize of the ‘org-element--headline-cache’.
org-element--latex-begin-environmentRegexp matching the beginning of a LaTeX environment.
org-element--latex-end-environmentFormat string matching the ending of a LaTeX environment.
org-element--object-regexpRegexp possibly matching the beginning of an object.
org-element--pair-curly-tableTable used internally to pair only curly brackets.
org-element--pair-round-tableTable used internally to pair only round brackets.
org-element--pair-square-tableTable used internally to pair only square brackets.
org-element--parsed-properties-alistAlist of parsed keywords and associated properties.
org-element--timestamp-regexpRegexp matching any timestamp type object.
org-element-affiliated-keywordsList of affiliated keywords as strings.
org-element-all-elementsComplete list of element types.
org-element-all-objectsComplete list of object types.
org-element-archive-tagTag marking a substree as archived.
org-element-cache-map-continue-fromPosition from where mapping should continue.
org-element-cache-persistentNon-nil when cache should persist between Emacs sessions.
org-element-cache-sync-breakDuration, as a time value, of the pause between synchronizations.
org-element-cache-sync-durationMaximum duration, as a time value, for a cache synchronization.
org-element-cache-sync-idle-timeLength, in seconds, of idle time before syncing cache.
org-element-citation-key-reRegexp matching a citation key.
org-element-citation-prefix-reRegexp matching a citation prefix.
org-element-clock-line-reRegexp matching a clock line.
org-element-closed-keywordKeyword used to close TODO entries.
org-element-comment-stringString marker for commented headlines.
org-element-deadline-keywordKeyword used to mark deadline entries.
org-element-drawer-reRegexp matching opening or closing line of a drawer.
org-element-dual-keywordsList of affiliated keywords which can have a secondary value.
org-element-dynamic-block-open-reRegexp matching the opening line of a dynamic block.
org-element-greater-elementsList of recursive element types aka Greater Elements.
org-element-headline-reRegexp matching a headline.
org-element-keyword-translation-alistAlist of usual translations for keywords.
org-element-multiple-keywordsList of affiliated keywords that can occur more than once in an element.
org-element-object-containersList of object or element types that can directly contain objects.
org-element-object-restrictionsAlist of objects restrictions.
org-element-paragraph-separateRegexp to separate paragraphs in an Org buffer.
org-element-parsed-keywordsList of affiliated keywords whose value can be parsed.
org-element-planning-keywords-reRegexp matching any planning line keyword.
org-element-planning-line-reRegexp matching a planning line.
org-element-recursive-objectsList of recursive object types.
org-element-scheduled-keywordKeyword used to mark scheduled entries.
org-element-secondary-value-alistAlist between element types and locations of secondary values.
org-element-use-cacheNon-nil when Org parser should cache its results.

Defined functions (190)

org-element--cache-active-p(&optional CALLED-FROM-CACHE-CHANGE-FUNC-P)
org-element--cache-after-change(BEG END PRE)
org-element--cache-before-change(BEG END)
org-element--cache-compare(A B)
org-element--cache-find(POS &optional SIDE)
org-element--cache-for-removal(BEG END OFFSET)
org-element--cache-generate-key(LOWER UPPER)
org-element--cache-interrupt-p(TIME-LIMIT)
org-element--cache-key(ELEMENT)
org-element--cache-key-less-p(A B)
org-element--cache-log-message(FORMAT-STRING &rest ARGS)
org-element--cache-persist-after-read(CONTAINER &optional ASSOCIATED)
org-element--cache-persist-before-read(CONTAINER &optional ASSOCIATED)
org-element--cache-persist-before-write(CONTAINER &optional ASSOCIATED)
org-element--cache-process-request(REQUEST NEXT-REQUEST-KEY THRESHOLD TIME-LIMIT FUTURE-CHANGE OFFSET)
org-element--cache-put(ELEMENT)
org-element--cache-remove(ELEMENT)
org-element--cache-root()
org-element--cache-set-timer(BUFFER)
org-element--cache-setup-change-functions()
org-element--cache-shift-positions(ELEMENT OFFSET &optional PROPS)
org-element--cache-submit-request(BEG END OFFSET)
org-element--cache-sync(BUFFER &optional THRESHOLD FUTURE-CHANGE OFFSET)
org-element--cache-verify-element(ELEMENT)
org-element--cache-warn(FORMAT-STRING &rest ARGS)
org-element--collect-affiliated-keywords(LIMIT PARSE)
org-element--current-element(LIMIT &optional GRANULARITY MODE STRUCTURE ADD-TO-CACHE)
org-element--format-element(ELEMENT)
org-element--get-global-node-properties()
org-element--get-node-properties(&optional AT-POINT-P?)
org-element--get-time-properties()
org-element--headline-cache-root()
org-element--interpret-affiliated-keywords(ELEMENT)
org-element--list-struct(LIMIT)
org-element--next-mode(MODE TYPE PARENT?)
org-element--object-lex(RESTRICTION)
org-element--open-end-p(ELEMENT)
org-element--parse-elements(BEG END MODE STRUCTURE GRANULARITY VISIBLE-ONLY ACC)
org-element--parse-generic-emphasis(MARK TYPE)
org-element--parse-objects(BEG END ACC RESTRICTION &optional PARENT)
org-element--parse-paired-brackets(CHAR)
org-element--parse-to(POS &optional SYNCP TIME-LIMIT)
org-element--request-beg(REQUEST)
org-element--request-end(REQUEST)
org-element--request-key(REQUEST)
org-element--request-offset(REQUEST)
org-element--request-parent(REQUEST)
org-element--request-phase(REQUEST)
org-element--set-regexps()
org-element-adopt-elements(PARENT &rest CHILDREN)
org-element-at-point(&optional POM CACHED-ONLY)
org-element-at-point-no-context(&optional POM)
org-element-babel-call-interpreter(BABEL-CALL _)
org-element-babel-call-parser(LIMIT AFFILIATED)
org-element-bold-interpreter(_ CONTENTS)
org-element-bold-parser()
org-element-cache-hash-show-statistics()
org-element-cache-map
org-element-cache-refresh(POS)
org-element-cache-reset(&optional ALL NO-PERSISTENCE)
org-element-center-block-interpreter(_ CONTENTS)
org-element-center-block-parser(LIMIT AFFILIATED)
org-element-citation-interpreter(CITATION CONTENTS)
org-element-citation-parser()
org-element-citation-reference-interpreter(CITATION-REFERENCE _)
org-element-citation-reference-parser()
org-element-class(DATUM &optional PARENT)
org-element-clock-interpreter(CLOCK _)
org-element-clock-parser(LIMIT)
org-element-code-interpreter(CODE _)
org-element-code-parser()
org-element-comment-block-interpreter(COMMENT-BLOCK _)
org-element-comment-block-parser(LIMIT AFFILIATED)
org-element-comment-interpreter(COMMENT _)
org-element-comment-parser(LIMIT)
org-element-contents(ELEMENT)
org-element-context(&optional ELEMENT)
org-element-copy(DATUM)
org-element-create(TYPE &optional PROPS &rest CHILDREN)
org-element-diary-sexp-interpreter(DIARY-SEXP _)
org-element-diary-sexp-parser(LIMIT AFFILIATED)
org-element-drawer-interpreter(DRAWER CONTENTS)
org-element-drawer-parser(LIMIT AFFILIATED)
org-element-dynamic-block-interpreter(DYNAMIC-BLOCK CONTENTS)
org-element-dynamic-block-parser(LIMIT AFFILIATED)
org-element-entity-interpreter(ENTITY _)
org-element-entity-parser()
org-element-example-block-interpreter(EXAMPLE-BLOCK _)
org-element-example-block-parser(LIMIT AFFILIATED)
org-element-export-block-interpreter(EXPORT-BLOCK _)
org-element-export-block-parser(LIMIT AFFILIATED)
org-element-export-snippet-interpreter(EXPORT-SNIPPET _)
org-element-export-snippet-parser()
org-element-extract-element(ELEMENT)
org-element-fixed-width-interpreter(FIXED-WIDTH _)
org-element-fixed-width-parser(LIMIT AFFILIATED)
org-element-footnote-definition-interpreter(FOOTNOTE-DEFINITION CONTENTS)
org-element-footnote-definition-parser(LIMIT AFFILIATED)
org-element-footnote-reference-interpreter(FOOTNOTE-REFERENCE CONTENTS)
org-element-footnote-reference-parser()
org-element-headline-interpreter(HEADLINE CONTENTS)
org-element-headline-parser(&optional _ RAW-SECONDARY-P)
org-element-horizontal-rule-interpreter(&rest _)
org-element-horizontal-rule-parser(LIMIT AFFILIATED)
org-element-inline-babel-call-interpreter(INLINE-BABEL-CALL _)
org-element-inline-babel-call-parser()
org-element-inline-src-block-interpreter(INLINE-SRC-BLOCK _)
org-element-inline-src-block-parser()
org-element-inlinetask-interpreter(INLINETASK CONTENTS)
org-element-inlinetask-parser(LIMIT &optional RAW-SECONDARY-P)
org-element-insert-before(ELEMENT LOCATION)
org-element-interpret-data(DATA)
org-element-italic-interpreter(_ CONTENTS)
org-element-italic-parser()
org-element-item-interpreter(ITEM CONTENTS)
org-element-item-parser(_ STRUCT &optional RAW-SECONDARY-P)
org-element-keyword-interpreter(KEYWORD _)
org-element-keyword-parser(LIMIT AFFILIATED)
org-element-latex-environment-interpreter(LATEX-ENVIRONMENT _)
org-element-latex-environment-parser(LIMIT AFFILIATED)
org-element-latex-fragment-interpreter(LATEX-FRAGMENT _)
org-element-latex-fragment-parser()
org-element-line-break-interpreter(&rest _)
org-element-line-break-parser()
org-element-lineage(DATUM &optional TYPES WITH-SELF)
org-element-link-interpreter(LINK CONTENTS)
org-element-link-parser()
org-element-macro-interpreter(MACRO _)
org-element-macro-parser()
org-element-map(DATA TYPES FUN &optional INFO FIRST-MATCH NO-RECURSION WITH-AFFILIATED)
org-element-nested-p(ELEM-A ELEM-B)
org-element-node-property-interpreter(NODE-PROPERTY _)
org-element-node-property-parser(LIMIT)
org-element-normalize-contents(ELEMENT &optional IGNORE-FIRST)
org-element-normalize-string(S)
org-element-org-data-interpreter(_ CONTENTS)
org-element-org-data-parser(&optional _)
org-element-paragraph-interpreter(_ CONTENTS)
org-element-paragraph-parser(LIMIT AFFILIATED)
org-element-parse-buffer(&optional GRANULARITY VISIBLE-ONLY)
org-element-parse-secondary-string(STRING RESTRICTION &optional PARENT)
org-element-plain-list-interpreter(_ CONTENTS)
org-element-plain-list-parser(LIMIT AFFILIATED STRUCTURE)
org-element-planning-interpreter(PLANNING _)
org-element-planning-parser(LIMIT)
org-element-property(PROPERTY ELEMENT)
org-element-property-drawer-interpreter(_ CONTENTS)
org-element-property-drawer-parser(LIMIT)
org-element-put-property(ELEMENT PROPERTY VALUE)
org-element-quote-block-interpreter(_ CONTENTS)
org-element-quote-block-parser(LIMIT AFFILIATED)
org-element-radio-target-interpreter(_ CONTENTS)
org-element-radio-target-parser()
org-element-restriction(ELEMENT)
org-element-secondary-p(OBJECT)
org-element-section-interpreter(_ CONTENTS)
org-element-section-parser(_)
org-element-set-contents(ELEMENT &rest CONTENTS)
org-element-set-element(OLD NEW)
org-element-special-block-interpreter(SPECIAL-BLOCK CONTENTS)
org-element-special-block-parser(LIMIT AFFILIATED)
org-element-src-block-interpreter(SRC-BLOCK _)
org-element-src-block-parser(LIMIT AFFILIATED)
org-element-statistics-cookie-interpreter(STATISTICS-COOKIE _)
org-element-statistics-cookie-parser()
org-element-strike-through-interpreter(_ CONTENTS)
org-element-strike-through-parser()
org-element-subscript-interpreter(SUBSCRIPT CONTENTS)
org-element-subscript-parser()
org-element-superscript-interpreter(SUPERSCRIPT CONTENTS)
org-element-superscript-parser()
org-element-swap-A-B(ELEM-A ELEM-B)
org-element-table-cell-interpreter(_ CONTENTS)
org-element-table-cell-parser()
org-element-table-interpreter(TABLE CONTENTS)
org-element-table-parser(LIMIT AFFILIATED)
org-element-table-row-interpreter(TABLE-ROW CONTENTS)
org-element-table-row-parser(_)
org-element-target-interpreter(TARGET _)
org-element-target-parser()
org-element-timestamp-interpreter(TIMESTAMP _)
org-element-timestamp-parser()
org-element-type(ELEMENT)
org-element-underline-interpreter(_ CONTENTS)
org-element-underline-parser()
org-element-update-syntax()
org-element-verbatim-interpreter(VERBATIM _)
org-element-verbatim-parser()
org-element-verse-block-interpreter(_ CONTENTS)
org-element-verse-block-parser(LIMIT AFFILIATED)

Defined faces (0)