From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bob Rogers Newsgroups: gmane.emacs.bugs Subject: bug#52209: 28.0.60; [PATCH] date-to-time fails on pure dates Date: Mon, 20 Dec 2021 10:57:33 -0500 Message-ID: <25024.42989.718735.680188@orion.rgrjr.com> References: <7c22f300-eedb-da65-db02-e82025ec2f48@cs.ucla.edu> <25023.40959.627321.685762@orion.rgrjr.com> <875yrjpp03.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1793"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Katsumi Yamaoka , Paul Eggert , 52209@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 20 19:59:04 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1mzNsF-0000DP-UK for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Dec 2021 19:59:03 +0100 Original-Received: from localhost ([::1]:55882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzNsE-00078O-Qv for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Dec 2021 13:59:02 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzL39-00029s-Bs for bug-gnu-emacs@gnu.org; Mon, 20 Dec 2021 10:58:09 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39646) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mzL35-0007Hq-91 for bug-gnu-emacs@gnu.org; Mon, 20 Dec 2021 10:58:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mzL34-0004Jr-5C for bug-gnu-emacs@gnu.org; Mon, 20 Dec 2021 10:58:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Bob Rogers Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Dec 2021 15:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52209 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 52209-submit@debbugs.gnu.org id=B52209.164001586116565 (code B ref 52209); Mon, 20 Dec 2021 15:58:02 +0000 Original-Received: (at 52209) by debbugs.gnu.org; 20 Dec 2021 15:57:41 +0000 Original-Received: from localhost ([127.0.0.1]:51192 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzL2i-0004J7-O1 for submit@debbugs.gnu.org; Mon, 20 Dec 2021 10:57:40 -0500 Original-Received: from rgrjr.com ([69.164.211.47]:36416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzL2f-0004Ip-17 for 52209@debbugs.gnu.org; Mon, 20 Dec 2021 10:57:39 -0500 Original-Received: from rgrjr.com (c-73-16-206-7.hsd1.ma.comcast.net [73.16.206.7]) by rgrjr.com (Postfix on openSUSE) with ESMTP id A59831D6BB2; Mon, 20 Dec 2021 15:57:48 +0000 (UTC) Original-Received: from orion.rgrjr.com (orion.rgrjr.com [192.168.0.3]) by scorpio.rgrjr.com (Postfix on openSUSE GNU/Linux) with ESMTP id 595845FE4D; Mon, 20 Dec 2021 10:57:35 -0500 (EST) In-Reply-To: <875yrjpp03.fsf@gnus.org> X-Mailer: VM 7.19 under Emacs 29.0.50 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:222798 Archived-At: From: Lars Ingebrigtsen Date: Mon, 20 Dec 2021 11:08:44 +0100 Bob Rogers writes: > Since Emacs time functions have evolved well beyond email, I would argue > that even "rfc-email-" is too specific a prefix for them. So if this > patch is not suitable, maybe it's (cough, cough) time for a new time and > date parsing API that supports a broader range of human-generated dates > and times, with better error handling and I18N support. WDYT? Yes, I think we should stop futzing around with `parse-time-string' and instead create a new well-defined library with a signature like: (parse-time "2020-01-15T16:12:21-08:00" 'iso-8601) (parse-time "1/4-2" 'us-date) (parse-time "Wed, 15 Jan 2020 16:12:21 -0800" 'rfc822) etc. (And yes, I know the latter is a superseded standard, but it's the one people know.) I can see that it's a good idea to have an explicit hint that the date is in rfc822 format since a two-digit year (which parse-time-string still supports) might otherwise be misinterpreted as something else. And perhaps two-digit years this far into the century should otherwise be disallowed. Otherwise, I think the other date formats would be pretty easy to recognize, with the exception of month-day order in numeric dates, which ought to be possible to disambiguate via locale. (Though I admit I have no experience with locale programming.) On the other hand, I can imagine the caller might want to insist that the passed string must be in a certain format and force an error if parse-time finds otherwise. One question: Did you have in mind that parse-time should have the same return value as parse-time-string, in order to feed into the other Emacs time functions? -- Bob