tmalsburg / helm-bibtex

Search and manage bibliographies in Emacs
GNU General Public License v2.0
464 stars 74 forks source link

Add additional-search-fields to bibtex-completion-format-entry? #362

Closed bdarcus closed 3 years ago

bdarcus commented 3 years ago

If the bibtex-completion-additional-search-fields variable is set (say to include tags), should not bibtex-completion-format-entry add the field(s) to its output?

bibtex-completion-candidates does include the additional fields, so I was expecting that to carry through with the formatted output.

Bottom line, for #361 or #355, how do we include the additional field(s) in the string that gets completed against?

tmalsburg commented 3 years ago

should not bibtex-completion-format-entry add the field(s) to its output?

Some users like to be able to search for the content of some fields without having them clutter the list of entries. For instance, you may want to include abstracts in the search but you likely don't want abstracts in list of entries. If you'd like to change the visual presentation, you can do this using the configuration variable bibtex-completion-display-formats.

tmalsburg commented 3 years ago

Bottom line, for #361 or #355, how do we include the additional field(s) in the string that gets completed against?

I'm not sure I understand this question: bibtex-completion-candidates gives you a list of entries that also include the additional search fields. So you have to somehow include them in the search. Not sure how to do this with completing-read / embark et al., sorry.

bdarcus commented 3 years ago

OIC, so for example, in helm-bibtex, you are using bibtex-completion-candidates to search against?

tmalsburg commented 3 years ago

See the output of this code: (car (bibtex-completion-candidates)). It's a cons cell where the first element is a string used for matching (but this string is never displayed) and the second element is the entry (alist) which is later used to prepare the entry for presentation in the list.

bdarcus commented 3 years ago

Thank you!