From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.devel Subject: Allow unspecified dates in iso8601-valid-p? Date: Mon, 04 Jul 2022 14:47:08 +0200 Message-ID: <87bku5hw0p.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19205"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.8.3; emacs 28.1.90 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jul 04 15:32:13 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o8MBO-0004iT-Rq for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Jul 2022 15:32:12 +0200 Original-Received: from localhost ([::1]:33698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8MBN-0003j7-CT for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Jul 2022 09:32:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59718) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8Lhu-0006Dj-D2 for emacs-devel@gnu.org; Mon, 04 Jul 2022 09:01:54 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:51491) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8Lhq-00085O-W0 for emacs-devel@gnu.org; Mon, 04 Jul 2022 09:01:42 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 0E2F95C00AF for ; Mon, 4 Jul 2022 09:01:36 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 04 Jul 2022 09:01:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to; s=fm3; t= 1656939695; x=1657026095; bh=sTUA4hhxqpbvEt6ulOPdCwaRzklLfQ94pcL QhdOgItw=; b=r3HE6Nz/4LtENHWSo+AuboxzlZshOSY1ul/q+c8ZaeCYdM4FOy9 qLSj3mQtGOrjjJNbcHxaVMqikpOn9Yfs7UGCCG0ImoBLe4N8ewOc0GdT1Rf1P1mo r5JtDIRY5lGqQtJQcV3iZV/rFr7t1nET0dWQaY/bG0YXqTWrvrDBLsgNSw+e6h+E NSceUBtISLzD/EC/lp/+xgU12FzD7/D0OlDMq/+emvoF+9k45ZpTceLGK3J0X3s7 yuTEWU963qNxaUmqfF4SoBzIhVg2176GUFrlJAB7d1EF8DpFmZv1GTX+xjQfeQzc ml1ScCHgd84kFJZXHrboLJzFCw8u3zzVJwQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:message-id:mime-version :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1656939695; x= 1657026095; bh=sTUA4hhxqpbvEt6ulOPdCwaRzklLfQ94pcLQhdOgItw=; b=o ZI8nzWWT286q6aOn3ORBLlAWiIk/OAupJsIphaN+4cNOQ7+5bontw6mD+H/DizKU sYVB08O4QyQZQAc5lG9QyRWRZM3nFN1F1wpJKTCjwgAyrXllzt6TNJQegmvSvuyG gejoto/xop9ZtsPTov9N7Un7aJ7MAMmAlvBxGc/gmEQeIqED+fHQmoGQeKpQh6s1 RQkWEpBdkhOkZP00hoAajNWr6Gi1dy2Eh6cqtUZt9LNX2uxaRgh84JqqrGweqE2I HBq9ucQzGlvZ7cSmjIucntnUB97Yp9w4PPD3q8fcR6XzmxBpYnj53GKZ+EqtYNTE RXk8r6XD8IRlN8z8kYD3A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudehledgheekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpegfhffvufffkfggtgesthdtredttd ertdenucfhrhhomheplfhoohhsthcumfhrvghmvghrshcuoehjohhoshhtkhhrvghmvghr shesfhgrshhtmhgrihhlrdhfmheqnecuggftrfgrthhtvghrnhepueduheeuvdegtdehie dttdegueetveefgeejhfekteegteelvefhieevvedthedtnecuffhomhgrihhnpegurght rghfihigrdgtohhmrdgruhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehjohhoshhtkhhrvghmvghrshesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Feedback-ID: ie15541ac:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 4 Jul 2022 09:01:28 -0400 (EDT) Received-SPF: pass client-ip=66.111.4.29; envelope-from=joostkremers@fastmail.fm; helo=out5-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:291823 Archived-At: 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