unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Roland Winkler" <winkler@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 44597@debbugs.gnu.org
Subject: bug#44597: 26.3; bibtex should allow reverse sorting
Date: Sat, 12 Dec 2020 10:09:37 -0600	[thread overview]
Message-ID: <60225.35392.490825.24532@gargle.gargle.HOWL> (raw)
In-Reply-To: <87pn3lkay5.fsf@gnus.org>

On Mon Dec 7 2020 Lars Ingebrigtsen wrote:
> I've added Roland to the Cc's; I'm guessing he'll have some
> comments.

I am not sure the proposed patch is the best way to go.  Suppose a
BibTeX file contains just several dozen entries per year of
publication.  Then sorting by date becomes meaningful only if the
date for each entry includes not only year and month, but also the
day.  I assume that's why the proposed patch also uses a `day'
field.  But such a field is not standard for BibTeX entries, and I
am not aware of any "default" mechanisms to support it.  I guess you
maintain such a field by hand in your BibTeX database.  I am not
sure it makes sense for BibTeX mode to go in such a direction with
hard-coded hand-crafted solutions, where likely the next user wants
to do things just a little different.

How about instead a new customizable sorting scheme, where the value
of bibtex-maintain-sorted-entries is a cons pair

  (INDEX-FUN . PREDICATE)

where INDEX-FUN is a user-defined function that replaces
bibtex-entry-index, and PREDICATE is a user-defined function that
replaces the default predicate bibtex-lessp.  Then users can define
custom sorting schemes to their liking, where PREDICATE sorts the
entries based on the return values of INDEX-FUN.





  parent reply	other threads:[~2020-12-12 16:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-12 18:30 bug#44597: 26.3; bibtex should allow reverse sorting Francesco Potortì
2020-11-14 16:41 ` Lars Ingebrigtsen
2020-11-14 17:31   ` Francesco Potortì
2020-11-16 21:31     ` Lars Ingebrigtsen
2020-12-06 16:16       ` Francesco Potortì
2020-12-07 13:22         ` Lars Ingebrigtsen
2020-12-07 18:00           ` Francesco Potortì
2020-12-09 14:20             ` Roland Winkler
2020-12-09  9:59           ` Francesco Potortì
2020-12-09 12:59             ` Lars Ingebrigtsen
2020-12-12 16:09           ` Roland Winkler [this message]
2020-12-13 16:57             ` Francesco Potortì
2020-12-18 22:48               ` Roland Winkler
2020-12-19  0:16                 ` Francesco Potortì
2020-12-19  5:05                   ` Roland Winkler
2020-12-19 10:37                     ` Francesco Potortì
2022-12-30  6:29                     ` Roland Winkler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=60225.35392.490825.24532@gargle.gargle.HOWL \
    --to=winkler@gnu.org \
    --cc=44597@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).