* Bug: org-agenda-undo does not work on repeated tasks [7.9.3d (7.9.3d-dist @ /home/wlin/.emacs-lisp/org/lisp/)]
@ 2013-03-03 17:45 Wanrong Lin
2013-04-10 12:38 ` Bastien
0 siblings, 1 reply; 7+ messages in thread
From: Wanrong Lin @ 2013-03-03 17:45 UTC (permalink / raw)
To: emacs-orgmode
Emacs : GNU Emacs 23.3.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.5)
of 2011-08-14 on allspice, modified by Debian
Package: Org-mode version 7.9.3d (7.9.3d-dist @
/home/myth/.emacs-lisp/org/lisp/)
To reproduce:
In an org agenda buffer, mark a task as done. Then, run org-agenda-undo.
If the task is a repeated task like this:
* TODO A weekly repeated task
SCHEDULED: <2013-03-03 Sun +1w>
After mark a task as done from the agenda buffer, it becomes:
* TODO A weekly repeated task
SCHEDULED: <2013-03-10 Sun +1w>
:LOGBOOK:
- State "DONE" from "TODO" [2013-03-03 Sun 12:43]
:END:
:PROPERTIES:
:LAST_REPEAT: [2013-03-03 Sun 12:43]
:END:
Then, if I run org-agenda-undo (with C-z) in agenda buffer,
* TODO A weekly repeated task
SCHEDULED: <2013-03-10 Sun +1w>
:LOGBOOK:
:END:
:PROPERTIES:
:LAST_REPEAT: [2013-03-03 Sun 12:43]
:END:
As you can see, the LOGBOOK changed, but the SCHEDULED time did not go
back to the original.
Thanks for looking into it.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Bug: org-agenda-undo does not work on repeated tasks [7.9.3d (7.9.3d-dist @ /home/wlin/.emacs-lisp/org/lisp/)]
2013-03-03 17:45 Bug: org-agenda-undo does not work on repeated tasks [7.9.3d (7.9.3d-dist @ /home/wlin/.emacs-lisp/org/lisp/)] Wanrong Lin
@ 2013-04-10 12:38 ` Bastien
2019-03-26 14:23 ` Bug: Entries with diary-sexps in "scheduled" not exported properly to calendar file (.ics file) Wanrong Lin
0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2013-04-10 12:38 UTC (permalink / raw)
To: Wanrong Lin; +Cc: emacs-orgmode
Hi Wanrong,
Wanrong Lin <wrglin@gmail.com> writes:
> Emacs : GNU Emacs 23.3.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.5)
> of 2011-08-14 on allspice, modified by Debian
> Package: Org-mode version 7.9.3d (7.9.3d-dist @
> /home/myth/.emacs-lisp/org/lisp/)
>
> To reproduce:
>
> In an org agenda buffer, mark a task as done. Then, run org-agenda-undo. If
> the task is a repeated task like this:
>
> * TODO A weekly repeated task
> SCHEDULED: <2013-03-03 Sun +1w>
>
> After mark a task as done from the agenda buffer, it becomes:
>
> * TODO A weekly repeated task
> SCHEDULED: <2013-03-10 Sun +1w>
> :LOGBOOK:
> - State "DONE" from "TODO" [2013-03-03 Sun 12:43]
> :END:
> :PROPERTIES:
> :LAST_REPEAT: [2013-03-03 Sun 12:43]
> :END:
>
> Then, if I run org-agenda-undo (with C-z) in agenda buffer,
>
> * TODO A weekly repeated task
> SCHEDULED: <2013-03-10 Sun +1w>
> :LOGBOOK:
> :END:
> :PROPERTIES:
> :LAST_REPEAT: [2013-03-03 Sun 12:43]
> :END:
>
> As you can see, the LOGBOOK changed, but the SCHEDULED time did not go back
> to the original.
>
> Thanks for looking into it.
Thanks a lot for reporting this obscure bug. It is now fixed.
--
Bastien
^ permalink raw reply [flat|nested] 7+ messages in thread
* Bug: Entries with diary-sexps in "scheduled" not exported properly to calendar file (.ics file)
2013-04-10 12:38 ` Bastien
@ 2019-03-26 14:23 ` Wanrong Lin
2019-03-26 18:21 ` Thomas Plass
0 siblings, 1 reply; 7+ messages in thread
From: Wanrong Lin @ 2019-03-26 14:23 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1332 bytes --]
Org-mode version 9.2.2, Emacs 26.1, Windows 10
To reproduce:
Create a file "Test.org", with only one entry:
----------------------------------------------------------------------------
* TODO Do this on the second Monday every month
SCHEDULED: <%%(diary-float t 1 2) 19:00-20:30>
:PROPERTIES:
:ID: 5eb2262f-d7a4-4c10-8765-e1906a1cf276
:END:
------------------------------------------------------------------------------
Run this in the buffer of this above file:
M-x org-icalendar-export-to-ics
Check the output file "Test.ics", and you will see something like below,
which obviously is wrong (I highlighted the wrong part).
BTW: regular org-agenda still works correctly with this entry (the TODO
shows up correct at the right date)
-------------------------------------------------------------------------------
BEGIN:VCALENDAR
VERSION:2.0
X-WR-CALNAME:Test
PRODID:-////Emacs with Org mode//EN
X-WR-TIMEZONE:America/New_York
X-WR-CALDESC:
CALSCALE:GREGORIAN
BEGIN:VTODO
UID:TODO-5eb2262f-d7a4-4c10-8765-e1906a1cf276
DTSTAMP:20190326T141906Z
*DTSTART:20190326T101900*
SUMMARY:Do this on the second Monday every month
CATEGORIES:Test
SEQUENCE:1
PRIORITY:13
STATUS:NEEDS-ACTION
END:VTODO
END:VCALENDAR
-------------------------------------------------------------------------------
[-- Attachment #2: Type: text/html, Size: 2021 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Bug: Entries with diary-sexps in "scheduled" not exported properly to calendar file (.ics file)
2019-03-26 14:23 ` Bug: Entries with diary-sexps in "scheduled" not exported properly to calendar file (.ics file) Wanrong Lin
@ 2019-03-26 18:21 ` Thomas Plass
2019-03-26 19:20 ` Wanrong Lin
0 siblings, 1 reply; 7+ messages in thread
From: Thomas Plass @ 2019-03-26 18:21 UTC (permalink / raw)
To: Wanrong Lin; +Cc: emacs-orgmode
Hi,
Wanrong Lin wrote at 10:23 on March 26, 2019:
:
: * TODO Do this on the second Monday every month
: SCHEDULED: <%%(diary-float t 1 2) 19:00-20:30>
:
: M-x org-icalendar-export-to-ics
Org agenda has its own processing of sexps, so its views are correct.
The exporter, however, uses icalendar.el for creating the iCal data.
Date processing there in `icalendar--convert-float-to-ical' is
somewhat arbitrary as per the docstring:
"Convert float diary entry to iCalendar format -- partially unsupported!
FIXME! DAY from diary-float yet unimplemented.
As far as the exported date is concerned, it'll always be today's
date as per this comment further down:
;;Start today (yes this is an arbitrary choice):
So, bug-gnu-emacs would be the list to post this issue to.
Regards
Thomas
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Bug: Entries with diary-sexps in "scheduled" not exported properly to calendar file (.ics file)
2019-03-26 18:21 ` Thomas Plass
@ 2019-03-26 19:20 ` Wanrong Lin
2019-03-26 21:01 ` Thomas Plass
0 siblings, 1 reply; 7+ messages in thread
From: Wanrong Lin @ 2019-03-26 19:20 UTC (permalink / raw)
To: Thomas Plass; +Cc: emacs-orgmode
Thanks for the explanation. My limited debugging showed the data may not
even be passed from org to icalendar.el ("scheduled: nil" in the entry).
But from what you said it won't work anyway regardless.
This is a bit of bummer. As a work around, do you know if there is a way
to generate a series of dates / org entries from a diary-sexps? Thanks.
Wanrong
On 3/26/2019 2:21 PM, Thomas Plass wrote:
> Hi,
>
> Wanrong Lin wrote at 10:23 on March 26, 2019:
> :
> : * TODO Do this on the second Monday every month
> : SCHEDULED: <%%(diary-float t 1 2) 19:00-20:30>
> :
> : M-x org-icalendar-export-to-ics
>
> Org agenda has its own processing of sexps, so its views are correct.
> The exporter, however, uses icalendar.el for creating the iCal data.
> Date processing there in `icalendar--convert-float-to-ical' is
> somewhat arbitrary as per the docstring:
>
> "Convert float diary entry to iCalendar format -- partially unsupported!
>
> FIXME! DAY from diary-float yet unimplemented.
>
> As far as the exported date is concerned, it'll always be today's
> date as per this comment further down:
>
> ;;Start today (yes this is an arbitrary choice):
>
> So, bug-gnu-emacs would be the list to post this issue to.
>
> Regards
>
> Thomas
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Bug: Entries with diary-sexps in "scheduled" not exported properly to calendar file (.ics file)
2019-03-26 19:20 ` Wanrong Lin
@ 2019-03-26 21:01 ` Thomas Plass
2019-04-01 18:14 ` Wanrong Lin
0 siblings, 1 reply; 7+ messages in thread
From: Thomas Plass @ 2019-03-26 21:01 UTC (permalink / raw)
To: Wanrong Lin; +Cc: emacs-orgmode
Wanrong Lin wrote at 15:20 on March 26, 2019:
:
: As a work around, do you know if there is a way
: to generate a series of dates / org entries from a diary-sexps? Thanks.
Evaluating those sexp is done in diary-lib. But it's no use simply
supplying arguments to functions there as they require external setup,
in particular variables such the current DATE (mon day year), itself
coming from calendar.el. However, it's exactly such dates that you
are looking for in the first place. I guess, in your example
(diary-float t 1 2) you might have to loop through all the days of all
months (calendar knows about those) to see whether your sexp evaluates
to something useful. But I haven't looked at that in detail.
Thomas
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Bug: Entries with diary-sexps in "scheduled" not exported properly to calendar file (.ics file)
2019-03-26 21:01 ` Thomas Plass
@ 2019-04-01 18:14 ` Wanrong Lin
0 siblings, 0 replies; 7+ messages in thread
From: Wanrong Lin @ 2019-04-01 18:14 UTC (permalink / raw)
To: Thomas Plass; +Cc: emacs-orgmode
I just wrote a function to do it, and hope it can help other people with
similar needs:
;; example: (dates-from-diary-sexp "2019-04-01" "2019-09-01"
"(diary-float t 1 2)")
;; => ((8 12 2019) (7 8 2019) (6 10 2019) (5 13 2019) (4 8 2019))
(defun dates-from-diary-sexp (start end diary-sexp)
"Given a start and ending date, returns all valid dates between them
that satisfy diary-sexp"
(let ((day-absolute (org-time-string-to-absolute start))
(end-absolute (org-time-string-to-absolute end))
(sexp (car (read-from-string diary-sexp)))
(dates))
(while (< day-absolute end-absolute)
(let ((date (calendar-gregorian-from-absolute day-absolute))
(entry nil))
(when (eval sexp)
(setf dates (cons date dates)))
(incf day-absolute)))
dates))
On 3/26/2019 5:01 PM, Thomas Plass wrote:
> Wanrong Lin wrote at 15:20 on March 26, 2019:
> :
> : As a work around, do you know if there is a way
> : to generate a series of dates / org entries from a diary-sexps? Thanks.
>
> Evaluating those sexp is done in diary-lib. But it's no use simply
> supplying arguments to functions there as they require external setup,
> in particular variables such the current DATE (mon day year), itself
> coming from calendar.el. However, it's exactly such dates that you
> are looking for in the first place. I guess, in your example
> (diary-float t 1 2) you might have to loop through all the days of all
> months (calendar knows about those) to see whether your sexp evaluates
> to something useful. But I haven't looked at that in detail.
>
> Thomas
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-04-01 18:14 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-03 17:45 Bug: org-agenda-undo does not work on repeated tasks [7.9.3d (7.9.3d-dist @ /home/wlin/.emacs-lisp/org/lisp/)] Wanrong Lin
2013-04-10 12:38 ` Bastien
2019-03-26 14:23 ` Bug: Entries with diary-sexps in "scheduled" not exported properly to calendar file (.ics file) Wanrong Lin
2019-03-26 18:21 ` Thomas Plass
2019-03-26 19:20 ` Wanrong Lin
2019-03-26 21:01 ` Thomas Plass
2019-04-01 18:14 ` Wanrong Lin
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).