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
This commit is contained in:
James Ian Johnson 2012-03-12 08:37:32 -04:00 committed by Sam Tobin-Hochstadt
parent ca961ce44b
commit 875843a4e1

View File

@ -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*])]