emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Org mode repeated dates to do spaced learning
@ 2019-01-01 12:32 Andrea Giugliano
  2019-01-01 15:39 ` Bingo
  0 siblings, 1 reply; 6+ messages in thread
From: Andrea Giugliano @ 2019-01-01 12:32 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

Happy 2019 everyone!

I would like to slightly change my learning method this year. I have
heard that spaced learning is much better than bang your head against
the same material multiple times in a row.

Spaced learning is simply reviewing some interesting topic at given
intervals: after 1 day, 1 week, 2 weeks, 1 month, 3 months, etc...

It seems to me that org-mode does not support this: how would you make a
repetitive task with spaced intervals?

I saw org-drill.el, but I do not think it does this.
Ideally I could do something like:

""
* review this interesting thing
SCHEDULED: <2019-01-01 Tue>
:PROPERTIES:
:SPACED:
:END:
""

If this is not an interesting use case for org-mode, what do you think
about me trying to extend org-habits.el instead?

Best wishes to all the community,

Andrea

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Org mode repeated dates to do spaced learning
  2019-01-01 12:32 Org mode repeated dates to do spaced learning Andrea Giugliano
@ 2019-01-01 15:39 ` Bingo
  2019-01-01 16:34   ` Andrea Giugliano
  0 siblings, 1 reply; 6+ messages in thread
From: Bingo @ 2019-01-01 15:39 UTC (permalink / raw)
  To: emacs-orgmode, Andrea Giugliano

Le 1 janvier 2019 18:02:31 GMT+05:30, Andrea Giugliano <agiugliano@live.it> a écrit :
>Happy 2019 everyone!
>
>I would like to slightly change my learning method this year. I have
>heard that spaced learning is much better than bang your head against
>the same material multiple times in a row.
>
>Spaced learning is simply reviewing some interesting topic at given
>intervals: after 1 day, 1 week, 2 weeks, 1 month, 3 months, etc...
>
>It seems to me that org-mode does not support this: how would you make
>a
>repetitive task with spaced intervals?
>
>I saw org-drill.el, but I do not think it does this.
>Ideally I could do something like:
>
>""
>* review this interesting thing
>SCHEDULED: <2019-01-01 Tue>
>:PROPERTIES:
>:SPACED:
>:END:
>""
>
>If this is not an interesting use case for org-mode, what do you think
>about me trying to extend org-habits.el instead?
>
>Best wishes to all the community,
>
>Andrea

Hi,
   Why do you think org-drill doesn't do spaced repetition ? I used it for a while in 2017, and it does. I've since moved to Anki on Android phone for the same purpose, because phones are accessible for longer, but was happy with org-drill.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Org mode repeated dates to do spaced learning
  2019-01-01 15:39 ` Bingo
@ 2019-01-01 16:34   ` Andrea Giugliano
  2019-01-02  4:59     ` Marcin Borkowski
  0 siblings, 1 reply; 6+ messages in thread
From: Andrea Giugliano @ 2019-01-01 16:34 UTC (permalink / raw)
  To: Bingo; +Cc: emacs-orgmode@gnu.org

Hi,

Thanks for your reply. You are right org-drill does spaced repetition. I
just was unclear: I would like to see that in the agenda as a normal
item (that gets space-repeated every time I mark it DONE though).
I could not get from the docs if org-drill does that.

Thanks,

Andrea

On Tue 01 Jan 2019 at 16:39, Bingo <right.ho@gmail.com> wrote:

> Le 1 janvier 2019 18:02:31 GMT+05:30, Andrea Giugliano <agiugliano@live.it> a écrit :
>>Happy 2019 everyone!
>>
>>I would like to slightly change my learning method this year. I have
>>heard that spaced learning is much better than bang your head against
>>the same material multiple times in a row.
>>
>>Spaced learning is simply reviewing some interesting topic at given
>>intervals: after 1 day, 1 week, 2 weeks, 1 month, 3 months, etc...
>>
>>It seems to me that org-mode does not support this: how would you make
>>a
>>repetitive task with spaced intervals?
>>
>>I saw org-drill.el, but I do not think it does this.
>>Ideally I could do something like:
>>
>>""
>>* review this interesting thing
>>SCHEDULED: <2019-01-01 Tue>
>>:PROPERTIES:
>>:SPACED:
>>:END:
>>""
>>
>>If this is not an interesting use case for org-mode, what do you think
>>about me trying to extend org-habits.el instead?
>>
>>Best wishes to all the community,
>>
>>Andrea
>
> Hi,
>    Why do you think org-drill doesn't do spaced repetition ? I used it for a while in 2017, and it does. I've since moved to Anki on Android phone for the same purpose, because phones are accessible for longer, but was happy with org-drill.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Org mode repeated dates to do spaced learning
  2019-01-01 16:34   ` Andrea Giugliano
@ 2019-01-02  4:59     ` Marcin Borkowski
  2019-01-06 17:17       ` Andrea Giugliano
  0 siblings, 1 reply; 6+ messages in thread
From: Marcin Borkowski @ 2019-01-02  4:59 UTC (permalink / raw)
  To: Andrea Giugliano; +Cc: emacs-orgmode@gnu.org, Bingo


On 2019-01-01, at 17:34, Andrea Giugliano <agiugliano@live.it> wrote:

> Hi,
>
> Thanks for your reply. You are right org-drill does spaced repetition. I
> just was unclear: I would like to see that in the agenda as a normal
> item (that gets space-repeated every time I mark it DONE though).
> I could not get from the docs if org-drill does that.

That is an interesting idea.  I am pretty sure you could make it happen
with `org-trigger-hook' or `org-after-todo-state-change-hook' (I am not
entirely sure why both exist, btw).

> Thanks,
>
> Andrea

Hth,

--
Marcin Borkowski
http://mbork.pl

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Org mode repeated dates to do spaced learning
  2019-01-02  4:59     ` Marcin Borkowski
@ 2019-01-06 17:17       ` Andrea Giugliano
  2019-01-07  9:19         ` Marcin Borkowski
  0 siblings, 1 reply; 6+ messages in thread
From: Andrea Giugliano @ 2019-01-06 17:17 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: emacs-orgmode@gnu.org, Bingo

Hi there,

That was a very helpful suggestion. At the bottom of the mail I attached
my first (working) stab at it.

The idea is to have an headline with the :spaced: tag and another tag
maintaining the number of repetition performed so far. At the beginning
I was thinking to use scheduled times instead of a "counter" tag, but it
was not worth the complexity of the code.

If anybody else finds this feature useful, what would be the best way
to share this?

#+begin_src elisp
(defun my/space-repeat-if-tag-spaced (e)
  "Resets the header on the TODO states and increases the scheduled date
according to a suggested spaced repetition interval."
  (let* ((spaced-rep-map '((0 . "++1d")
                          (1 . "++2d")
                          (2 . "++10d")
                          (3 . "++30d")
                          (4 . "++60d")
                          (5 . "++4m")))
         (spaced-key "spaced")
         (tags (org-get-tags nil t))
         (spaced-todo-p (member spaced-key tags))
         (repetition-n (first (cdr spaced-todo-p)))
         (n+1 (if repetition-n (+ 1 (string-to-number (substring repetition-n (- (length repetition-n) 1) (length repetition-n)))) 0))
         (spaced-repetition-p (alist-get n+1 spaced-rep-map))
         (new-repetition-tag (concat "repetition" (number-to-string n+1)))
         (new-tags (reverse (if repetition-n
                                (seq-reduce
                                 (lambda (a x) (if (string-equal x repetition-n) (cons new-repetition-tag a) (cons x a)))
                                 tags
                                 '())
                              (seq-reduce
                               (lambda (a x) (if (string-equal x spaced-key) (cons new-repetition-tag (cons x a)) (cons x a)))
                               tags
                               '())))))
    (if (and spaced-todo-p spaced-repetition-p)
      (progn
          ;; avoid infinitive looping
          (remove-hook 'org-trigger-hook 'my/space-repeat-if-tag-spaced)
          ;; reset to previous state
          (org-call-with-arg 'org-todo 'left)
          ;; schedule to next spaced repetition
          (org-schedule nil (alist-get n+1 spaced-rep-map))
          ;; rewrite local tags
          (org-set-tags new-tags)
          (add-hook 'org-trigger-hook 'my/space-repeat-if-tag-spaced))
        )))

(add-hook 'org-trigger-hook 'my/space-repeat-if-tag-spaced)
#+end_src


Thanks,

Andrea




On Wed 02 Jan 2019 at 05:59, Marcin Borkowski <mbork@mbork.pl> wrote:

> On 2019-01-01, at 17:34, Andrea Giugliano <agiugliano@live.it> wrote:
>
>> Hi,
>>
>> Thanks for your reply. You are right org-drill does spaced repetition. I
>> just was unclear: I would like to see that in the agenda as a normal
>> item (that gets space-repeated every time I mark it DONE though).
>> I could not get from the docs if org-drill does that.
>
> That is an interesting idea.  I am pretty sure you could make it happen
> with `org-trigger-hook' or `org-after-todo-state-change-hook' (I am not
> entirely sure why both exist, btw).
>
>> Thanks,
>>
>> Andrea
>
> Hth,

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Org mode repeated dates to do spaced learning
  2019-01-06 17:17       ` Andrea Giugliano
@ 2019-01-07  9:19         ` Marcin Borkowski
  0 siblings, 0 replies; 6+ messages in thread
From: Marcin Borkowski @ 2019-01-07  9:19 UTC (permalink / raw)
  To: Andrea Giugliano; +Cc: emacs-orgmode@gnu.org, Bingo


On 2019-01-06, at 18:17, Andrea Giugliano <agiugliano@live.it> wrote:

> Hi there,
>
> That was a very helpful suggestion. At the bottom of the mail I attached

Glad to have helped!

Best,

-- 
Marcin Borkowski
http://mbork.pl

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-01-07  9:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-01 12:32 Org mode repeated dates to do spaced learning Andrea Giugliano
2019-01-01 15:39 ` Bingo
2019-01-01 16:34   ` Andrea Giugliano
2019-01-02  4:59     ` Marcin Borkowski
2019-01-06 17:17       ` Andrea Giugliano
2019-01-07  9:19         ` Marcin Borkowski

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).