Function: org-cite-basic--complete-key
org-cite-basic--complete-key is a byte-compiled function defined in
oc-basic.el.gz.
Signature
(org-cite-basic--complete-key &optional MULTIPLE)
Documentation
Prompt for a reference key and return a citation reference string.
When optional argument MULTIPLE is non-nil, prompt for multiple keys, until one of them is nil. Then return the list of reference strings selected.
Raise an error when no bibliography is set in the buffer.
Source Code
;; Defined in /usr/src/emacs/lisp/org/oc-basic.el.gz
(defun org-cite-basic--complete-key (&optional multiple)
"Prompt for a reference key and return a citation reference string.
When optional argument MULTIPLE is non-nil, prompt for multiple
keys, until one of them is nil. Then return the list of
reference strings selected.
Raise an error when no bibliography is set in the buffer."
(let* ((table
(or (org-cite-basic--key-completion-table)
(user-error "No bibliography set")))
(prompt
(lambda (text)
(completing-read text table nil t))))
(if (null multiple)
(let ((key (gethash (funcall prompt "Key: ") table)))
(org-string-nw-p key))
(let* ((keys nil)
(build-prompt
(lambda ()
(if keys
(format "Key (empty input exits) %s: "
(mapconcat #'identity (reverse keys) ";"))
"Key (empty input exits): "))))
(let ((key (funcall prompt (funcall build-prompt))))
(while (org-string-nw-p key)
(push (gethash key table) keys)
(setq key (funcall prompt (funcall build-prompt)))))
keys))))