emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Marc-Oliver Ihm <marc@ihm.name>
To: "Andrew M. Nuxoll" <nuxoll@up.edu>, emacs-orgmode@gnu.org
Subject: Re: Still Wishing for Snooze
Date: Thu, 24 Jan 2013 21:09:25 +0100	[thread overview]
Message-ID: <510194F5.50205@ihm.name> (raw)
In-Reply-To: <50FD86D4.8080105@up.edu>

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

  parent reply	other threads:[~2013-01-24 20:09 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-21 18:20 Still Wishing for Snooze Andrew M. Nuxoll
2013-01-23 10:42 ` Samuel Loury
2013-01-23 19:00   ` Andrew M. Nuxoll
2013-01-23 13:36 ` Bastien
2013-01-24 18:49   ` Andrew M. Nuxoll
2013-01-24 22:26     ` Bastien
2013-01-24 22:54       ` Andrew M. Nuxoll
2013-01-25  1:20         ` Eric S Fraga
2013-01-25 10:45         ` Bastien
2013-01-25 19:48           ` Andrew M. Nuxoll
2013-02-07  9:44             ` Bastien
2013-02-07 15:25               ` Michael Brand
2013-02-09 18:06                 ` Samuel Loury
2013-02-09 20:50                   ` Michael Brand
2013-02-12 10:21                 ` Bastien
2013-02-12 12:29                   ` Michael Brand
2013-02-12 13:24                     ` Michael Brand
2013-02-12 15:57                     ` Bastien
2013-02-12 16:33                     ` Bastien
2013-02-12 18:09                       ` Michael Brand
2013-02-13 11:09                   ` Samuel Loury
2013-02-13 11:14                     ` Bastien
2013-02-12 22:35               ` Andrew M. Nuxoll
2013-01-25 11:10         ` Michael Brand
2013-01-25 19:30           ` Andrew M. Nuxoll
2013-02-07 15:24           ` Michael Brand
2013-01-23 15:49 ` Michael Brand
2013-01-23 18:51   ` Andrew M. Nuxoll
2013-01-23 19:37     ` Michael Brand
2013-01-24 20:09 ` Marc-Oliver Ihm [this message]
2013-01-26 17:40   ` Marc-Oliver Ihm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=510194F5.50205@ihm.name \
    --to=marc@ihm.name \
    --cc=emacs-orgmode@gnu.org \
    --cc=nuxoll@up.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).