Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
malb committed Jan 12, 2024
1 parent 7262e38 commit f17aa81
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions bibtex-completion.el
Original file line number Diff line number Diff line change
Expand Up @@ -681,27 +681,28 @@ Also do some preprocessing of the entries.
If HT-STRINGS is provided it is assumed to be a hash table."
(goto-char (point-min))
(cl-loop
with fields = (append '("title" "crossref")
(-map (lambda (it) (if (symbolp it) (symbol-name it) it))
bibtex-completion-additional-search-fields))
for entry-type = (parsebib-find-next-item)
while entry-type
unless (member-ignore-case entry-type '("preamble" "string" "comment"))
collect (let* ((entry (substring-no-properties
(parsebib-read-entry entry-type (point) ht-strings nil
bibtex-completion-replace-tex)))
(fields (append
(list (if (assoc-string "author" entry 'case-fold)
"author"
"editor")
(if (assoc-string "date" entry 'case-fold)
"date"
"year"))
fields)))
(-map (lambda (it)
(cons (downcase (car it)) (cdr it)))
(bibtex-completion-prepare-entry entry fields)))))
(cl-letf (((symbol-function 'parsebib--convert-tex-italics) (lambda (str) str))
((symbol-function 'parsebib--convert-tex-bold) (lambda (str) str)))
(cl-loop
with fields = (append '("title" "crossref")
(-map (lambda (it) (if (symbolp it) (symbol-name it) it))
bibtex-completion-additional-search-fields))
for entry-type = (parsebib-find-next-item)
while entry-type
unless (member-ignore-case entry-type '("preamble" "string" "comment"))
collect (let* ((entry (parsebib-read-entry entry-type (point) ht-strings nil
bibtex-completion-replace-tex))
(fields (append
(list (if (assoc-string "author" entry 'case-fold)
"author"
"editor")
(if (assoc-string "date" entry 'case-fold)
"date"
"year"))
fields)))
(-map (lambda (it)
(cons (downcase (car it)) (cdr it)))
(bibtex-completion-prepare-entry entry fields))))))

(defun bibtex-completion-get-entry (entry-key)
"Given a BibTeX key this function scans all bibliographies listed in `bibtex-completion-bibliography' and returns an alist of the record with that key.
Expand Down

0 comments on commit f17aa81

Please sign in to comment.