Derek Chen-Becker <[email protected]> writes:

> On Tue, Mar 28, 2023 at 10:52:18AM +0000, Ihor Radchenko wrote:
>> So, when Org is trying to change the data to 2023-03-26 2:05, Emacs date
>> library refuses and instead sets the closes valid time.
>> 
>> I am not sure would be the best course of action here.
>> 1. We can jump over the invalid hours in the direction requested by user
>> 2. We can throw an error, making the user aware about the daylight
>>    thing.
>> 
>> I am more in favour of (2) because things like this are easy to overlook.
>
> I've attached a patch that uses a comparison of the date before and
> after the shift to ensure that the shift resulted in a proper change
> (as opposed to a wrap that can end up shifting in the wrong direction
> or not at all). Per the other thread, I think this is independent of
> the current work on `org-timestamp-change'.

Thanks!
Looking at this now in more details, I note that we have recently
changed the code to use `decoded-time-add'. And that function calls
`decoded-time--alter-second', which has the following:

;; Hm...  DST...
    (while (time-less-p new 0)
      (decoded-time--alter-day time nil)
      (setq new (time-add new secsperday)))

Now, I am wondering if the original bug is even reproducible.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to