Function: org-element-citation-reference-parser

org-element-citation-reference-parser is a byte-compiled function defined in org-element.el.gz.

Signature

(org-element-citation-reference-parser)

Documentation

Parse citation reference object at point, if any.

When at a reference, return a new syntax node of citation-reference type containing :key, :prefix, :suffix, :begin, :end, and
:post-blank properties.

Assume point is at the beginning of the reference.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-element.el.gz
;;;; Citation Reference

(defun org-element-citation-reference-parser ()
  "Parse citation reference object at point, if any.

When at a reference, return a new syntax node of `citation-reference'
type containing `:key', `:prefix', `:suffix', `:begin', `:end', and
`:post-blank' properties.

Assume point is at the beginning of the reference."
  (save-excursion
    (let ((begin (point)))
      (when (re-search-forward org-element-citation-key-re nil t)
        (let* ((key (org-element--get-cached-string
                     (match-string-no-properties 1)))
	       (key-start (match-beginning 0))
	       (key-end (match-end 0))
	       (separator (search-forward ";" nil t))
               (end (or separator (point-max)))
               (suffix-end (if separator (1- end) end))
               (types (org-element-restriction 'citation-reference))
	       (reference
                (org-element-create
                 'citation-reference
		 (list :key key
		       :begin begin
		       :end end
		       :post-blank 0
                       :secondary (alist-get
                                   'citation-reference
                                   org-element-secondary-value-alist)))))
	  (when (< begin key-start)
	    (org-element-put-property
	     reference :prefix
             (org-element--parse-objects begin key-start nil types reference)))
	  (when (< key-end suffix-end)
	    (org-element-put-property
	     reference :suffix
             (org-element--parse-objects key-end suffix-end nil types reference)))
	  reference)))))