Function: org-cite-basic--get-field

org-cite-basic--get-field is a byte-compiled function defined in oc-basic.el.gz.

Signature

(org-cite-basic--get-field FIELD ENTRY-OR-KEY &optional INFO RAW)

Documentation

Return FIELD value for ENTRY-OR-KEY, or nil.

FIELD is a symbol. ENTRY-OR-KEY is either an association list, as returned by org-cite-basic--get-entry, or a string representing a citation key.

Optional argument INFO is the export state, as a property list.

Return value may be nil or a string. If current export backend is derived from latex, return a raw string object instead, unless optional argument RAW is non-nil.

Throw an error if the field value is non-string and non-nil.

Source Code

;; Defined in /usr/src/emacs/lisp/org/oc-basic.el.gz
(defun org-cite-basic--get-field (field entry-or-key &optional info raw)
  "Return FIELD value for ENTRY-OR-KEY, or nil.

FIELD is a symbol.  ENTRY-OR-KEY is either an association list, as returned by
`org-cite-basic--get-entry', or a string representing a citation key.

Optional argument INFO is the export state, as a property list.

Return value may be nil or a string.  If current export backend is derived
from `latex', return a raw string object instead, unless optional
argument RAW is non-nil.

Throw an error if the field value is non-string and non-nil."
  (let ((value
         (cdr
          (assq field
                (pcase entry-or-key
                  ((pred stringp)
                   (org-cite-basic--get-entry entry-or-key info))
                  ((pred consp)
                   entry-or-key)
                  (_
                   (error "Wrong value for ENTRY-OR-KEY: %S" entry-or-key)))))))
    (when (and value (not (stringp value)))
      (error "Non-string bibliography field value: %S" value))
    (if (and value
             (not raw)
             (org-export-derived-backend-p (plist-get info :back-end) 'latex))
        (org-export-raw-string value)
      value)))