all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [Bug] Date span failure in agenda w/o day of week in timestamp?
@ 2022-04-25 12:38 Russell Adams
  2022-04-26  9:43 ` Ihor Radchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Russell Adams @ 2022-04-25 12:38 UTC (permalink / raw)
  To: emacs-orgmode

Consider this sample file:

--------------------------------------------------
* Test with day of week

<2022-04-25 Mon 15:00>--<2022-04-26 Tue 02:00>

* Fails w/o DOW, end time at 2100 not 0200

<2022-04-28 21:00>--<2022-04-29 02:00>

--------------------------------------------------

Results in this agenda:

----------------------------------------------------------------------
Week-agenda (W17):
Monday     25 April 2022 W17
               8:00...... ----------------
              10:00...... ----------------
              12:00...... ----------------
              14:00...... ----------------
              14:31...... now - - - - - - - - - - - - - - - - - - - - - - - - -
  testdate:   15:00...... (1/2):  Test with day of week
              16:00...... ----------------
              18:00...... ----------------
              20:00...... ----------------
Tuesday    26 April 2022
  testdate:    2:00...... (2/2):  Test with day of week
Wednesday  27 April 2022
Thursday   28 April 2022
  testdate:   21:00...... (1/2):  Fails w/o DOW, end time at 2100 not 0200
Friday     29 April 2022
  testdate:   21:00...... (2/2):  Fails w/o DOW, end time at 2100 not 0200
Saturday   30 April 2022
Sunday      1 May 2022
----------------------------------------------------------------------

So if the DOW is omitted from the end date, then it defaults to 24
hours?

I discovered this using gnus-icalendar to import ical invites. Gnus
appears to omit the DOW when creating the timestamp.

I thought DOW was optional in timestamps?

Org mode version 9.5.2 (release_9.5.2-25-gaf6f12 @ /usr/local/share/emacs/28.1/lisp/org/)
GNU Emacs 28.1 (build 2, amd64-portbld-freebsd13.0, X toolkit, cairo version 1.17.4, Xaw3d scroll bars)

------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com
                                    https://www.adamsinfoserv.com/


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Bug] Date span failure in agenda w/o day of week in timestamp?
  2022-04-25 12:38 [Bug] Date span failure in agenda w/o day of week in timestamp? Russell Adams
@ 2022-04-26  9:43 ` Ihor Radchenko
  2022-04-26 11:37   ` Russell Adams
  2022-10-08  4:03   ` Ihor Radchenko
  0 siblings, 2 replies; 7+ messages in thread
From: Ihor Radchenko @ 2022-04-26  9:43 UTC (permalink / raw)
  To: Russell Adams; +Cc: emacs-orgmode

Russell Adams <RLAdams@adamsinfoserv.com> writes:

> --------------------------------------------------
> * Fails w/o DOW, end time at 2100 not 0200
>
> <2022-04-28 21:00>--<2022-04-29 02:00>

Confirmed.

The problem is that org-ts-regexp1 does not match "2022-04-29 02:00". I
am not sure why. org-ts-regexp1 looks like it should match the above
case. Maybe something to do with greedy/non-greedy regexp matching, but
its just a guess.

Best,
Ihor


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Bug] Date span failure in agenda w/o day of week in timestamp?
  2022-04-26  9:43 ` Ihor Radchenko
@ 2022-04-26 11:37   ` Russell Adams
  2022-04-26 12:17     ` Ihor Radchenko
  2022-10-08  4:03   ` Ihor Radchenko
  1 sibling, 1 reply; 7+ messages in thread
From: Russell Adams @ 2022-04-26 11:37 UTC (permalink / raw)
  To: emacs-orgmode

On Tue, Apr 26, 2022 at 05:43:48PM +0800, Ihor Radchenko wrote:
> Russell Adams <RLAdams@adamsinfoserv.com> writes:
>
> > --------------------------------------------------
> > * Fails w/o DOW, end time at 2100 not 0200
> >
> > <2022-04-28 21:00>--<2022-04-29 02:00>
>
> Confirmed.
>
> The problem is that org-ts-regexp1 does not match "2022-04-29 02:00". I
> am not sure why. org-ts-regexp1 looks like it should match the above
> case. Maybe something to do with greedy/non-greedy regexp matching, but
> its just a guess.

Is that technically a valid timestamp, meaning that it should be
recognized? Or is it just Gnus outputting a bad timestamp and I should
go try to adjust it?

------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com
                                    https://www.adamsinfoserv.com/


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Bug] Date span failure in agenda w/o day of week in timestamp?
  2022-04-26 11:37   ` Russell Adams
@ 2022-04-26 12:17     ` Ihor Radchenko
  2022-04-26 12:39       ` Russell Adams
  0 siblings, 1 reply; 7+ messages in thread
From: Ihor Radchenko @ 2022-04-26 12:17 UTC (permalink / raw)
  To: Russell Adams; +Cc: emacs-orgmode

Russell Adams <RLAdams@adamsinfoserv.com> writes:

>> > <2022-04-28 21:00>--<2022-04-29 02:00>
>>
>
> Is that technically a valid timestamp, meaning that it should be
> recognized? Or is it just Gnus outputting a bad timestamp and I should
> go try to adjust it?

It is valid. You can check it by calling M-: (org-element-context) at
timestamp. Our parser does recognise your example as:

(timestamp
 (:type active-range :raw-value "<2022-04-28 21:00>--<2022-04-29 02:00>" :year-start 2022 :month-start 4 :day-start 28 :hour-start 21 :minute-start 0 :year-end 2022 :month-end 4 :day-end 29 :hour-end 2 :minute-end 0 :begin 293 :end 331 :post-blank 0))

You can see that the end date is recognised correctly.

Best,
Ihor


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Bug] Date span failure in agenda w/o day of week in timestamp?
  2022-04-26 12:17     ` Ihor Radchenko
@ 2022-04-26 12:39       ` Russell Adams
  2022-04-26 13:23         ` Ihor Radchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Russell Adams @ 2022-04-26 12:39 UTC (permalink / raw)
  To: emacs-orgmode

On Tue, Apr 26, 2022 at 08:17:23PM +0800, Ihor Radchenko wrote:
> Russell Adams <RLAdams@adamsinfoserv.com> writes:
>
> >> > <2022-04-28 21:00>--<2022-04-29 02:00>
> >>
> >
> > Is that technically a valid timestamp, meaning that it should be
> > recognized? Or is it just Gnus outputting a bad timestamp and I should
> > go try to adjust it?
>
> It is valid. You can check it by calling M-: (org-element-context) at
> timestamp. Our parser does recognise your example as:
>
> (timestamp
>  (:type active-range :raw-value "<2022-04-28 21:00>--<2022-04-29 02:00>" :year-start 2022 :month-start 4 :day-start 28 :hour-start 21 :minute-start 0 :year-end 2022 :month-end 4 :day-end 29 :hour-end 2 :minute-end 0 :begin 293 :end 331 :post-blank 0))
>
> You can see that the end date is recognised correctly.

What do you recommend as the next step?

------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com
                                    https://www.adamsinfoserv.com/


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Bug] Date span failure in agenda w/o day of week in timestamp?
  2022-04-26 12:39       ` Russell Adams
@ 2022-04-26 13:23         ` Ihor Radchenko
  0 siblings, 0 replies; 7+ messages in thread
From: Ihor Radchenko @ 2022-04-26 13:23 UTC (permalink / raw)
  To: Russell Adams; +Cc: emacs-orgmode

Russell Adams <RLAdams@adamsinfoserv.com> writes:

> What do you recommend as the next step?

org-ts-regexp1 should be fixed. But I currently have no ideas how. The
problem is caused by some edge case in Emacs regexp parser.

Best,
Ihor


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Bug] Date span failure in agenda w/o day of week in timestamp?
  2022-04-26  9:43 ` Ihor Radchenko
  2022-04-26 11:37   ` Russell Adams
@ 2022-10-08  4:03   ` Ihor Radchenko
  1 sibling, 0 replies; 7+ messages in thread
From: Ihor Radchenko @ 2022-10-08  4:03 UTC (permalink / raw)
  To: Russell Adams; +Cc: emacs-orgmode

Ihor Radchenko <yantar92@gmail.com> writes:

> Russell Adams <RLAdams@adamsinfoserv.com> writes:
>
>> --------------------------------------------------
>> * Fails w/o DOW, end time at 2100 not 0200
>>
>> <2022-04-28 21:00>--<2022-04-29 02:00>
>
> Confirmed.
>
> The problem is that org-ts-regexp1 does not match "2022-04-29 02:00". I
> am not sure why. org-ts-regexp1 looks like it should match the above
> case. Maybe something to do with greedy/non-greedy regexp matching, but
> its just a guess.

Fixed on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=b68c1666c2be28b6e0b9fc6b1c1c863dd0d8f27c

-- 
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>


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-10-08  4:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-25 12:38 [Bug] Date span failure in agenda w/o day of week in timestamp? Russell Adams
2022-04-26  9:43 ` Ihor Radchenko
2022-04-26 11:37   ` Russell Adams
2022-04-26 12:17     ` Ihor Radchenko
2022-04-26 12:39       ` Russell Adams
2022-04-26 13:23         ` Ihor Radchenko
2022-10-08  4:03   ` Ihor Radchenko

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.