Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add citar-select-multiple option #493

Merged
merged 1 commit into from
Dec 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion citar.el
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,12 @@ of all citations in the current buffer."

;;; Completion functions

(defcustom citar-select-multiple t
"Use `completing-read-multiple' for selecting citation keys.
When nil, all citar commands will use `completing-read`."
:type 'boolean
:group 'citar)

(defun citar--completion-table (candidates &optional filter)
"Return a completion table for CANDIDATES.

Expand Down Expand Up @@ -378,7 +384,7 @@ FILTER: if non-nil, should be a predicate function taking
(completions (citar--completion-table candidates filter))
(embark-transformer-alist (citar--embark-transformer-alist candidates))
(crm-separator "\\s-*&\\s-*")
(chosen (if multiple
(chosen (if (and multiple citar-select-multiple)
(completing-read-multiple "References: " completions nil nil nil
'citar-history citar-presets nil)
(completing-read "Reference: " completions nil nil nil
Expand Down