GNU bug report logs - #36252
26.1; bibtex-generate-autokey does not use use date field

Previous Next

Package: emacs;

Reported by: Ryan Kavanagh <rak <at> debian.org>

Date: Sun, 16 Jun 2019 20:24:01 UTC

Severity: minor

Tags: moreinfo

Found in version 26.1

Done: "Roland Winkler" <winkler <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #39 received at 36252 <at> debbugs.gnu.org (full text, mbox):

From: Patrick M. Niedzielski <patrick <at> pniedzielski.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Ryan Kavanagh <rak <at> debian.org>
Cc: 36252 <at> debbugs.gnu.org
Subject: Re: bug#36252: 26.1; bibtex-generate-autokey does not use use date
 field
Date: Sat, 05 Dec 2020 09:20:52 +0000
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> skribis:
> Lars Ingebrigtsen <larsi <at> gnus.org> writes: 
> 
> This was five weeks ago, and there was no response, so I'm 
> closing this bug report.  If progress can be made here, please 
> respond to the debbugs mail address, and we'll reopen the bug 
> report. 

I’d like to reopen this bug, and submit the attached patch which I 
believe fixes the issue. This patch teaches 
‘bibtex-generate-autokey’ to prefer an ISO8601-formatted ‘date’ 
field when present, and fall back to a ‘year’, and is implemented 
using Lars’ ISO8601 parsing functions.

Just some implementation notes: I don’t believe Ryan’s original 
patch works as documented when ‘bibtex-autokey-use-crossref’ is 
non-nil.  In this case, his patch would seem to prefer a 
crossref’d entry’s ‘year’ field to a local entry’s ‘date’ field. 
More concretely, with the following BibLaTeX,

 @misc{doe1995some,
   title = {Some work},
   author = {John Doe},
   year = {1995},
   date = {1995-01-01},
 } 

 @misc{,
   title = {Another work},
   author = {Anon Y. Mous},
   date = {1990-03-12},
   crossref = {entry1},
 }

When generating a key for entry2, the original patch would prefer 
using the year 1995 to the year 1990, which is unintuitive. The 
attached patch implements a different behavior instead, in which 
an entry’s own ‘year/date’ field are prefered to the crossref’d 
entry’s ‘year/date’ field. In the above case, 
‘bibtex-generate-autokey’ will generate a entry key with the year 
1990 rather than 1995.

Additionally, we prefer to use the ‘date’ field when present over 
the ‘year’ field. This behavior is probably more correct, since 
BibLaTeX deprecated the ‘year’ field in favor of its own ‘date’ 
field, which only should occur in BibLaTeX-flavor files. Note that 
this is a breaking change from the prior behavior, but only when 
an entry has incompatible ‘date’ and ‘year’ fields.  If a file is 
meant to support both BibTeX and BibLaTeX, the ‘date’ and ‘year’ 
fields should contain the same information.

The attached patch implements the above behavior.

Best,
Patrick

[0001-Prefer-date-field-to-year-field-in-BibTex-entry.patch (text/x-diff, attachment)]

This bug report was last modified 4 years and 218 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.