Subject: Re: bug#61002: 28.2; Gnus - "Date" scoring scores all articles.

From: Eric Abrahamsen <[email-masked]>
Date: Sat, 10 Feb 2024 09:27:35 -0800

Eli Zaretskii <[email-masked]> writes:

> Ping!
>
>> Cc: [email-masked], [email-masked], [email-masked]
>> Date: Sat, 27 Jan 2024 11:30:36 +0200
>> From: Eli Zaretskii <[email-masked]>
>> 
>> > From: Jakub Ječmínek <[email-masked]>
>> > Date: Sat, 20 Jan 2024 12:33:11 +0100
>> > Cc: Lars Ingebrigtsen <[email-masked]>,
>> >  Kamil Jońca <[email-masked]>
>> > 
>> > I've made huge mistake in my previous patch (now everyone will know
>> > that I'm terrible programmer).
>> > 
>> > Here's working solution of what I'm proposing:

Thanks for the ping. TBH I've never used scoring in Gnus, so this is new
territory for me. I tried the patch and it worked correctly, but...

The patch is doing this:

(gnus-date-get-time (gnus-date-iso8601 match))

This is the definition of `gnus-date-iso8601':

(defun gnus-date-iso8601 (date)
  "Convert the DATE to YYYYMMDDTHHMMSS."
  (condition-case ()
      (gnus-time-iso8601 (gnus-date-get-time date))
    (error "")))

So error handling aside, the patch ends up doing the equivalent of:

(let ((ds "Sun, 22 Jan 2023 09:30:17 +0100"))
  (gnus-date-get-time
   (gnus-time-iso8601
    (gnus-date-get-time ds))))

which effectively round-trips the date string through two different
formats. Given that this is just providing a reasonable default value
for a user prompt, I think we should just keep the inner
`gnus-date-get-time' call, and wrap the whole `int-to-string' form in a
`condition-case'. If anything at all goes wrong we really don't care, we
can just skip it and return a "1" or something.

WDYT?