emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Still Wishing for Snooze


From: Marc-Oliver Ihm
Subject: Re: [O] Still Wishing for Snooze
Date: Thu, 24 Jan 2013 21:09:25 +0100
User-agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2

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/address@hidden/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






reply via email to

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