Re: [Orgmode] [PATCH] Apply patch for hour/minute repeater support
Dear Andrew, thanks for the patch. However, I don't think Org is ready to deal with hour and minute granularity of tasks. The decision weather to display a task in the agenda is based solely on days, not on time, and this is deeply engrained into a number of places inside Org. I don't see how this will be very meaningful. So I will not take the patch, at least for now. More discussion and many other changes would be needed. Thanks for your contribution anyway - I hope another one will make it! Best wishes - Carsten On Sep 14, 2010, at 7:06 PM, Andrew J. Korty wrote: This patch adds hour and minute granularity to repeaters. Let me know if there's interest in incorporating it, and I'll start the FSF paperwork process. Andrew Korty --- doc/org.texi |4 ++-- lisp/org-agenda.el |2 +- lisp/org.el| 27 +++ 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index d6ea141..e9ede5a 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -5006,8 +5006,8 @@ plain timestamp will be shown exactly on that date. @cindex timestamp, with repeater interval A timestamp may contain a @emph{repeater interval}, indicating that it applies not only on the given date, but again and again after a certain -interval of N days (d), weeks (w), months (m), or years (y). The -following will show up in the agenda every Wednesday: +interval of N minutes(M), hours(H), days (d), weeks (w), months (m), or +years (y). The following will show up in the agenda every Wednesday: @example * Pick up Sam at school <2007-05-16 Wed 12:30 +1w> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 9f94fa6..176c8f0 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -4385,7 +4385,7 @@ the documentation of `org-diary'." (apply 'encode-time ; DATE bound by calendar (list 0 0 0 (nth 1 date) (car date) (nth 2 date 1 11)) - "\\|\\(<[0-9]+-[0-9]+-[0-9]+[^>\n]+?\\+[0-9]+[dwmy]>\\)" + "\\|\\(<[0-9]+-[0-9]+-[0-9]+[^>\n]+?\\+[0-9]+[MHdwmy]>\\)" "\\|\\(<%%\\(([^>\n]+)\\)>\\)")) marker hdmarker deadlinep scheduledp clockp closedp inactivep donep tmp priority category ee txt timestr tags b0 b3 e3 head diff --git a/lisp/org.el b/lisp/org.el index 70dd482..ace8291 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -621,7 +621,7 @@ An entry can be toggled between QUOTE and normal with :type 'string) (defconst org-repeat-re - "<[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9] [^>\n]*?\\([.+]?\\+[0-9]+ [dwmy]\\(/[0-9]+[dwmy]\\)?\\)" + "<[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9] [^>\n]*?\\([.+]?\\+[0-9]+ [MHdwmy]\\(/[0-9]+[dwmy]\\)?\\)" "Regular expression for specifying repeated events. After a match, group 1 contains the repeat expression.") @@ -11392,7 +11392,8 @@ This function is run automatically after each state change to a DONE state." (aa (assoc last-state org-todo-kwd-alist)) (interpret (nth 1 aa)) (head (nth 2 aa)) -(whata '(("d" . day) ("m" . month) ("y" . year))) +(whata '(("M" . minute) ("H" . hour) ("d" . day) ("m" . month) + ("y" . year))) (msg "Entry repeats: ") (org-log-done nil) (org-todo-log-states nil) @@ -11429,7 +11430,7 @@ This function is run automatically after each state change to a DONE state." (setq type (if (match-end 1) org-scheduled-string (if (match-end 3) org-deadline-string "Plain:")) ts (match-string (if (match-end 2) 2 (if (match-end 4) 4 0 - (when (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([dwmy]\\)" ts) + (when (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([MHdwmy]\\)" ts) (setq n (string-to-number (match-string 2 ts)) what (match-string 3 ts)) (if (equal what "w") (setq n (* n 7) what "d")) @@ -11438,13 +11439,15 @@ This function is run automatically after each state change to a DONE state." (setq time (save-match-data (org-time-string-to-time ts))) (cond ((equal (match-string 1 ts) ".") - ;; Shift starting date to today + ;; Shift starting date to now (org-timestamp-change - (- (time-to-days (current-time)) (time-to-days time)) - 'day)) + (truncate (/ (- (time-to-seconds (current-time)) + (time-to-seconds time)) 60)) + 'minute)) ((equal (match-string 1 ts) "+") (while (or (= nshift 0) -(<= (time-to-days time) (time-to-days (current-time +(<= (time-to-seconds time) + (time-to-seconds (current-time (when (= (incf nshift) nshiftmax) (or (y-or-n-p (message "%d repeater intervals were not enough to shift date past today. Continue? " nshift))
Re: [Orgmode] [PATCH] Apply patch for hour/minute repeater support
Manish wrote: > Hello Andrew, > > I copied the diff from "---" to the version number at the end of the > diff to a file and ran a "git apply " while on a local > branch. It fails with "fatal: corrupt patch at line 12" which is: > > , > | @cindex timestamp, with repeater interval > ` > > Any clues what I could be doing wrong? > Don't edit the message file: ``git apply'' and ``git am'' are perfectly capable of stripping out the irrelevant stuf. I did $ git checkout -b foo master to create a ``foo'' branch and then $ git am ~/Mail/org/25794 Applying: Apply patch for hour/minute repeater support (that's the file that contains Andrew's mail message - no editing involved). As you can see, it worked without a hitch. HTH, Nick ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH] Apply patch for hour/minute repeater support
Hello Andrew, I copied the diff from "---" to the version number at the end of the diff to a file and ran a "git apply " while on a local branch. It fails with "fatal: corrupt patch at line 12" which is: , | @cindex timestamp, with repeater interval ` Any clues what I could be doing wrong? Thanks -- Manish On Tue, Sep 21, 2010 at 6:16 PM, Carsten Dominik wrote: > Hi everyone, > > do we have any volunteers who are willing to test this patch? > > Thanks. > > - Carsten > > On Sep 14, 2010, at 7:06 PM, Andrew J. Korty wrote: > >> This patch adds hour and minute granularity to repeaters. Let me know if >> there's interest in incorporating it, and I'll start the FSF paperwork >> process. >> >> Andrew Korty >> >> --- >> doc/org.texi |4 ++-- >> lisp/org-agenda.el |2 +- >> lisp/org.el| 27 +++ >> 3 files changed, 18 insertions(+), 15 deletions(-) >> >> diff --git a/doc/org.texi b/doc/org.texi >> index d6ea141..e9ede5a 100644 >> --- a/doc/org.texi >> +++ b/doc/org.texi >> @@ -5006,8 +5006,8 @@ plain timestamp will be shown exactly on that date. >> @cindex timestamp, with repeater interval >> A timestamp may contain a @emph{repeater interval}, indicating that it >> applies not only on the given date, but again and again after a certain >> -interval of N days (d), weeks (w), months (m), or years (y). The >> -following will show up in the agenda every Wednesday: >> +interval of N minutes(M), hours(H), days (d), weeks (w), months (m), or >> +years (y). The following will show up in the agenda every Wednesday: >> @example >> * Pick up Sam at school <2007-05-16 Wed 12:30 +1w> >> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el >> index 9f94fa6..176c8f0 100644 >> --- a/lisp/org-agenda.el >> +++ b/lisp/org-agenda.el >> @@ -4385,7 +4385,7 @@ the documentation of `org-diary'." >> (apply 'encode-time ; DATE bound by calendar >> (list 0 0 0 (nth 1 date) (car date) (nth 2 date >> 1 11)) >> - "\\|\\(<[0-9]+-[0-9]+-[0-9]+[^>\n]+?\\+[0-9]+[dwmy]>\\)" >> + "\\|\\(<[0-9]+-[0-9]+-[0-9]+[^>\n]+?\\+[0-9]+[MHdwmy]>\\)" >> "\\|\\(<%%\\(([^>\n]+)\\)>\\)")) >> marker hdmarker deadlinep scheduledp clockp closedp inactivep >> donep tmp priority category ee txt timestr tags b0 b3 e3 head >> diff --git a/lisp/org.el b/lisp/org.el >> index 70dd482..ace8291 100644 >> --- a/lisp/org.el >> +++ b/lisp/org.el >> @@ -621,7 +621,7 @@ An entry can be toggled between QUOTE and normal with >> :type 'string) >> (defconst org-repeat-re >> - "<[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9] >> [^>\n]*?\\([.+]?\\+[0-9]+[dwmy]\\(/[0-9]+[dwmy]\\)?\\)" >> + "<[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9] >> [^>\n]*?\\([.+]?\\+[0-9]+[MHdwmy]\\(/[0-9]+[dwmy]\\)?\\)" >> "Regular expression for specifying repeated events. >> After a match, group 1 contains the repeat expression.") >> @@ -11392,7 +11392,8 @@ This function is run automatically after each >> state change to a DONE state." >> (aa (assoc last-state org-todo-kwd-alist)) >> (interpret (nth 1 aa)) >> (head (nth 2 aa)) >> -(whata '(("d" . day) ("m" . month) ("y" . year))) >> +(whata '(("M" . minute) ("H" . hour) ("d" . day) ("m" . month) >> + ("y" . year))) >> (msg "Entry repeats: ") >> (org-log-done nil) >> (org-todo-log-states nil) >> @@ -11429,7 +11430,7 @@ This function is run automatically after each >> state change to a DONE state." >>(setq type (if (match-end 1) org-scheduled-string >> (if (match-end 3) org-deadline-string "Plain:")) >> ts (match-string (if (match-end 2) 2 (if (match-end 4) 4 >> 0 >> - (when (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([dwmy]\\)" ts) >> + (when (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([MHdwmy]\\)" ts) >> (setq n (string-to-number (match-string 2 ts)) >>what (match-string 3 ts)) >> (if (equal what "w") (setq n (* n 7) what "d")) >> @@ -11438,13 +11439,15 @@ This function is run automatically after each >> state change to a DONE state." >>(setq time (save-match-data (org-time-string-to-time ts))) >>(cond >> ((equal (match-string 1 ts) ".") >> - ;; Shift starting date to today >> + ;; Shift starting date to now >> (org-timestamp-change >> - (- (time-to-days (current-time)) (time-to-days time)) >> - 'day)) >> + (truncate (/ (- (time-to-seconds (current-time)) >> + (time-to-seconds time)) 60)) >> + 'minute)) >> ((equal (match-string 1 ts) "+") >> (while (or (= nshift 0) >> -(<= (time-to-days time) (time-to-days >> (current-time >> +(<= (time-to-seconds time) >> + (time-to-seconds (current-time >>
Re: [Orgmode] [PATCH] Apply patch for hour/minute repeater support
Hi everyone, do we have any volunteers who are willing to test this patch? Thanks. - Carsten On Sep 14, 2010, at 7:06 PM, Andrew J. Korty wrote: This patch adds hour and minute granularity to repeaters. Let me know if there's interest in incorporating it, and I'll start the FSF paperwork process. Andrew Korty --- doc/org.texi |4 ++-- lisp/org-agenda.el |2 +- lisp/org.el| 27 +++ 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index d6ea141..e9ede5a 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -5006,8 +5006,8 @@ plain timestamp will be shown exactly on that date. @cindex timestamp, with repeater interval A timestamp may contain a @emph{repeater interval}, indicating that it applies not only on the given date, but again and again after a certain -interval of N days (d), weeks (w), months (m), or years (y). The -following will show up in the agenda every Wednesday: +interval of N minutes(M), hours(H), days (d), weeks (w), months (m), or +years (y). The following will show up in the agenda every Wednesday: @example * Pick up Sam at school <2007-05-16 Wed 12:30 +1w> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 9f94fa6..176c8f0 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -4385,7 +4385,7 @@ the documentation of `org-diary'." (apply 'encode-time ; DATE bound by calendar (list 0 0 0 (nth 1 date) (car date) (nth 2 date 1 11)) - "\\|\\(<[0-9]+-[0-9]+-[0-9]+[^>\n]+?\\+[0-9]+[dwmy]>\\)" + "\\|\\(<[0-9]+-[0-9]+-[0-9]+[^>\n]+?\\+[0-9]+[MHdwmy]>\\)" "\\|\\(<%%\\(([^>\n]+)\\)>\\)")) marker hdmarker deadlinep scheduledp clockp closedp inactivep donep tmp priority category ee txt timestr tags b0 b3 e3 head diff --git a/lisp/org.el b/lisp/org.el index 70dd482..ace8291 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -621,7 +621,7 @@ An entry can be toggled between QUOTE and normal with :type 'string) (defconst org-repeat-re - "<[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9] [^>\n]*?\\([.+]?\\+[0-9]+ [dwmy]\\(/[0-9]+[dwmy]\\)?\\)" + "<[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9] [^>\n]*?\\([.+]?\\+[0-9]+ [MHdwmy]\\(/[0-9]+[dwmy]\\)?\\)" "Regular expression for specifying repeated events. After a match, group 1 contains the repeat expression.") @@ -11392,7 +11392,8 @@ This function is run automatically after each state change to a DONE state." (aa (assoc last-state org-todo-kwd-alist)) (interpret (nth 1 aa)) (head (nth 2 aa)) -(whata '(("d" . day) ("m" . month) ("y" . year))) +(whata '(("M" . minute) ("H" . hour) ("d" . day) ("m" . month) + ("y" . year))) (msg "Entry repeats: ") (org-log-done nil) (org-todo-log-states nil) @@ -11429,7 +11430,7 @@ This function is run automatically after each state change to a DONE state." (setq type (if (match-end 1) org-scheduled-string (if (match-end 3) org-deadline-string "Plain:")) ts (match-string (if (match-end 2) 2 (if (match-end 4) 4 0 - (when (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([dwmy]\\)" ts) + (when (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([MHdwmy]\\)" ts) (setq n (string-to-number (match-string 2 ts)) what (match-string 3 ts)) (if (equal what "w") (setq n (* n 7) what "d")) @@ -11438,13 +11439,15 @@ This function is run automatically after each state change to a DONE state." (setq time (save-match-data (org-time-string-to-time ts))) (cond ((equal (match-string 1 ts) ".") - ;; Shift starting date to today + ;; Shift starting date to now (org-timestamp-change - (- (time-to-days (current-time)) (time-to-days time)) - 'day)) + (truncate (/ (- (time-to-seconds (current-time)) + (time-to-seconds time)) 60)) + 'minute)) ((equal (match-string 1 ts) "+") (while (or (= nshift 0) -(<= (time-to-days time) (time-to-days (current-time +(<= (time-to-seconds time) + (time-to-seconds (current-time (when (= (incf nshift) nshiftmax) (or (y-or-n-p (message "%d repeater intervals were not enough to shift date past today. Continue? " nshift)) (error "Abort"))) @@ -11456,7 +11459,7 @@ This function is run automatically after each state change to a DONE state." ;; rematch, so that we have everything in place for the real shift (org-at-timestamp-p t) (setq ts (match-string 1)) - (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([dwmy]\\)" ts + (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([MHdwmy]\\)" ts
Re: [Orgmode] [PATCH] Apply patch for hour/minute repeater support
Martin Pohlack wrote: On 14.09.2010 19:06, Andrew J. Korty wrote: > This patch adds hour and minute granularity to repeaters. Let me know > if there's interest in incorporating it, and I'll start the FSF > paperwork process. There was a related discussion here: http://www.mail-archive.com/emacs-orgmode@gnu.org/msg15142.html I must have missed that. I don't use hour repeaters in the daily/weekly agenda but in tags-todo lists with org-agenda-todo-ignore-scheduled set to 'future. I use them to remind me to do certain things every few hours, like check an incident queue. I also use them to tell me to check my mail, not because I'd forget that, but to keep me from checking it too frequently (I resist checking it until the todo appears). ajk ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH] Apply patch for hour/minute repeater support
On 14.09.2010 19:06, Andrew J. Korty wrote: > This patch adds hour and minute granularity to repeaters. Let me know > if there's interest in incorporating it, and I'll start the FSF > paperwork process. There was a related discussion here: http://www.mail-archive.com/emacs-orgmode@gnu.org/msg15142.html Cheers, Martin ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] [PATCH] Apply patch for hour/minute repeater support
This patch adds hour and minute granularity to repeaters. Let me know if there's interest in incorporating it, and I'll start the FSF paperwork process. Andrew Korty --- doc/org.texi |4 ++-- lisp/org-agenda.el |2 +- lisp/org.el| 27 +++ 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index d6ea141..e9ede5a 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -5006,8 +5006,8 @@ plain timestamp will be shown exactly on that date. @cindex timestamp, with repeater interval A timestamp may contain a @emph{repeater interval}, indicating that it applies not only on the given date, but again and again after a certain -interval of N days (d), weeks (w), months (m), or years (y). The -following will show up in the agenda every Wednesday: +interval of N minutes(M), hours(H), days (d), weeks (w), months (m), or +years (y). The following will show up in the agenda every Wednesday: @example * Pick up Sam at school <2007-05-16 Wed 12:30 +1w> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 9f94fa6..176c8f0 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -4385,7 +4385,7 @@ the documentation of `org-diary'." (apply 'encode-time ; DATE bound by calendar (list 0 0 0 (nth 1 date) (car date) (nth 2 date 1 11)) - "\\|\\(<[0-9]+-[0-9]+-[0-9]+[^>\n]+?\\+[0-9]+[dwmy]>\\)" + "\\|\\(<[0-9]+-[0-9]+-[0-9]+[^>\n]+?\\+[0-9]+[MHdwmy]>\\)" "\\|\\(<%%\\(([^>\n]+)\\)>\\)")) marker hdmarker deadlinep scheduledp clockp closedp inactivep donep tmp priority category ee txt timestr tags b0 b3 e3 head diff --git a/lisp/org.el b/lisp/org.el index 70dd482..ace8291 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -621,7 +621,7 @@ An entry can be toggled between QUOTE and normal with :type 'string) (defconst org-repeat-re - "<[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9] [^>\n]*?\\([.+]?\\+[0-9]+[dwmy]\\(/[0-9]+[dwmy]\\)?\\)" + "<[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9] [^>\n]*?\\([.+]?\\+[0-9]+[MHdwmy]\\(/[0-9]+[dwmy]\\)?\\)" "Regular expression for specifying repeated events. After a match, group 1 contains the repeat expression.") @@ -11392,7 +11392,8 @@ This function is run automatically after each state change to a DONE state." (aa (assoc last-state org-todo-kwd-alist)) (interpret (nth 1 aa)) (head (nth 2 aa)) -(whata '(("d" . day) ("m" . month) ("y" . year))) +(whata '(("M" . minute) ("H" . hour) ("d" . day) ("m" . month) + ("y" . year))) (msg "Entry repeats: ") (org-log-done nil) (org-todo-log-states nil) @@ -11429,7 +11430,7 @@ This function is run automatically after each state change to a DONE state." (setq type (if (match-end 1) org-scheduled-string (if (match-end 3) org-deadline-string "Plain:")) ts (match-string (if (match-end 2) 2 (if (match-end 4) 4 0 - (when (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([dwmy]\\)" ts) + (when (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([MHdwmy]\\)" ts) (setq n (string-to-number (match-string 2 ts)) what (match-string 3 ts)) (if (equal what "w") (setq n (* n 7) what "d")) @@ -11438,13 +11439,15 @@ This function is run automatically after each state change to a DONE state." (setq time (save-match-data (org-time-string-to-time ts))) (cond ((equal (match-string 1 ts) ".") - ;; Shift starting date to today + ;; Shift starting date to now (org-timestamp-change - (- (time-to-days (current-time)) (time-to-days time)) - 'day)) + (truncate (/ (- (time-to-seconds (current-time)) + (time-to-seconds time)) 60)) + 'minute)) ((equal (match-string 1 ts) "+") (while (or (= nshift 0) -(<= (time-to-days time) (time-to-days (current-time +(<= (time-to-seconds time) + (time-to-seconds (current-time (when (= (incf nshift) nshiftmax) (or (y-or-n-p (message "%d repeater intervals were not enough to shift date past today. Continue? " nshift)) (error "Abort"))) @@ -11456,7 +11459,7 @@ This function is run automatically after each state change to a DONE state." ;; rematch, so that we have everything in place for the real shift (org-at-timestamp-p t) (setq ts (match-string 1)) - (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([dwmy]\\)" ts + (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([MHdwmy]\\)" ts (org-timestamp-change n (cdr (assoc what whata))) (setq msg (concat msg type " " org-last-changed-timestamp " " (setq org-log-p