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 list whose car is citation-reference, and cdr is a plist with :key,
:prefix, :suffix, :begin, :end, and :post-blank keywords.

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 list whose car is
`citation-reference', and cdr is a plist with `:key',
`:prefix', `:suffix', `:begin', `:end', and `:post-blank' keywords.

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 (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
                (list 'citation-reference
		      (list :key key
			    :begin begin
			    :end end
			    :post-blank 0))))
	  (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)))))