all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Francesco Potortì" <pot@gnu.org>
To: "Roland Winkler" <winkler@gnu.org>
Cc: 44597@debbugs.gnu.org, Lars Ingebrigtsen <larsi@gnus.org>
Subject: bug#44597: 26.3; bibtex should allow reverse sorting
Date: Sun, 13 Dec 2020 17:57:32 +0100	[thread overview]
Message-ID: <E1koUge-000QwB-NV@tucano.isti.cnr.it> (raw)
In-Reply-To: <60225.35392.490825.24532@gargle.gargle.HOWL> (winkler@gnu.org)

>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.

The bibtex-get-date function in my patch does not assume that the "day"
field is present.  When it is missing, it uses the first day of the
month, or day 30 if the LATEST argument is t.

By the way, there is an error in my patch: it shuld be "day", not
"days".

>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.

As far as I can tell, "date" and "day" are sometimes used even if not
standard.  Anyway, if any of "date" or "day" are present, the patch will
use them, else it will use what's available.

I personally use "day" to keep track of the dates of congresses (for
@inproceedings).

>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.

That would be certainly more flexible.  However I think it is at least
equally important to provide some precooked solutions.  I myself would
have spared some work some months ago if I had the 'reverse and
'reversedate methods available.





  reply	other threads:[~2020-12-13 16:57 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
2020-12-13 16:57             ` Francesco Potortì [this message]
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

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

  git send-email \
    --in-reply-to=E1koUge-000QwB-NV@tucano.isti.cnr.it \
    --to=pot@gnu.org \
    --cc=44597@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=winkler@gnu.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.