Hi Andrew !
Sorry, but I forgot to include one line:
(setq org-date-state-wait-state "PENDING")
to define the state, that the node should be changed to
(I have "PENDING" among my org-states).
Now if I have a node like this:
* TODO Foo
and invoke org-date-state, I get asked for a date (lets assume,
that I answer tomorrow) and the node changes like this:
* PENDING Foo
CLOSED: [2013-01-26 Sa 18:36]
:PROPERTIES:
:DATE_STATE: [2013-01-27 So] TODO
:END:
Now, if on sunday or later I invoke org-date-state with a prefix argument,
the node changes back to its original state.
Hope you can reproduce that behaviour and find it useful ...
best regards, Marc
Am 24.01.2013 21:09, schrieb Marc-Oliver Ihm:
Hi Andrew,
some time ago I did somethin similar (see below), it works with properties and
might
come close, to what you want ...
best regards, Marc
(defun org-date-state (arg)
"Save away state for current node; with prefix restore for all nodes if time has
passed."
(interactive "P")
(if arg
(progn
(let ((today (format-time-string
(substring (car org-time-stamp-formats) 1 -1)))
(nvisited 0)
(nchanged 0))
(message "Scanning...")
(org-map-entries
(lambda ()
(let
((date_state (org-entry-get nil "DATE_STATE"))
date state)
(incf nvisited)
(when date_state
(unless (string-match (concat "\\["
org-ts-regexp1
"\\] \\("
(regexp-opt org-todo-keywords-1)
"\\)")
date_state)
(error "Property DATE_STATE ('%s') does not consist of date and
todo keyword !"
date_state))
(setq date (match-string 1 date_state))
(setq state (match-string 9 date_state))
(unless (string< today date)
(org-todo state)
(org-delete-property "DATE_STATE")
(search-forward-regexp org-property-start-re)
(org-remove-empty-drawer-at "PROPERTIES" (point))
(incf nchanged)))))
nil 'agenda)
(message "Visited %d entries and changed %d of them" nvisited
nchanged)))
(org-entry-put nil "DATE_STATE"
(concat
(format-time-string
(org-time-stamp-format nil t)
(org-read-date nil t))
" "
(org-get-todo-state)))
(org-todo org-date-state-wait-state)))
Am 21.01.2013 19:20, schrieb Andrew M. Nuxoll:
A while ago I posted for help in adding an ability to "snooze" a to-do item:
http://www.mail-archive.com/emacs-orgmode@gnu.org/msg20114.html
At the time, the only solution available was to create a manual copy of the
item. This approach creates as many problems as it solves for me. I've gotten
so frustrated with this that I'm really to knuckle under and fix it myself.
I'd like to modify the org-mode code to support the following:
1. Add a date tag to an entry that indicates that it is "inactive" until a
certain date. I'm picturing something like this:
***** TODO [#B] Verify login to the virtual machines
SCHEDULED: <2013-01-11 Tue +1w> DELAY: <2013-01-24 Thu>
2. Add a command similar to org-deadline that I can use to attach a delay date
to a to-do item
3. When I display my agenda, items that are delayed are not displayed.
My e-lisp is pretty rusty so *any* advice or help is great. Could someone help
point me to the right files and functions I'll need to modify to accomplish
this?
Thanks,
Andrew