[Top][All Lists]

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

Re: [O] Recurring tasks and arbitrary properties

From: Michael Welle
Subject: Re: [O] Recurring tasks and arbitrary properties
Date: Sun, 22 Jan 2017 14:27:47 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.91 (gnu/linux)


Nicolas Goaziou <address@hidden> writes:

> Michael Welle <address@hidden> writes:
>> Nicolas Goaziou <address@hidden> writes:
>>> Michael Welle <address@hidden> writes:
>>>> a task like this behaves like a recurring task, i.e. if I set the task
>>>> state to DONE it is automatically switched back to TODO. Is that the
>>>> intended behaviour?
>>>> * TODO task1
>>>>   :FOO: <2017-03-12 Sun ++1w>
>>>>   :END:
>>> Historically, location of regular (i.e., non scheduled non deadline)
>>> active time stamps in an entry has always been sloppy. In particular,
>>> Org Agenda happily processes active time stamps in properties drawers.
>>> IMO, this shouldn't be the case, but I can see a use for it and doing
>>> otherwise would probably break a lot of documents for little benefit.
>>> So, yes, this is the intended behaviour.
>> hmm, what's a good way to work around that? Removing, let's say, the
>> brackets before storing that value?
> Couldn't you use inactive time stamps?
I want to do something like this:

(defun hmw/org-deactivate-recurring-task ()
  "Deactivate a recurring task. The value of the SCHEDULED property is
stored in the property referenced by `hmw/org-scheduled-property-backup',
so it can be restored later. The task's state is set to the value of
  (when (org-entry-is-todo-p)
      (org-back-to-heading t)
      (let* ((pom (point-at-bol))
             (val (org-entry-get pom "SCHEDULED")))
        (if val
              (org-entry-put pom hmw/org-scheduled-property-backup val)
              (org-entry-put pom "SCHEDULED" nil)
              (org-todo hmw/org-deactivated-recurring-task-state)))))))

I want to 'hide' the value of the SCHEDULED property and later restore
it. I can use inactive time stamps. But that means that I have to change
the value when deactivating the task and again, later when I activate
the task again. But it would have been nicer without doing so ;).

Thanks for your help.


reply via email to

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