all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Hide tasks from the agenda until they are due
@ 2009-11-08 17:17 PT
  2009-11-09 21:10 ` Carsten Dominik
  0 siblings, 1 reply; 2+ messages in thread
From: PT @ 2009-11-08 17:17 UTC (permalink / raw)
  To: emacs-orgmode

In a previous thread
(http://thread.gmane.org/gmane.emacs.orgmode/17818) there was a
discussion about using the agenda to schedule trivial time-specific
tasks during the day which can be done at or after a certain
time. These tasks should be hidden from the agenda until their time is
due, because you cannot work on them before then, so they are just
polluting the agenda view.

Matt Lundin kindly provided a quick untested solution in that thread
which was almost complete, it needed only a bit of tweaking. Here is 
the working solution (not yes extensively tested) for those interested:


    (defun my-org-agenda-skip-if-later ()
      "Skip entries that are later than the current time."
      (let ((time (and (org-entry-get nil "TIME-TODO")
                       (or (org-entry-get nil "TIMESTAMP")
                           (org-entry-get nil "SCHEDULED")))))
        (when time
          (unless (time-less-p (org-time-string-to-time time) (current-time))
            (or (outline-next-heading)
                (point-max))))))

    (setq org-agenda-skip-function 'my-org-agenda-skip-if-later)


The tasks to be hidden need to have a special property set (TIME-TODO)
in order to distinguish them from regular timestamps which are not hidden. 
I added this property to my remember template, so it's automatically 
set when I create such a task.

I set the skip function globally, because I use a single agenda view. You
may want to set it only for certain agenda views.

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

end of thread, other threads:[~2009-11-09 21:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-08 17:17 Hide tasks from the agenda until they are due PT
2009-11-09 21:10 ` Carsten Dominik

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.