Function: org-export-search-cells
org-export-search-cells is a byte-compiled function defined in
ox.el.gz.
Signature
(org-export-search-cells DATUM)
Documentation
List search cells for element or object DATUM.
A search cell follows the pattern (TYPE . SEARCH) where
TYPE is a symbol among headline, custom-id, target and
other.
SEARCH is the string a link is expected to match. More
accurately, it is
- headline's title, as a list of strings, if TYPE is
headline.
- CUSTOM_ID value, as a string, if TYPE is custom-id.
- target's or radio-target's name as a list of strings if
TYPE is target.
- NAME or RESULTS affiliated keyword if TYPE is other.
A search cell is the internal representation of a fuzzy link. It ignores case, white spaces, and statistics cookies, if applicable.
Source Code
;; Defined in /usr/src/emacs/lisp/org/ox.el.gz
(defun org-export-search-cells (datum)
"List search cells for element or object DATUM.
A search cell follows the pattern (TYPE . SEARCH) where
TYPE is a symbol among `headline', `custom-id', `target' and
`other'.
SEARCH is the string a link is expected to match. More
accurately, it is
- headline's title, as a list of strings, if TYPE is
`headline'.
- CUSTOM_ID value, as a string, if TYPE is `custom-id'.
- target's or radio-target's name as a list of strings if
TYPE is `target'.
- NAME or RESULTS affiliated keyword if TYPE is `other'.
A search cell is the internal representation of a fuzzy link. It
ignores case, white spaces, and statistics cookies, if applicable."
(pcase (org-element-type datum)
(`headline
(let ((title (mapcar #'upcase
(split-string
(replace-regexp-in-string
"\\[[0-9]*\\(?:%\\|/[0-9]*\\)\\]" " "
(org-element-property :raw-value datum))))))
(delq nil
(list
(cons 'headline title)
(cons 'other title)
(let ((custom-id (org-element-property :custom-id datum)))
(and custom-id (cons 'custom-id custom-id)))))))
(`target
(list (cons 'target
(mapcar #'upcase
(split-string (org-element-property :value datum))))))
((and (let name (or (org-element-property :name datum)
(car (org-element-property :results datum))))
(guard name))
(list (cons 'other (split-string name))))
(_ nil)))