GNU bug report logs -
#74869
[PATCH] Add predicates for decoded times and time deltas
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#74869: [PATCH] Add predicates for decoded times and time deltas
which was filed against the emacs package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 74869 <at> debbugs.gnu.org.
--
74869: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74869
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Richard Lawrence <rwl <at> recursewithless.net> writes:
> Paul Eggert <eggert <at> cs.ucla.edu> writes:
>
>> On 2/11/25 11:14, Stefan Kangas wrote:
>>
>>> Does that mean to imply that this bug is a wontfix?
>>
>> Given rwl's December 29 message
>> <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74869#16> it sounds like
>> it might be better to have something like an icalendar-decoded-time-p
>> function, which follows the iCalendar standard as opposed to Emacs's
>> more-idiosyncratic rules. So, not a wontfix; more a "let's keep this in
>> iCalendar for now".
>
> Yes, that's fine with me; so I guess this bug can be closed.
OK, so I'm doing that now.
Thanks for working improving our iCalendar support, that is greatly
appreciated.
[Message part 3 (message/rfc822, inline)]
[Message part 4 (text/plain, inline)]
Tags: patch
This is a rough draft of a patch to add two new predicates related to
decoded times: `decoded-time-p', which checks that a value is a decoded
time (as documented in `decode-time'), and
`decoded-time-delta-p', which checks that a value is a time delta (as
documented in `decoded-time-add').
Some questions:
1) Should these functions go in simple.el? I put them there because that
is where the structure definition for decoded-time is. (The definition
does not generate a predicate automatically because it uses :type but
not :named; see Info node `(cl)Structures'.) But at least
`decoded-time-delta-p' might be better off in time-date.el, which is
where `decoded-time-add' is defined.
2) Should `decoded-time-p' also check the weekday slot of decoded times?
See the FIXME comment in the middle of the function: `make-decoded-time'
neither sets this slot nor provides an argument to let the caller set
it. This is apparently intentional: there is a comment in the
definition of `make-decoded-time',
;; Do not set decoded-time-weekday or decoded-time-dst,
;; as encode-time can infer them well enough when unknown.
but if the slot is not meant to be set I don't understand why it's
there. It would be useful, for iCalendar purposes, to have the weekday
slot automatically calculated from the date values when a decoded time
is constructed. I'm not sure if this use was just not envisioned, or if
there was a more substantial reason not to do it in make-decoded-time.
Hopefully I got the commit message right this time, but please let me
know if that needs tweaking too...
Best,
Richard
[0001-Add-predicates-for-decoded-times-and-time-deltas.patch (text/patch, attachment)]
This bug report was last modified 98 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.