Skip to content

Commit

Permalink
discard note and pdf fields of cross-referenced entries
Browse files Browse the repository at this point in the history
  • Loading branch information
ericdanan committed Nov 2, 2017
1 parent 54de085 commit 0af134c
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions bibtex-completion.el
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,13 @@ reparsed whereas the other files in FILES were up-to-date."
;; Insert an empty field so we can discard the crossref info if needed:
(append entry
(cl-acons "" ""
(gethash (downcase crossref) entry-hash))))
(cl-remove-if
(lambda (field)
(member (car field)
'("has-note="
"=has-pdf="
bibtex-completion-pdf-field)))
(gethash (downcase crossref) entry-hash)))))
entry))))
else
;; The file was not reparsed.
Expand All @@ -535,8 +541,14 @@ reparsed whereas the other files in FILES were up-to-date."
;; Discard crossref info and resolve crossref again:
(append (--take-while (> (length (car it)) 0) entry-alist)
(cl-acons "" ""
(gethash (downcase crossref) entry-hash)))))
entry)))))
(cl-remove-if
(lambda (field)
(member (car field)
'("has-note="
"=has-pdf="
bibtex-completion-pdf-field)))
(gethash (downcase crossref) entry-hash)))))
entry))))))

(defun bibtex-completion-make-entry-hash (files reparsed-files)
"Return a hash table of all potentially cross-referenced bibliography entries in FILES,
Expand Down

0 comments on commit 0af134c

Please sign in to comment.