From 54b8b4b8a1ed1dd0d88573f1d30b2fca2c08d182 Mon Sep 17 00:00:00 2001 From: Bruce D'Arcus Date: Sat, 27 Feb 2021 18:33:44 -0500 Subject: [PATCH] simplify --get-candidates --- bibtex-completion.el | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/bibtex-completion.el b/bibtex-completion.el index e901a3a..e3f4b36 100644 --- a/bibtex-completion.el +++ b/bibtex-completion.el @@ -516,22 +516,11 @@ for string replacement." for candidate in (bibtex-completion-candidates) collect (cons - ;; Here we concat the string for display with an invisible string enhanced - ;; for search, when bibtex-completion-additional-search-fields is non-nil. - (concat(bibtex-completion-format-entry candidate (1- (frame-width))) - (propertize (bibtex-completion--get-extra-search-data candidate) 'invisible t)) - (cdr (assoc "=key=" candidate))))) - -(defun bibtex-completion--get-extra-search-data (candidate) - "Return extended search metadata as string." - (if bibtex-completion-additional-search-fields - ; if the data is present, pull its value(s), join into a single string - ; TODO FIX ME, this is wrong - (format "%s" (cl-loop - for field in bibtex-completion-additional-search-fields - collect - (cdr (assoc field (cdr candidate))) - )))) + ;; Here use one string for display, and the other for search. + ;; TODO not working correctly + (concat(car (candidate))) + (propertize (bibtex-completion-format-entry candidate) 'display))) + (cdr (assoc "=key=" candidate))) (defun bibtex-completion-candidates () "Read the BibTeX files and return a list of conses, one for each entry.