6

I'd like to set up a schedule for an habit such that the task has to be performed three days in a row and then skipped the fourth day. So, assuming the first recorded day is monday, I'll have:

Mon ✓ 
Tue ✓ 
Wed ✓ 
Thu x
Fri ✓ 
Sat ✓ 
Sun ✓ 
Mon x
etc. 

Is it possible to set such a repeating schedule using the .+ syntax?

2

tiny can do this:

tiny-schedule.gif

Here's the thing to expand:

m\n10|** TODO Habit \nSCHEDULED: <%(date "Mon" (do31 x))>

Here's the yasnippet to produce something close to the above snippet:

# -*- mode: snippet -*-
# name: todo_schedule
# key: ts
# --
m\n${1:4}|`(make-string (org-current-level) ?*)` TODO $2 %(+ x 1)\nSCHEDULED: <%(date "${3:today}" (* x 7))>

Here's the code of do31:

(defun do31 (x)
  (+ x (/ x 3)))

You can do some variations as well:

m\n20|** TODO Habit \nSCHEDULED: <%(date "Mon" (do31 x))>
m\n20|** TODO Habit %(+ x 1)\nSCHEDULED: <%(date "Mon" (do31 x))>
m\n20|** TODO Habit %(+ x 1)\nSCHEDULED: <%(date "Mon 10:00" (do31 x))>
1

I don't believe that org-habit has any concept of "Do it X times then skip Y times".

The closest I can see for approximating would be: .+1d/2 (Do every day, or at worst every second day).

Using multiple habits you could get the desired effect:

* TODO Habit
SCHEDULED: <2014-12-05 Fri .+4d>
:PROPERTIES:
:STYLE: habit
:END:
* TODO Habit
SCHEDULED: <2014-12-06 Sat .+4d>
:PROPERTIES:
:STYLE: habit
:END:
* TODO Habit
SCHEDULED: <2014-12-07 Sun .+4d>
:PROPERTIES:
:STYLE: habit
:END:
2
  • Yep, the multiple habits setup is how I'm workarounding the lack of proper support now. A proper feature would be a nice addition (at least for me since all my tasks seem to follow such patterns).
    – Old Nick
    Dec 5 '14 at 19:36
  • This would probably require a new iterator method (do X skip Y), or a set of properties for calculating the frequencies before skipping. Dec 5 '14 at 19:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.