org-element: Update docstrings using new syntax node terminology

This commit is contained in:
Ihor Radchenko 2023-04-28 13:27:20 +02:00
parent 23f9347d1a
commit 71e2ea5698
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 188 additions and 204 deletions

View File

@ -497,15 +497,16 @@ past the brackets."
;; There is `org-element-put-property', `org-element-set-contents'. ;; There is `org-element-put-property', `org-element-set-contents'.
;; These low-level functions are useful to build a parse tree. ;; These low-level functions are useful to build a parse tree.
;; ;;
;; `org-element-adopt-elements', `org-element-set', ;; `org-element-adopt', `org-element-set', `org-element-extract' and
;; `org-element-extract' and `org-element-insert-before' are ;; `org-element-insert-before' are high-level functions useful to
;; high-level functions useful to modify a parse tree. ;; modify a parse tree.
;; ;;
;; `org-element-secondary-p' is a predicate used to know if a given ;; `org-element-secondary-p' is a predicate used to know if a given
;; object belongs to a secondary string. `org-element-class' tells if ;; object belongs to a secondary string. `org-element-class' tells if
;; some parsed data is an element or an object, handling pseudo ;; some parsed data is an element or an object, handling pseudo
;; elements and objects. `org-element-copy' returns an element or ;; elements and objects. `org-element-copy' returns an element or
;; object, stripping its parent property in the process. ;; object, stripping its parent property and resolving deferred values
;; in the process.
(require 'org-element-ast) (require 'org-element-ast)
@ -619,9 +620,9 @@ the buffer position at the beginning of the first affiliated
keyword and CDR is a plist of affiliated keywords along with keyword and CDR is a plist of affiliated keywords along with
their value. their value.
Return a list whose CAR is `center-block' and CDR is a plist Return a new syntax node of `center-block' type containing `:begin',
containing `:begin', `:end', `:contents-begin', `:contents-end', `:end', `:contents-begin', `:contents-end', `:post-blank' and
`:post-blank' and `:post-affiliated' keywords. `:post-affiliated' properties.
Assume point is at the beginning of the block." Assume point is at the beginning of the block."
(let ((case-fold-search t)) (let ((case-fold-search t))
@ -670,9 +671,9 @@ the buffer position at the beginning of the first affiliated
keyword and CDR is a plist of affiliated keywords along with keyword and CDR is a plist of affiliated keywords along with
their value. their value.
Return a list whose CAR is `drawer' and CDR is a plist containing Return a new syntax node of `drawer' type containing `:drawer-name',
`:drawer-name', `:begin', `:end', `:contents-begin', `:begin', `:end', `:contents-begin', `:contents-end', `:post-blank'
`:contents-end', `:post-blank' and `:post-affiliated' keywords. and `:post-affiliated' properties.
Assume point is at beginning of drawer." Assume point is at beginning of drawer."
(let ((case-fold-search t)) (let ((case-fold-search t))
@ -729,10 +730,9 @@ the buffer position at the beginning of the first affiliated
keyword and CDR is a plist of affiliated keywords along with keyword and CDR is a plist of affiliated keywords along with
their value. their value.
Return a list whose CAR is `dynamic-block' and CDR is a plist Return a new syntax node of `dynamic-block' type containing
containing `:block-name', `:begin', `:end', `:contents-begin', `:block-name', `:begin', `:end', `:contents-begin', `:contents-end',
`:contents-end', `:arguments', `:post-blank' and `:arguments', `:post-blank' and `:post-affiliated' properties.
`:post-affiliated' keywords.
Assume point is at beginning of dynamic block." Assume point is at beginning of dynamic block."
(let ((case-fold-search t)) (let ((case-fold-search t))
@ -797,10 +797,9 @@ the buffer position at the beginning of the first affiliated
keyword and CDR is a plist of affiliated keywords along with keyword and CDR is a plist of affiliated keywords along with
their value. their value.
Return a list whose CAR is `footnote-definition' and CDR is Return a new syntax node of `footnote-definition' type containing
a plist containing `:label', `:begin' `:end', `:contents-begin', `:label', `:begin' `:end', `:contents-begin', `:contents-end',
`:contents-end', `:pre-blank',`:post-blank' and `:pre-blank',`:post-blank' and `:post-affiliated' properties.
`:post-affiliated' keywords.
Assume point is at the beginning of the footnote definition." Assume point is at the beginning of the footnote definition."
(save-excursion (save-excursion
@ -995,13 +994,12 @@ Return value is a plist."
(defun org-element-headline-parser (&optional _ raw-secondary-p) (defun org-element-headline-parser (&optional _ raw-secondary-p)
"Parse a headline. "Parse a headline.
Return a list whose CAR is `headline' and CDR is a plist Return a new syntax node of `headline' type containing `:raw-value',
containing `:raw-value', `:title', `:begin', `:end', `:title', `:begin', `:end', `:pre-blank', `:contents-begin' and
`:pre-blank', `:contents-begin' and `:contents-end', `:level', `:contents-end', `:level', `:priority', `:tags', `:todo-keyword',
`:priority', `:tags', `:todo-keyword', `:todo-type', `:scheduled', `:todo-type', `:scheduled', `:deadline', `:closed', `:archivedp',
`:deadline', `:closed', `:archivedp', `:commentedp' `:commentedp' `:footnote-section-p', `:post-blank' and
`:footnote-section-p', `:post-blank' and `:post-affiliated' `:post-affiliated' properties.
keywords.
The plist also contains any property set in the property drawer, The plist also contains any property set in the property drawer,
with its name in upper cases and colons added at the with its name in upper cases and colons added at the
@ -1179,7 +1177,11 @@ parser (e.g. `:end' and :END:). Return value is a plist."
(defvar org-element-org-data-parser--recurse nil) (defvar org-element-org-data-parser--recurse nil)
(defun org-element-org-data-parser (&optional _) (defun org-element-org-data-parser (&optional _)
"Parse org-data." "Parse org-data.
Return a new syntax node of `org-data' type containing `:begin',
`:contents-begin', `:contents-end', `:end', `:post-blank',
`:post-affiliated', and `:path' properties."
(org-with-wide-buffer (org-with-wide-buffer
(let* ((begin 1) (let* ((begin 1)
(contents-begin (progn (contents-begin (progn
@ -1255,12 +1257,11 @@ CONTENTS is the contents of the element."
(defun org-element-inlinetask-parser (limit &optional raw-secondary-p) (defun org-element-inlinetask-parser (limit &optional raw-secondary-p)
"Parse an inline task. "Parse an inline task.
Return a list whose CAR is `inlinetask' and CDR is a plist Return a new syntax node of `inlinetask' type containing `:title',
containing `:title', `:begin', `:end', `:pre-blank', `:begin', `:end', `:pre-blank', `:contents-begin' and `:contents-end',
`:contents-begin' and `:contents-end', `:level', `:priority', `:level', `:priority', `:raw-value', `:tags', `:todo-keyword',
`:raw-value', `:tags', `:todo-keyword', `:todo-type', `:todo-type', `:scheduled', `:deadline', `:closed', `:post-blank' and
`:scheduled', `:deadline', `:closed', `:post-blank' and `:post-affiliated' properties.
`:post-affiliated' keywords.
The plist also contains any property set in the property drawer, The plist also contains any property set in the property drawer,
with its name in upper cases and colons added at the with its name in upper cases and colons added at the
@ -1414,10 +1415,10 @@ CONTENTS is the contents of inlinetask."
STRUCT is the structure of the plain list. STRUCT is the structure of the plain list.
Return a list whose CAR is `item' and CDR is a plist containing Return a new syntax node of `item' type containing `:bullet',
`:bullet', `:begin', `:end', `:contents-begin', `:contents-end', `:begin', `:end', `:contents-begin', `:contents-end', `:checkbox',
`:checkbox', `:counter', `:tag', `:structure', `:pre-blank', `:counter', `:tag', `:structure', `:pre-blank', `:post-blank' and
`:post-blank' and `:post-affiliated' keywords. `:post-affiliated' properties.
When optional argument RAW-SECONDARY-P is non-nil, item's tag, if When optional argument RAW-SECONDARY-P is non-nil, item's tag, if
any, will not be parsed as a secondary string, but as a plain any, will not be parsed as a secondary string, but as a plain
@ -1631,10 +1632,9 @@ keyword and CDR is a plist of affiliated keywords along with
their value. STRUCTURE is the structure of the plain list being their value. STRUCTURE is the structure of the plain list being
parsed. parsed.
Return a list whose CAR is `plain-list' and CDR is a plist Return a new syntax node of `plain-list' type containing `:type',
containing `:type', `:begin', `:end', `:contents-begin' and `:begin', `:end', `:contents-begin' and `:contents-end', `:structure',
`:contents-end', `:structure', `:post-blank' and `:post-blank' and `:post-affiliated' properties.
`:post-affiliated' keywords.
Assume point is at the beginning of the list." Assume point is at the beginning of the list."
(save-excursion (save-excursion
@ -1685,9 +1685,9 @@ CONTENTS is the contents of the element."
LIMIT bounds the search. LIMIT bounds the search.
Return a list whose car is `property-drawer' and cdr is a plist Return a new syntax node of `property-drawer' type containing
containing `:begin', `:end', `:contents-begin', `:contents-end', `:begin', `:end', `:contents-begin', `:contents-end', `:post-blank'
`:post-blank' and `:post-affiliated' keywords. and `:post-affiliated' properties.
Assume point is at the beginning of the property drawer." Assume point is at the beginning of the property drawer."
(save-excursion (save-excursion
@ -1725,9 +1725,9 @@ the buffer position at the beginning of the first affiliated
keyword and CDR is a plist of affiliated keywords along with keyword and CDR is a plist of affiliated keywords along with
their value. their value.
Return a list whose CAR is `quote-block' and CDR is a plist Return a new syntax node of `quote-block' type containing `:begin',
containing `:begin', `:end', `:contents-begin', `:contents-end', `:end', `:contents-begin', `:contents-end', `:post-blank' and
`:post-blank' and `:post-affiliated' keywords. `:post-affiliated' properties.
Assume point is at the beginning of the block." Assume point is at the beginning of the block."
(let ((case-fold-search t)) (let ((case-fold-search t))
@ -1771,9 +1771,9 @@ CONTENTS is the contents of the element."
(defun org-element-section-parser (_) (defun org-element-section-parser (_)
"Parse a section. "Parse a section.
Return a list whose CAR is `section' and CDR is a plist Return a new syntax node of `section' type containing `:begin',
containing `:begin', `:end', `:contents-begin', `contents-end', `:end', `:contents-begin', `contents-end', `:post-blank' and
`:post-blank' and `:post-affiliated' keywords." `:post-affiliated' properties."
(save-excursion (save-excursion
;; Beginning of section is the beginning of the first non-blank ;; Beginning of section is the beginning of the first non-blank
;; line after previous headline. ;; line after previous headline.
@ -1814,10 +1814,9 @@ the buffer position at the beginning of the first affiliated
keyword and CDR is a plist of affiliated keywords along with keyword and CDR is a plist of affiliated keywords along with
their value. their value.
Return a list whose CAR is `special-block' and CDR is a plist Return a new syntax node of `special-block' type containing `:type',
containing `:type', `:parameters', `:begin', `:end', `:parameters', `:begin', `:end', `:contents-begin', `:contents-end',
`:contents-begin', `:contents-end', `:post-blank' and `:post-blank' and `:post-affiliated' properties.
`:post-affiliated' keywords.
Assume point is at the beginning of the block." Assume point is at the beginning of the block."
(let* ((case-fold-search t) (let* ((case-fold-search t)
@ -1891,10 +1890,9 @@ the buffer position at the beginning of the first affiliated
keyword and cdr is a plist of affiliated keywords along with keyword and cdr is a plist of affiliated keywords along with
their value. their value.
Return a list whose car is `babel-call' and cdr is a plist Return a new syntax node of `babel-call' type containing `:call',
containing `:call', `:inside-header', `:arguments', `:inside-header', `:arguments', `:end-header', `:begin', `:end',
`:end-header', `:begin', `:end', `:value', `:post-blank' and `:value', `:post-blank' and `:post-affiliated' as properties."
`:post-affiliated' as keywords."
(save-excursion (save-excursion
(let* ((begin (car affiliated)) (let* ((begin (car affiliated))
(post-affiliated (point)) (post-affiliated (point))
@ -1951,9 +1949,9 @@ containing `:call', `:inside-header', `:arguments',
LIMIT bounds the search. LIMIT bounds the search.
Return a list whose CAR is `clock' and CDR is a plist containing Return a new syntax node of `clock' type containing `:status',
`:status', `:value', `:time', `:begin', `:end', `:post-blank' and `:value', `:time', `:begin', `:end', `:post-blank' and
`:post-affiliated' as keywords." `:post-affiliated' as properties."
(save-excursion (save-excursion
(let* ((case-fold-search nil) (let* ((case-fold-search nil)
(begin (point)) (begin (point))
@ -2001,9 +1999,8 @@ Return a list whose CAR is `clock' and CDR is a plist containing
LIMIT bounds the search. LIMIT bounds the search.
Return a list whose CAR is `comment' and CDR is a plist Return a new syntax node of `comment' type containing `:begin',
containing `:begin', `:end', `:value', `:post-blank', `:end', `:value', `:post-blank', `:post-affiliated' properties.
`:post-affiliated' keywords.
Assume point is at comment beginning." Assume point is at comment beginning."
(save-excursion (save-excursion
@ -2052,9 +2049,8 @@ the buffer position at the beginning of the first affiliated
keyword and CDR is a plist of affiliated keywords along with keyword and CDR is a plist of affiliated keywords along with
their value. their value.
Return a list whose CAR is `comment-block' and CDR is a plist Return a new syntax node of `comment-block' type containing `:begin',
containing `:begin', `:end', `:value', `:post-blank' and `:end', `:value', `:post-blank' and `:post-affiliated' properties.
`:post-affiliated' keywords.
Assume point is at comment block beginning." Assume point is at comment block beginning."
(let ((case-fold-search t)) (let ((case-fold-search t))
@ -2105,9 +2101,8 @@ the buffer position at the beginning of the first affiliated
keyword and CDR is a plist of affiliated keywords along with keyword and CDR is a plist of affiliated keywords along with
their value. their value.
Return a list whose CAR is `diary-sexp' and CDR is a plist Return a new syntax node of `diary-sexp' type containing `:begin',
containing `:begin', `:end', `:value', `:post-blank' and `:end', `:value', `:post-blank' and `:post-affiliated' properties."
`:post-affiliated' keywords."
(save-excursion (save-excursion
(let ((begin (car affiliated)) (let ((begin (car affiliated))
(post-affiliated (point)) (post-affiliated (point))
@ -2141,10 +2136,10 @@ the buffer position at the beginning of the first affiliated
keyword and CDR is a plist of affiliated keywords along with keyword and CDR is a plist of affiliated keywords along with
their value. their value.
Return a list whose CAR is `example-block' and CDR is a plist Return a new syntax node of `example-block' type containing `:begin',
containing `:begin', `:end', `:number-lines', `:preserve-indent', `:end', `:number-lines', `:preserve-indent', `:retain-labels',
`:retain-labels', `:use-labels', `:label-fmt', `:switches', `:use-labels', `:label-fmt', `:switches', `:value', `:post-blank' and
`:value', `:post-blank' and `:post-affiliated' keywords." `:post-affiliated' properties."
(let ((case-fold-search t)) (let ((case-fold-search t))
(if (not (save-excursion (if (not (save-excursion
(re-search-forward "^[ \t]*#\\+END_EXAMPLE[ \t]*$" limit t))) (re-search-forward "^[ \t]*#\\+END_EXAMPLE[ \t]*$" limit t)))
@ -2248,9 +2243,9 @@ the buffer position at the beginning of the first affiliated
keyword and CDR is a plist of affiliated keywords along with keyword and CDR is a plist of affiliated keywords along with
their value. their value.
Return a list whose CAR is `export-block' and CDR is a plist Return a new syntax node of `export-block' type containing `:begin',
containing `:begin', `:end', `:type', `:value', `:post-blank' and `:end', `:type', `:value', `:post-blank' and `:post-affiliated'
`:post-affiliated' keywords. properties.
Assume point is at export-block beginning." Assume point is at export-block beginning."
(let* ((case-fold-search t)) (let* ((case-fold-search t))
@ -2306,9 +2301,8 @@ the buffer position at the beginning of the first affiliated
keyword and CDR is a plist of affiliated keywords along with keyword and CDR is a plist of affiliated keywords along with
their value. their value.
Return a list whose CAR is `fixed-width' and CDR is a plist Return a new syntax node of `fixed-width' type containing `:begin',
containing `:begin', `:end', `:value', `:post-blank' and `:end', `:value', `:post-blank' and `:post-affiliated' properties.
`:post-affiliated' keywords.
Assume point is at the beginning of the fixed-width area." Assume point is at the beginning of the fixed-width area."
(save-excursion (save-excursion
@ -2353,9 +2347,8 @@ the buffer position at the beginning of the first affiliated
keyword and CDR is a plist of affiliated keywords along with keyword and CDR is a plist of affiliated keywords along with
their value. their value.
Return a list whose CAR is `horizontal-rule' and CDR is a plist Return a new syntax node of `horizontal-rule' type containing
containing `:begin', `:end', `:post-blank' and `:post-affiliated' `:begin', `:end', `:post-blank' and `:post-affiliated' properties."
keywords."
(save-excursion (save-excursion
(let ((begin (car affiliated)) (let ((begin (car affiliated))
(post-affiliated (point)) (post-affiliated (point))
@ -2386,9 +2379,9 @@ the buffer position at the beginning of the first affiliated
keyword and CDR is a plist of affiliated keywords along with keyword and CDR is a plist of affiliated keywords along with
their value. their value.
Return a list whose CAR is a normalized `keyword' (uppercase) and Return a new syntax node of `keyword' type containing `:key',
CDR is a plist containing `:key', `:value', `:begin', `:end', `:value', `:begin', `:end', `:post-blank' and `:post-affiliated'
`:post-blank' and `:post-affiliated' keywords." properties."
(save-excursion (save-excursion
;; An orphaned affiliated keyword is considered as a regular ;; An orphaned affiliated keyword is considered as a regular
;; keyword. In this case AFFILIATED is nil, so we take care of ;; keyword. In this case AFFILIATED is nil, so we take care of
@ -2443,9 +2436,9 @@ the buffer position at the beginning of the first affiliated
keyword and CDR is a plist of affiliated keywords along with keyword and CDR is a plist of affiliated keywords along with
their value. their value.
Return a list whose CAR is `latex-environment' and CDR is a plist Return a new syntax node of `latex-environment' type containing
containing `:begin', `:end', `:value', `:post-blank' and `:begin', `:end', `:value', `:post-blank' and `:post-affiliated'
`:post-affiliated' keywords. properties.
Assume point is at the beginning of the latex environment." Assume point is at the beginning of the latex environment."
(save-excursion (save-excursion
@ -2488,9 +2481,9 @@ Assume point is at the beginning of the latex environment."
LIMIT bounds the search. LIMIT bounds the search.
Return a list whose CAR is `node-property' and CDR is a plist Return a new syntax node of `node-property' type containing `:key',
containing `:key', `:value', `:begin', `:end', `:post-blank' and `:value', `:begin', `:end', `:post-blank' and `:post-affiliated'
`:post-affiliated' keywords." properties."
(looking-at org-property-re) (looking-at org-property-re)
(let ((case-fold-search t) (let ((case-fold-search t)
(begin (point)) (begin (point))
@ -2528,9 +2521,9 @@ the buffer position at the beginning of the first affiliated
keyword and CDR is a plist of affiliated keywords along with keyword and CDR is a plist of affiliated keywords along with
their value. their value.
Return a list whose CAR is `paragraph' and CDR is a plist Return a new syntax node of `paragraph' type containing `:begin',
containing `:begin', `:end', `:contents-begin' and `:end', `:contents-begin' and `:contents-end', `:post-blank' and
`:contents-end', `:post-blank' and `:post-affiliated' keywords. `:post-affiliated' properties.
Assume point is at the beginning of the paragraph." Assume point is at the beginning of the paragraph."
(save-excursion (save-excursion
@ -2601,9 +2594,9 @@ CONTENTS is the contents of the element."
LIMIT bounds the search. LIMIT bounds the search.
Return a list whose CAR is `planning' and CDR is a plist Return a new syntax node of `planning' type containing `:closed',
containing `:closed', `:deadline', `:scheduled', `:begin', `:deadline', `:scheduled', `:begin', `:end', `:post-blank' and
`:end', `:post-blank' and `:post-affiliated' keywords." `:post-affiliated' properties."
(save-excursion (save-excursion
(let* ((case-fold-search nil) (let* ((case-fold-search nil)
(begin (point)) (begin (point))
@ -2663,11 +2656,10 @@ the buffer position at the beginning of the first affiliated
keyword and CDR is a plist of affiliated keywords along with keyword and CDR is a plist of affiliated keywords along with
their value. their value.
Return a list whose CAR is `src-block' and CDR is a plist Return a new syntax node of `src-block' type containing `:language',
containing `:language', `:switches', `:parameters', `:begin', `:switches', `:parameters', `:begin', `:end', `:number-lines',
`:end', `:number-lines', `:retain-labels', `:use-labels', `:retain-labels', `:use-labels', `:label-fmt', `:preserve-indent',
`:label-fmt', `:preserve-indent', `:value', `:post-blank' and `:value', `:post-blank' and `:post-affiliated' properties.
`:post-affiliated' keywords.
Assume point is at the beginning of the block." Assume point is at the beginning of the block."
(let ((case-fold-search t)) (let ((case-fold-search t))
@ -2791,10 +2783,9 @@ the buffer position at the beginning of the first affiliated
keyword and CDR is a plist of affiliated keywords along with keyword and CDR is a plist of affiliated keywords along with
their value. their value.
Return a list whose CAR is `table' and CDR is a plist containing Return a new syntax node of `table' type containing `:begin', `:end',
`:begin', `:end', `:tblfm', `:type', `:contents-begin', `:tblfm', `:type', `:contents-begin', `:contents-end', `:value',
`:contents-end', `:value', `:post-blank' and `:post-affiliated' `:post-blank' and `:post-affiliated' properties.
keywords.
Assume point is at the beginning of the table." Assume point is at the beginning of the table."
(save-excursion (save-excursion
@ -2855,9 +2846,9 @@ CONTENTS is a string, if table's type is `org', or nil."
(defun org-element-table-row-parser (_) (defun org-element-table-row-parser (_)
"Parse table row at point. "Parse table row at point.
Return a list whose CAR is `table-row' and CDR is a plist Return a new syntax node of `table-row' type containing `:begin',
containing `:begin', `:end', `:contents-begin', `:contents-end', `:end', `:contents-begin', `:contents-end', `:type', `:post-blank' and
`:type', `:post-blank' and `:post-affiliated' keywords." `:post-affiliated' properties."
(save-excursion (save-excursion
(let* ((type (if (looking-at "^[ \t]*|-") 'rule 'standard)) (let* ((type (if (looking-at "^[ \t]*|-") 'rule 'standard))
(begin (point)) (begin (point))
@ -2897,9 +2888,9 @@ the buffer position at the beginning of the first affiliated
keyword and CDR is a plist of affiliated keywords along with keyword and CDR is a plist of affiliated keywords along with
their value. their value.
Return a list whose CAR is `verse-block' and CDR is a plist Return a new syntax node of `verse-block' type containing `:begin',
containing `:begin', `:end', `:contents-begin', `:contents-end', `:end', `:contents-begin', `:contents-end', `:post-blank' and
`:post-blank' and `:post-affiliated' keywords. `:post-affiliated' properties.
Assume point is at beginning of the block." Assume point is at beginning of the block."
(let ((case-fold-search t)) (let ((case-fold-search t))
@ -3002,10 +2993,9 @@ Assume point is at first MARK."
(defun org-element-bold-parser () (defun org-element-bold-parser ()
"Parse bold object at point, if any. "Parse bold object at point, if any.
When at a bold object, return a list whose car is `bold' and cdr When at a bold object, return a new syntax node `bold' type containing
is a plist with `:begin', `:end', `:contents-begin' and `:begin', `:end', `:contents-begin', `:contents-end', and
`:contents-end' and `:post-blank' keywords. Otherwise, return `:post-blank' properties. Otherwise, return nil.
nil.
Assume point is at the first star marker." Assume point is at the first star marker."
(org-element--parse-generic-emphasis "*" 'bold)) (org-element--parse-generic-emphasis "*" 'bold))
@ -3021,10 +3011,10 @@ CONTENTS is the contents of the object."
(defun org-element-citation-parser () (defun org-element-citation-parser ()
"Parse citation object at point, if any. "Parse citation object at point, if any.
When at a citation object, return a list whose car is `citation' When at a citation object, return a new syntax node of `citation' type
and cdr is a plist with `:style', `:prefix', `:suffix', `:begin', containing `:style', `:prefix', `:suffix', `:begin', `:end',
`:end', `:contents-begin', `:contents-end', and `:post-blank' `:contents-begin', `:contents-end', and `:post-blank' properties.
keywords. Otherwise, return nil. Otherwise, return nil.
Assume point is at the beginning of the citation." Assume point is at the beginning of the citation."
(when (looking-at org-element-citation-prefix-re) (when (looking-at org-element-citation-prefix-re)
@ -3103,9 +3093,9 @@ CONTENTS is the contents of the object, as a string."
(defun org-element-citation-reference-parser () (defun org-element-citation-reference-parser ()
"Parse citation reference object at point, if any. "Parse citation reference object at point, if any.
When at a reference, return a list whose car is When at a reference, return a new syntax node of `citation-reference'
`citation-reference', and cdr is a plist with `:key', type containing `:key', `:prefix', `:suffix', `:begin', `:end', and
`:prefix', `:suffix', `:begin', `:end', and `:post-blank' keywords. `:post-blank' properties.
Assume point is at the beginning of the reference." Assume point is at the beginning of the reference."
(save-excursion (save-excursion
@ -3154,9 +3144,9 @@ Assume point is at the beginning of the reference."
(defun org-element-code-parser () (defun org-element-code-parser ()
"Parse code object at point, if any. "Parse code object at point, if any.
When at a code object, return a list whose car is `code' and cdr When at a code object, return a new syntax node of `code' type
is a plist with `:value', `:begin', `:end' and `:post-blank' containing `:value', `:begin', `:end' and `:post-blank' properties.
keywords. Otherwise, return nil. Otherwise, return nil.
Assume point is at the first tilde marker." Assume point is at the first tilde marker."
(org-element--parse-generic-emphasis "~" 'code)) (org-element--parse-generic-emphasis "~" 'code))
@ -3171,10 +3161,10 @@ Assume point is at the first tilde marker."
(defun org-element-entity-parser () (defun org-element-entity-parser ()
"Parse entity at point, if any. "Parse entity at point, if any.
When at an entity, return a list whose car is `entity' and cdr When at an entity, return a new syntax node of `entity' type
a plist with `:begin', `:end', `:latex', `:latex-math-p', containing `:begin', `:end', `:latex', `:latex-math-p', `:html',
`:html', `:latin1', `:utf-8', `:ascii', `:use-brackets-p' and `:latin1', `:utf-8', `:ascii', `:use-brackets-p' and `:post-blank' as
`:post-blank' as keywords. Otherwise, return nil. properties. Otherwise, return nil.
Assume point is at the beginning of the entity." Assume point is at the beginning of the entity."
(catch 'no-object (catch 'no-object
@ -3214,10 +3204,9 @@ Assume point is at the beginning of the entity."
(defun org-element-export-snippet-parser () (defun org-element-export-snippet-parser ()
"Parse export snippet at point. "Parse export snippet at point.
When at an export snippet, return a list whose car is When at an export snippet, return a new syntax node of
`export-snippet' and cdr a plist with `:begin', `:end', `export-snippet' type containing `:begin', `:end', `:back-end',
`:back-end', `:value' and `:post-blank' as keywords. Otherwise, `:value' and `:post-blank' as properties. Otherwise, return nil.
return nil.
Assume point is at the beginning of the snippet." Assume point is at the beginning of the snippet."
(save-excursion (save-excursion
@ -3258,10 +3247,10 @@ Assume point is at the beginning of the snippet."
(defun org-element-footnote-reference-parser () (defun org-element-footnote-reference-parser ()
"Parse footnote reference at point, if any. "Parse footnote reference at point, if any.
When at a footnote reference, return a list whose car is When at a footnote reference, return a new syntax node of
`footnote-reference' and cdr a plist with `:label', `:type', `footnote-reference' type containing `:label', `:type', `:begin',
`:begin', `:end', `:contents-begin', `:contents-end' and `:end', `:contents-begin', `:contents-end' and `:post-blank' as
`:post-blank' as keywords. Otherwise, return nil." properties. Otherwise, return nil."
(when (looking-at org-footnote-re) (when (looking-at org-footnote-re)
(let ((closing (with-syntax-table org-element--pair-square-table (let ((closing (with-syntax-table org-element--pair-square-table
(ignore-errors (scan-lists (point) 1 0))))) (ignore-errors (scan-lists (point) 1 0)))))
@ -3299,10 +3288,10 @@ CONTENTS is its definition, when inline, or nil."
(defun org-element-inline-babel-call-parser () (defun org-element-inline-babel-call-parser ()
"Parse inline babel call at point, if any. "Parse inline babel call at point, if any.
When at an inline babel call, return a list whose car is When at an inline babel call, return a new syntax node of
`inline-babel-call' and cdr a plist with `:call', `inline-babel-call' type containing `:call', `:inside-header',
`:inside-header', `:arguments', `:end-header', `:begin', `:end', `:arguments', `:end-header', `:begin', `:end', `:value' and
`:value' and `:post-blank' as keywords. Otherwise, return nil. `:post-blank' as properties. Otherwise, return nil.
Assume point is at the beginning of the babel call." Assume point is at the beginning of the babel call."
(save-excursion (save-excursion
@ -3358,10 +3347,10 @@ Assume point is at the beginning of the babel call."
(defun org-element-inline-src-block-parser () (defun org-element-inline-src-block-parser ()
"Parse inline source block at point, if any. "Parse inline source block at point, if any.
When at an inline source block, return a list whose car is When at an inline source block, return a new syntax node of
`inline-src-block' and cdr a plist with `:begin', `:end', `inline-src-block' type containing `:begin', `:end', `:language',
`:language', `:value', `:parameters' and `:post-blank' as `:value', `:parameters' and `:post-blank' as properties. Otherwise,
keywords. Otherwise, return nil. return nil.
Assume point is at the beginning of the inline source block." Assume point is at the beginning of the inline source block."
(save-excursion (save-excursion
@ -3403,10 +3392,9 @@ Assume point is at the beginning of the inline source block."
(defun org-element-italic-parser () (defun org-element-italic-parser ()
"Parse italic object at point, if any. "Parse italic object at point, if any.
When at an italic object, return a list whose car is `italic' and When at an italic object, return a new syntax node of `italic' type
cdr is a plist with `:begin', `:end', `:contents-begin' and containing `:begin', `:end', `:contents-begin' and `:contents-end' and
`:contents-end' and `:post-blank' keywords. Otherwise, return `:post-blank' properties. Otherwise, return nil.
nil.
Assume point is at the first slash marker." Assume point is at the first slash marker."
(org-element--parse-generic-emphasis "/" 'italic)) (org-element--parse-generic-emphasis "/" 'italic))
@ -3422,9 +3410,9 @@ CONTENTS is the contents of the object."
(defun org-element-latex-fragment-parser () (defun org-element-latex-fragment-parser ()
"Parse LaTeX fragment at point, if any. "Parse LaTeX fragment at point, if any.
When at a LaTeX fragment, return a list whose car is When at a LaTeX fragment, return a new syntax node of `latex-fragment'
`latex-fragment' and cdr a plist with `:value', `:begin', `:end', type containing `:value', `:begin', `:end', and `:post-blank' as
and `:post-blank' as keywords. Otherwise, return nil. properties. Otherwise, return nil.
Assume point is at the beginning of the LaTeX fragment." Assume point is at the beginning of the LaTeX fragment."
(catch 'no-object (catch 'no-object
@ -3477,9 +3465,9 @@ Assume point is at the beginning of the LaTeX fragment."
(defun org-element-line-break-parser () (defun org-element-line-break-parser ()
"Parse line break at point, if any. "Parse line break at point, if any.
When at a line break, return a list whose car is `line-break', When at a line break, return a new syntax node of `line-break' type
and cdr a plist with `:begin', `:end' and `:post-blank' keywords. containing `:begin', `:end' and `:post-blank' properties. Otherwise,
Otherwise, return nil. return nil.
Assume point is at the beginning of the line break." Assume point is at the beginning of the line break."
(when (and (looking-at-p "\\\\\\\\[ \t]*$") (when (and (looking-at-p "\\\\\\\\[ \t]*$")
@ -3500,11 +3488,10 @@ Assume point is at the beginning of the line break."
(defun org-element-link-parser () (defun org-element-link-parser ()
"Parse link at point, if any. "Parse link at point, if any.
When at a link, return a list whose car is `link' and cdr a plist When at a link, return a new syntax node of `link' type containing
with `:type', `:path', `:format', `:raw-link', `:application', `:type', `:path', `:format', `:raw-link', `:application',
`:search-option', `:begin', `:end', `:contents-begin', `:search-option', `:begin', `:end', `:contents-begin', `:contents-end'
`:contents-end' and `:post-blank' as keywords. Otherwise, return and `:post-blank' as properties. Otherwise, return nil.
nil.
Assume point is at the beginning of the link." Assume point is at the beginning of the link."
(catch 'no-object (catch 'no-object
@ -3672,9 +3659,9 @@ CONTENTS is the contents of the object, or nil."
(defun org-element-macro-parser () (defun org-element-macro-parser ()
"Parse macro at point, if any. "Parse macro at point, if any.
When at a macro, return a list whose car is `macro' and cdr When at a macro, return a new syntax node of `macro' type containing
a plist with `:key', `:args', `:begin', `:end', `:value' and `:key', `:args', `:begin', `:end', `:value' and `:post-blank' as
`:post-blank' as keywords. Otherwise, return nil. properties. Otherwise, return nil.
Assume point is at the macro." Assume point is at the macro."
(save-excursion (save-excursion
@ -3714,10 +3701,9 @@ Assume point is at the macro."
(defun org-element-radio-target-parser () (defun org-element-radio-target-parser ()
"Parse radio target at point, if any. "Parse radio target at point, if any.
When at a radio target, return a list whose car is `radio-target' When at a radio target, return a new syntax node of `radio-target'
and cdr a plist with `:begin', `:end', `:contents-begin', type containing `:begin', `:end', `:contents-begin', `:contents-end',
`:contents-end', `:value' and `:post-blank' as keywords. `:value' and `:post-blank' as properties. Otherwise, return nil.
Otherwise, return nil.
Assume point is at the radio target." Assume point is at the radio target."
(save-excursion (save-excursion
@ -3749,9 +3735,9 @@ CONTENTS is the contents of the object."
(defun org-element-statistics-cookie-parser () (defun org-element-statistics-cookie-parser ()
"Parse statistics cookie at point, if any. "Parse statistics cookie at point, if any.
When at a statistics cookie, return a list whose car is When at a statistics cookie, return a new syntax node of
`statistics-cookie', and cdr a plist with `:begin', `:end', `statistics-cookie' type containing `:begin', `:end', `:value' and
`:value' and `:post-blank' keywords. Otherwise, return nil. `:post-blank' properties. Otherwise, return nil.
Assume point is at the beginning of the statistics-cookie." Assume point is at the beginning of the statistics-cookie."
(save-excursion (save-excursion
@ -3779,10 +3765,10 @@ Assume point is at the beginning of the statistics-cookie."
(defun org-element-strike-through-parser () (defun org-element-strike-through-parser ()
"Parse strike-through object at point, if any. "Parse strike-through object at point, if any.
When at a strike-through object, return a list whose car is When at a strike-through object, return a new syntax node of
`strike-through' and cdr is a plist with `:begin', `:end', `strike-through' type containing `:begin', `:end', `:contents-begin'
`:contents-begin' and `:contents-end' and `:post-blank' keywords. and `:contents-end' and `:post-blank' properties. Otherwise, return
Otherwise, return nil. nil.
Assume point is at the first plus sign marker." Assume point is at the first plus sign marker."
(org-element--parse-generic-emphasis "+" 'strike-through)) (org-element--parse-generic-emphasis "+" 'strike-through))
@ -3798,10 +3784,10 @@ CONTENTS is the contents of the object."
(defun org-element-subscript-parser () (defun org-element-subscript-parser ()
"Parse subscript at point, if any. "Parse subscript at point, if any.
When at a subscript object, return a list whose car is When at a subscript object, return a new syntax node of `subscript'
`subscript' and cdr a plist with `:begin', `:end', type containing `:begin', `:end', `:contents-begin', `:contents-end',
`:contents-begin', `:contents-end', `:use-brackets-p' and `:use-brackets-p' and `:post-blank' as properties. Otherwise, return
`:post-blank' as keywords. Otherwise, return nil. nil.
Assume point is at the underscore." Assume point is at the underscore."
(save-excursion (save-excursion
@ -3837,10 +3823,10 @@ CONTENTS is the contents of the object."
(defun org-element-superscript-parser () (defun org-element-superscript-parser ()
"Parse superscript at point, if any. "Parse superscript at point, if any.
When at a superscript object, return a list whose car is When at a superscript object, return a new syntax node of
`superscript' and cdr a plist with `:begin', `:end', `superscript' type containing `:begin', `:end', `:contents-begin',
`:contents-begin', `:contents-end', `:use-brackets-p' and `:contents-end', `:use-brackets-p' and `:post-blank' as properties.
`:post-blank' as keywords. Otherwise, return nil. Otherwise, return nil.
Assume point is at the caret." Assume point is at the caret."
(save-excursion (save-excursion
@ -3875,9 +3861,9 @@ CONTENTS is the contents of the object."
(defun org-element-table-cell-parser () (defun org-element-table-cell-parser ()
"Parse table cell at point. "Parse table cell at point.
Return a list whose car is `table-cell' and cdr is a plist Return a new syntax node of `table-cell' type containing `:begin',
containing `:begin', `:end', `:contents-begin', `:contents-end' `:end', `:contents-begin', `:contents-end' and `:post-blank'
and `:post-blank' keywords." properties."
(looking-at "[ \t]*\\(.*?\\)[ \t]*\\(?:|\\|$\\)") (looking-at "[ \t]*\\(.*?\\)[ \t]*\\(?:|\\|$\\)")
(let* ((begin (match-beginning 0)) (let* ((begin (match-beginning 0))
(end (match-end 0)) (end (match-end 0))
@ -3902,9 +3888,9 @@ CONTENTS is the contents of the cell, or nil."
(defun org-element-target-parser () (defun org-element-target-parser ()
"Parse target at point, if any. "Parse target at point, if any.
When at a target, return a list whose car is `target' and cdr When at a target, return a new syntax node of `target' type containing
a plist with `:begin', `:end', `:value' and `:post-blank' as `:begin', `:end', `:value' and `:post-blank' as properties.
keywords. Otherwise, return nil. Otherwise, return nil.
Assume point is at the target." Assume point is at the target."
(save-excursion (save-excursion
@ -3939,14 +3925,13 @@ Assume point is at the target."
(defun org-element-timestamp-parser () (defun org-element-timestamp-parser ()
"Parse time stamp at point, if any. "Parse time stamp at point, if any.
When at a time stamp, return a list whose car is `timestamp', and When at a time stamp, return a new syntax node of `timestamp' type
cdr a plist with `:type', `:raw-value', `:year-start', containing `:type', `:raw-value', `:year-start', `:month-start',
`:month-start', `:day-start', `:hour-start', `:minute-start', `:day-start', `:hour-start', `:minute-start', `:year-end',
`:year-end', `:month-end', `:day-end', `:hour-end', `:month-end', `:day-end', `:hour-end', `:minute-end',
`:minute-end', `:repeater-type', `:repeater-value', `:repeater-type', `:repeater-value', `:repeater-unit',
`:repeater-unit', `:warning-type', `:warning-value', `:warning-type', `:warning-value', `:warning-unit', `:begin', `:end'
`:warning-unit', `:begin', `:end' and `:post-blank' keywords. and `:post-blank' properties. Otherwise, return nil.
Otherwise, return nil.
Assume point is at the beginning of the timestamp." Assume point is at the beginning of the timestamp."
(when (looking-at-p org-element--timestamp-regexp) (when (looking-at-p org-element--timestamp-regexp)
@ -4140,10 +4125,9 @@ Assume point is at the beginning of the timestamp."
(defun org-element-underline-parser () (defun org-element-underline-parser ()
"Parse underline object at point, if any. "Parse underline object at point, if any.
When at an underline object, return a list whose car is When at an underline object, return a new syntax node of `underline'
`underline' and cdr is a plist with `:begin', `:end', type containing `:begin', `:end', `:contents-begin' and
`:contents-begin' and `:contents-end' and `:post-blank' keywords. `:contents-end' and `:post-blank' properties. Otherwise, return nil.
Otherwise, return nil.
Assume point is at the first underscore marker." Assume point is at the first underscore marker."
(org-element--parse-generic-emphasis "_" 'underline)) (org-element--parse-generic-emphasis "_" 'underline))
@ -4159,9 +4143,9 @@ CONTENTS is the contents of the object."
(defun org-element-verbatim-parser () (defun org-element-verbatim-parser ()
"Parse verbatim object at point, if any. "Parse verbatim object at point, if any.
When at a verbatim object, return a list whose car is `verbatim' When at a verbatim object, return a new syntax node of `verbatim' type
and cdr is a plist with `:value', `:begin', `:end' and containing `:value', `:begin', `:end' and `:post-blank' properties.
`:post-blank' keywords. Otherwise, return nil. Otherwise, return nil.
Assume point is at the first equal sign marker." Assume point is at the first equal sign marker."
(org-element--parse-generic-emphasis "=" 'verbatim)) (org-element--parse-generic-emphasis "=" 'verbatim))