Skip to content

Commit

Permalink
Add backend defvar to define --read function
Browse files Browse the repository at this point in the history
  • Loading branch information
bdarcus committed Mar 1, 2021
1 parent 3dbbd8d commit 5754c3d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bibtex-completion.el
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ Only entries of these types are checked in order to resolve
cross-references. The default list is usually sufficient; adding
more types can slow down resolution for large biblioraphies.")

(defvar bibtex-completion-read-backend 'bibtex-completion--completing-read
"The function called by bibtex-completion--read to return a set of keys.")

(defvar bibtex-completion-display-formats-internal nil
"Stores `bibtex-completion-display-formats' together with the \"used width\" of each format string.
This is set internally.")
Expand All @@ -380,7 +383,6 @@ bibliography file is reparsed.")
(defvar bibtex-completion-string-hash-table nil
"A hash table used for string replacements.")


(defun bibtex-completion-normalize-bibliography (&optional type)
"Return a list of bibliography file(s) in `bibtex-completion-bibliography'.
If there are org mode bibliography-files, their corresponding
Expand Down Expand Up @@ -497,7 +499,8 @@ for string replacement."
(defun bibtex-completion--read ()
"Select BibTeX entries in completion system."
;; define a completion function that defaults to completing-read, but can be overridden
(list (bibtex-completion--completing-read)))
(list (funcall bibtex-completion-read-backend)))
;; (list (bibtex-completion--completing-read)))

(defun bibtex-completion--completing-read ()
"Read bibtex-completion entries for completion using completing-read."
Expand Down

0 comments on commit 5754c3d

Please sign in to comment.