GNU bug report logs - #44597
26.3; bibtex should allow reverse sorting

Previous Next

Package: emacs;

Reported by: Francesco Potortì <pot <at> gnu.org>

Date: Thu, 12 Nov 2020 18:31:02 UTC

Severity: normal

Found in version 26.3

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Francesco Potortì <pot <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 44597 <at> debbugs.gnu.org
Subject: bug#44597: 26.3; bibtex should allow reverse sorting
Date: Sat, 14 Nov 2020 18:31:18 +0100
>> I wish bibtex mode would allow for reverse sorting of entries.
>>
>> Some years ago I used to obtain that behaviour by advising the sort-subr
>> functions when called inside a bibtex-mode buffer.  No more.
>>
>> The modern bibtex.el sorts an entry when bibtex-clean-entry is called
>> when bibtex-maintain-sorted-entries is t without calling sort-subr, but
>> relying only on bibtex-lessp, which is not easy to advice.
>
>I haven't looked at the code closely, but wouldn't advising bibtex-lessp
>to just swap the parameters work?

Yes.  In fact, after writing my bug report I looked at the code again
and I did just that :)

However, I think that reversing the sorting order is just the most
common of various criteria that one would like to use for sorting.
Recently I had a reason for getting one hundred bibtex entries sorted by
date in reverse order, a task that would take a long time by hand,
especially in front of frequent modifications of the list of entries to
be sorted.

Fortunately I was able to use bibtex2html to do the job, but the most
natural thing would have been to use bibtex.el with a proper sorting
function.  Ideally, bibtex.el should provide a hook where one can
install any function for sorting.  The hook should get some arguments
(the type of entry, the name of entry, the date, a bibtex custom field
and maybe others).  That would make bibtex.el more generally flexible.




This bug report was last modified 2 years and 200 days ago.

Previous Next


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