unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Bob Rogers <rogers-emacs@rgrjr.homedns.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 52209@debbugs.gnu.org
Subject: bug#52209: 28.0.60; [PATCH] date-to-time fails on pure dates
Date: Sat, 25 Dec 2021 17:50:10 -0500	[thread overview]
Message-ID: <25031.40994.286546.498819@orion.rgrjr.com> (raw)
In-Reply-To: <87bl1428x5.fsf@gnus.org>

   From: Lars Ingebrigtsen <larsi@gnus.org>
   Date: Sat, 25 Dec 2021 12:58:14 +0100

   Bob Rogers <rogers-emacs@rgrjr.homedns.org> 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: <field>, X
	Duplicate date/time value for field: <field>, X
	Date/time value for field out of range: <field>, X, <min>, <max>

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





  reply	other threads:[~2021-12-25 22:50 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30 20:55 bug#52209: 28.0.60; [PATCH] date-to-time fails on pure dates Bob Rogers
2021-12-01  4:17 ` Lars Ingebrigtsen
2021-12-03  5:19   ` Katsumi Yamaoka
2021-12-03 16:29     ` Lars Ingebrigtsen
2021-12-03 18:38     ` Michael Heerdegen
2021-12-04 18:58 ` Paul Eggert
2021-12-19 21:11   ` Bob Rogers
2021-12-20 10:08     ` Lars Ingebrigtsen
2021-12-20 15:57       ` Bob Rogers
2021-12-20 16:34         ` Bob Rogers
2021-12-21 11:01         ` Lars Ingebrigtsen
2021-12-23 19:48           ` Bob Rogers
2021-12-24  9:29             ` Lars Ingebrigtsen
2021-12-24 15:58               ` Bob Rogers
2021-12-25 11:58                 ` Lars Ingebrigtsen
2021-12-25 22:50                   ` Bob Rogers [this message]
2021-12-26 11:31                     ` Lars Ingebrigtsen
2021-12-28 15:52                       ` Bob Rogers
2021-12-29 15:19                         ` Lars Ingebrigtsen
2021-12-29 19:29                           ` Paul Eggert
2021-12-29 22:01                             ` Bob Rogers
2021-12-30  5:32                               ` Bob Rogers
2021-12-30 21:08                           ` Bob Rogers
2022-01-01 14:47                             ` Lars Ingebrigtsen
2022-01-01 14:56                               ` Andreas Schwab
2022-01-02  0:41                                 ` Bob Rogers
2022-01-03 11:34                                   ` Lars Ingebrigtsen
2022-01-04  4:45                                     ` Bob Rogers
2022-01-05 15:46                                       ` Lars Ingebrigtsen
2022-01-05 22:49                                         ` Bob Rogers
     [not found]                                           ` <25105.33397.961104.269676@orion.rgrjr.com>
2022-02-20 12:25                                             ` Lars Ingebrigtsen
2022-02-20 13:03                                             ` Andreas Schwab
     [not found]                                               ` <87ilt9vicd.fsf@gnus.org>
2022-02-20 22:14                                                 ` Bob Rogers
2022-02-23 23:15                                                   ` Bob Rogers
2022-02-24  9:19                                                     ` Lars Ingebrigtsen
2022-02-25  0:49                                                       ` Bob Rogers
2022-02-25  2:16                                                         ` Lars Ingebrigtsen
2022-02-25  2:32                                                           ` Bob Rogers
2022-02-25  2:58                                                             ` Bob Rogers
2022-02-25 12:03                                                               ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=25031.40994.286546.498819@orion.rgrjr.com \
    --to=rogers-emacs@rgrjr.homedns.org \
    --cc=52209@debbugs.gnu.org \
    --cc=larsi@gnus.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).