From 0af134c4c8bdff944838005dfe95a0e25d019d17 Mon Sep 17 00:00:00 2001 From: Eric Danan Date: Thu, 2 Nov 2017 22:42:33 +0100 Subject: [PATCH] discard note and pdf fields of cross-referenced entries --- bibtex-completion.el | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/bibtex-completion.el b/bibtex-completion.el index cac8f3e..dd1c6c8 100644 --- a/bibtex-completion.el +++ b/bibtex-completion.el @@ -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. @@ -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,