I just started to get into using emacs org-mode, and was wondering if this is possible. I put the scheduled in brackets in the title as I am not specifically interested only in timestamps which are "scheduled" in an org-mode sense, but was hoping this would work with any timestamp. I imagine that I include something like the following in my .emacs
(setq org-log-note-headings '((state . "%s %t for %Q")))
where %Q
should represent the day the task was actually scheduled, but have no idea what I would have to use here (and if this is possible at all). In the org file I would then have a entry like
* TODO My task
Next occurrence:
<2015-10-02 Fri +1d>
which should when changing the state to DONE change to
* TODO My task
- "DONE" [2015-09-30] for <2015-10-02 Fri>
Notes on this...
Next occurrence:
<2015-10-03 Sat +1d>
An alternative I would also be happy with would be to have a function that shifts a recurring time stamp once by its rule (so in this case by one day) and inserts the corresponding note at the beginning so which would simply change the first example to
* TODO My task
- <2015-10-02> ...
Next occurrence:
<2015-10-03 Sat +1d>
but here I have no idea how to start... Any suggestions appreciated.
Update: Ok, based on this: How to make org prompt for a timestamp, when changing state of a TODO?
I achieved a behaviour close to what I was looking for, using two functions
(defun org-todo-with-deadline (&optional arg)
(interactive "P")
(cl-letf* ((my-current-time (org-get-deadline-time nil))
((symbol-function #'org-current-effective-time)
#'(lambda () my-current-time)))
(org-todo arg)
))
(defun org-todo-with-schedule (&optional arg)
(interactive "P")
(cl-letf* ((my-current-time (org-get-scheduled-time nil))
((symbol-function #'org-current-effective-time)
#'(lambda () my-current-time)))
(org-todo arg)
))
at least this works for SCHEDULED and DEADLINE marked entries, respectively. The downside is that it is not possible anymore to include the date when the state is changed (because this is temporally overwritten here) and it does not work with plain timestamps.