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: Sat, 25 Dec 2021 17:50:10 -0500 Message-ID: <25031.40994.286546.498819@orion.rgrjr.com> References: <7c22f300-eedb-da65-db02-e82025ec2f48@cs.ucla.edu> <25023.40959.627321.685762@orion.rgrjr.com> <875yrjpp03.fsf@gnus.org> <25024.42989.718735.680188@orion.rgrjr.com> <871r26i5n0.fsf@gnus.org> <25028.53876.304365.706795@orion.rgrjr.com> <87zgoq2vwm.fsf@gnus.org> <25029.60989.564217.290743@orion.rgrjr.com> <87bl1428x5.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="420"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52209@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 25 23:51:10 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 1n1Fsb-000AUu-8F for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Dec 2021 23:51:09 +0100 Original-Received: from localhost ([::1]:50270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n1Fsa-00070g-Bo for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Dec 2021 17:51:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1FsU-00070V-Iu for bug-gnu-emacs@gnu.org; Sat, 25 Dec 2021 17:51:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56705) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n1FsU-000280-A9 for bug-gnu-emacs@gnu.org; Sat, 25 Dec 2021 17:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n1FsT-0000ZY-TB for bug-gnu-emacs@gnu.org; Sat, 25 Dec 2021 17:51:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Bob Rogers Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Dec 2021 22:51:01 +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.16404726152126 (code B ref 52209); Sat, 25 Dec 2021 22:51:01 +0000 Original-Received: (at 52209) by debbugs.gnu.org; 25 Dec 2021 22:50:15 +0000 Original-Received: from localhost ([127.0.0.1]:40018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1Frj-0000YE-9M for submit@debbugs.gnu.org; Sat, 25 Dec 2021 17:50:15 -0500 Original-Received: from rgrjr.com ([69.164.211.47]:38374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1Frg-0000Y3-N7 for 52209@debbugs.gnu.org; Sat, 25 Dec 2021 17:50:13 -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 D295B1D6BB2; Sat, 25 Dec 2021 22:50:24 +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 D3C835FE8B; Sat, 25 Dec 2021 17:50:11 -0500 (EST) In-Reply-To: <87bl1428x5.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:223124 Archived-At: From: Lars Ingebrigtsen Date: Sat, 25 Dec 2021 12:58:14 +0100 Bob Rogers writes: > I'm also looking at defining a date-parse-error condition with a > few error symbol "subclasses," but I'm wondering about the tradeoff > between having enough error symbols for precision in error > reporting vs. cluttering the code with too many. Thoughts? Having a `date-parse-error' would be fine, but I'm unsure about the utility of having a bunch of sub-errors, but perhaps you have a use case in mind? My only motivation is that I think it would make the resulting error message clearer. For example, passing a malformed ISO 8601 date to iso8601-parse just signals wrong-type-argument, which is not very helpful. Multiple errors would allow me to specify the problem in detail, while still classifying them as date/time parsing errors. Here are four that I have in mind: Unknown date/time token: X Illegal date/time value for field: , X Duplicate date/time value for field: , X Date/time value for field out of range: , X, , This doesn't quite cover the 14 calls to `error' that are in the current version of the code, in that they wouldn't be as precise, but they should be adequate. On the other hand, this might be overkill for callers of parse-date, who, being deep in their own logic, might only care that some date they have to deal with is invalid. Which is why I wanted an opinion from someone with the big picture -- I admit I am biased (and a bit annoyed) from too often having to study the code to figure out why some perfectly reasonable date I supply is being misinterpreted. -- Bob