all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Joost Kremers <joostkremers@fastmail.fm>
To: emacs-devel@gnu.org
Subject: Allow unspecified dates in iso8601-valid-p?
Date: Mon, 04 Jul 2022 14:47:08 +0200	[thread overview]
Message-ID: <87bku5hw0p.fsf@fastmail.fm> (raw)

Hi list,

The function `iso8601-valid-p` can be used to check if a string constitutes a
valid ISO8601-formatted date. It seems that ISO8601 is a big spec with several
modifications and extensions, so I'm sure it's hardly doable to support
everything the spec allows, but I'm wondering if it would be possible to allow
unspecified dates.

The relevant spec is described here:

https://www.datafix.com.au/BASHing/2020-02-12.html

(There are several parts here, the one I'm referring to is under "Unspecified").
It explains that a capital X can be used to indicate parts of a date that are
unspecified, i.e., "20XX" for a year in the 21st century.

The reason behind this request is that `bibtex.el`, when creating a key for an
entry, checks the date field against `iso8601-valid-p` and errors out if it
finds an invalid date. Problem is that sometimes publication dates simply are
not known or cannot be given, which is exactly the kind of reason why the
unspecified date extension to ISO8601 exists.

One option would be to add an additional argument to `iso8601-valid-p` that
indicates whether to allow unspecified dates or not, but in that case,
`bibtex.el` would have to be adjusted as well.

TIA

Joost


-- 
Joost Kremers
Life has its moments



             reply	other threads:[~2022-07-04 12:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-04 12:47 Joost Kremers [this message]
2022-07-04 15:34 ` Allow unspecified dates in iso8601-valid-p? Bob Rogers
2022-07-04 16:21   ` Joost Kremers
2022-07-04 16:56     ` Stefan Monnier

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=87bku5hw0p.fsf@fastmail.fm \
    --to=joostkremers@fastmail.fm \
    --cc=emacs-devel@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.