From 875843a4e1e279cb412c781bf60f1c12d616e553 Mon Sep 17 00:00:00 2001 From: James Ian Johnson Date: Mon, 12 Mar 2012 08:37:32 -0400 Subject: [PATCH] It was possible for a multi-citation to be ambiguous and mention a something not referenced anywhere else. Added a safeguard so that the citation hash is properly populated. original commit: 337be4a677bdbd3aeae9926fd45727944ed63d3d --- collects/scriblib/autobib.rkt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/collects/scriblib/autobib.rkt b/collects/scriblib/autobib.rkt index 086baa81..368b0375 100644 --- a/collects/scriblib/autobib.rkt +++ b/collects/scriblib/autobib.rkt @@ -51,18 +51,15 @@ (auto-bib-specific bib-entry) "")) `(autobib ,(auto-bib-key bib-entry))) - (cond [(and disambiguation - (or (pair? (cdr disambiguation)) - (and (null? (cdr disambiguation)) - ))) ;; should be a list of bib-entries with same author/date + (cond [disambiguation ;; should be a list of bib-entries with same author/date (define disambiguation* (add-between (for/list ([bib (in-list disambiguation)]) (define key (auto-bib-key bib)) (define maybe-disambiguation - (resolve-get part ri `(autobib-disambiguation key))) + (resolve-get part ri `(autobib-disambiguation ,key))) (case maybe-disambiguation [(unambiguous) #f] - [else (make-link-element #f (list maybe-disambiguation) `(autobib ,key))])) + [else (make-link-element #f maybe-disambiguation `(autobib ,key))])) ",")) (cond [(not (car disambiguation*)) '()] ;; the bib was unambiguous [else disambiguation*])]