emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Custom forwarding for a scheduled task


From: Fletcher Charest
Subject: Re: [O] Custom forwarding for a scheduled task
Date: Sat, 26 Oct 2013 11:44:41 +0200

Dear all,

In case someone would be interested, I came up with an ugly hack, nor robust or elegant, but it works... It iterates over all headings, check if the current heading has a property "reschedule" and a "TODO" state, and if the number of days passed in the current year for today is greater than the number of days passed in the current year when the task was scheduled (quite clumsy, but I couldn't find another way to do it...). If these conditions are met, the task get cancelled.

#+BEGIN_SRC emacs-lisp
  (defun fc/org-forward-task-if-not-done ()
    (interactive)
    (save-excursion
      (goto-char (point-max))
      (while (outline-previous-heading)
        (when (and (org-entry-get (point) "reschedule")
                   (equal "TODO" (cdar (org-entry-properties)))
                   (> (string-to-number (format-time-string "%j")) (string-to-number (format-time-string "%j" (org-get-scheduled-time (point))))))
          (org-todo "CANCELLED")))))
 
  (global-set-key (kbd "s-f") 'fc/org-forward-task-if-not-done)
#+END_SRC


When used on a task like this...

* TODO test
  :PROPERTIES:
  :reschedule: yes
  :LOGGING: CANCELLED(!)
  :END:
  SCHEDULED: <2013-10-24 jeu. ++1w>


...when I press <s-f>, the task is automatically scheduled to the next thursday (from today) if it was not done starting from 2013-10-25.

Best regards,

FC

On Wed, Oct 23, 2013 at 3:37 PM, Fletcher Charest <address@hidden> wrote:
Dear Sébastien,

Thank you for your answer, it is useful. Now I can see that I already worked on a task even if I reschedule it and don't see the "Sched. 2x" mention. But I still have to manually reschedule the task to the next week, which is what I *really* want to avoid, even at the price of not seeing what I already did either in the form of clocking time or with the "Sched. 2x" mention (maybe this wasn't clear in my first message).

I will try to write something with my very poor level of emacs-lisp. My reasoning would be something like: "if a task that has this particular property was scheduled for being done x days ago (with x > 0), and if it is not marked DONE, then reschedule it (7 - x) days later". I could maybe include a comment saying that this task was automatically rescheduled, with a timestamp. I just hope I'm not reinventing the wheel somewhere in that process.

Best regards


On Mon, Oct 21, 2013 at 9:15 PM, Sebastien Vauban <address@hidden> wrote:
Hello Fletcher,

Fletcher Charest wrote:
> First of all, apologies if I'm doing something wrong - I'm not used to
> posting in mailing lists.
>
> I read in the Org manual, about scheduled tasks :
>
> "A reminder that the scheduled date has passed will be present in the
> compilation for today, until the entry is marked DONE, i.e., the task will
> automatically be forwarded until completed."
>
> Sometimes, I schedule a task but can only carry out my second day of work
> on that task one week later (or my first day if I couldn't work on it on
> the scheduled day). I would like to know if it is possible to schedule a
> task, for example, on a Sunday, and see it appear in the agenda the next
> Sunday with the mention "Sched. 2x:  TODO my task". This way I know I have
> to carry out my second day of work on that task on that day.
>
> I tried to use delays for this but couldn't obtain anything.
>
> I'm sorry if this is standard functionality or if it has been answered
> somewhere. I usually find all my answers about org-mode online but this
> time I couldn't find any info.

This hasn't been answered yet, neither is it a common request.

FWIW, I removed such scheduling info (2x, 3x...) because it scared me to hell
when it went over 99 days delay.

But, to answer you, no, I don't think it's doable in the current system.
Though, you could get more or less the same functionality by clocking time,
rescheduling your task for the available Sunday, and clock again. On that day,
you would see that you're clocking hours 8 to 15 of your work.

Best regards,
  Seb

--
Sebastien Vauban





reply via email to

[Prev in Thread] Current Thread [Next in Thread]