Subject: bug#44597: 26.3; bibtex should allow reverse sorting

From: Francesco Potortì <[email-masked]>
Date: Sat, 19 Dec 2020 11:37:12 +0100

>> In my use case, I needed to sort about 100 bibtex entries in
>> reversed date order, without any more criterion, and I had to
>> resort to an external tool.  The reason was that i had to
>> participate to a career selection where people was asked to
>> provide a list of their own papers listed in reverse chronological
>> order.
>> 
>> I had no need for a secondary sort key, so if I could just do that
>> with bibtex.el it would have saved my day.
>
>I believe in the usual world of BibTeX, this is a rather unique
>situation.

In the end I managed to use bibtex2html, which only sorting options
other than the default are --sort-by-date and --reverse-sort.  I think
that sorting by date should not be thought of as unique, on the opposite
I'd see it as quite natural.

Whether I want to create an academic CV or the list of papers I read in
the past and found interesting, sorting by date would be one of the few
obvious generic choices, most of the rest being a matter of personal
requirements.

Even when you look up bibliographic databases, sorting by date is always
a possible option, usually the default one (in reverse mode).

>Actually, I just thought of a pretty cheap very different solution
>for your problem, which is to regenerate the keys for your entries
>such that the existing standard "sort by keys" approach gives you
>whatever you need.

That would not have worked for me.  I want to keep my key as they are,
as I reference them elsewhere in many documents.  I think this is the
normal approach.

>The autokey algorithm for generating the keys is
>pretty powerful and easy to customize beyond the default.

That's good if you often add lots of new documents.  My case is that of
long-term, slowly-growing bibliographies which occasionally may be need
to be sorted differently and whose keys need to be persistent.  I think
this is the usual case for a personal bibliography.

>> Again, that depends on the use case.  I am sure my patch can be useful
>> even without a secondary sorting key and without a day being
>> specified.
>
>I believe we try here to predict and comment on rare scenarios which
>is rather difficult.

I don't know why you think that sorting by date would be so unusual.
Unless you have a personal reason to generate and sort keys in some
specific way, date is the most obvious sorting key you can think of.

> https://www.emacswiki.org/emacs/BibTeX
>
>because I thought people might like to use it to collect code
>snippets beyond the default.  It was last updated in 2014.
>So it seems to me this is not an urgent matter.

Sure.  Also I think that bibtex is not much used, in fact.