commit 875843a4e1e279cb412c781bf60f1c12d616e553
parent ca961ce44b5295cdede4d5db663a973f767c8877
Author: James Ian Johnson <ianj@moonpatrol.ccs.neu.edu>
Date: Mon, 12 Mar 2012 08:37:32 -0400
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
Diffstat:
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git 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*])]