[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] org-element-timestamp-interpreter: Return daterange anyway,
From: |
Ihor Radchenko |
Subject: |
Re: [PATCH] org-element-timestamp-interpreter: Return daterange anyway, if DATERANGE is non-nil |
Date: |
Sat, 08 Jul 2023 08:35:02 +0000 |
Ilya Chernyshov <ichernyshovvv@gmail.com> writes:
>> Interpreting timestamps with :time-range nil and
>> :day-end/:year-end/:month-end non-nil as timerange is a breaking change.
>> Let's avoid it.
>
> Timestamp objects (ranges) with :range-type nil are now interpreted as
> dateranges, as it was before.
I still have questions about this part.
> + (hour-start (org-element-property :hour-start timestamp))
> + (minute-start (org-element-property :minute-start
> timestamp))
> + (hour-end (or (org-element-property :hour-end timestamp)
> hour-start))
> + (minute-end (or (org-element-property :minute-end
> timestamp) minute-start))
> + (day-end (or (org-element-property :day-end timestamp)
> day-start))
> + (month-end (or (org-element-property :month-end timestamp)
> month-start))
> + (year-end (or (org-element-property :year-end timestamp)
> year-start))
I note that *-end is never going to be nil when the corresponding
*-start is non-nil. This will remove some original information about
timestamp that can cause edge cases as I describe below.
> + (time-range-p (and hour-start minute-start minute-end
> hour-end
So, this (and ...), copied from the old version of the code looks suspicious.
> + (or (/= hour-start hour-end)
> + (/= minute-start minute-end))))
> + (date-range-p (or (and (eq range-type nil) time-range-p)
What about [2023-11-12 12:00-13:00] represented as Elisp AST with :range-type
nil?
> + (and day-end month-end year-end
> + (or
> + (/= day-start day-end)
> + (/= month-start month-end)
> + (/= year-start year-end)))))
[2023-11-12 12:00]--[2023-11-12 13:00]?
--
Ihor Radchenko // yantar92,
Org mode contributor,
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>
- Re: [PATCH] org-element-timestamp-interpreter: Return daterange anyway, if DATERANGE is non-nil, Ilya Chernyshov, 2023/07/01
- Re: [PATCH] org-element-timestamp-interpreter: Return daterange anyway, if DATERANGE is non-nil, Ihor Radchenko, 2023/07/02
- Re: [PATCH] org-element-timestamp-interpreter: Return daterange anyway, if DATERANGE is non-nil, Ilya Chernyshov, 2023/07/07
- Re: [PATCH] org-element-timestamp-interpreter: Return daterange anyway, if DATERANGE is non-nil,
Ihor Radchenko <=
- Re: [PATCH] org-element-timestamp-interpreter: Return daterange anyway, if DATERANGE is non-nil, Ilya Chernyshov, 2023/07/10
- Re: [PATCH] org-element-timestamp-interpreter: Return daterange anyway, if DATERANGE is non-nil, Ihor Radchenko, 2023/07/11
- Re: [PATCH] org-element-timestamp-interpreter: Return daterange anyway, if DATERANGE is non-nil, Ilya Chernyshov, 2023/07/11
- Re: [PATCH] org-element-timestamp-interpreter: Return daterange anyway, if DATERANGE is non-nil, Ihor Radchenko, 2023/07/12