From mboxrd@z Thu Jan 1 00:00:00 1970 From: PT Subject: Hide tasks from the agenda until they are due Date: Sun, 8 Nov 2009 17:17:39 +0000 (UTC) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N7BPA-00080x-7o for emacs-orgmode@gnu.org; Sun, 08 Nov 2009 12:18:20 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N7BP5-0007yJ-LL for emacs-orgmode@gnu.org; Sun, 08 Nov 2009 12:18:19 -0500 Received: from [199.232.76.173] (port=56721 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7BP5-0007yA-Gz for emacs-orgmode@gnu.org; Sun, 08 Nov 2009 12:18:15 -0500 Received: from lo.gmane.org ([80.91.229.12]:43117) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N7BP5-0001st-3o for emacs-orgmode@gnu.org; Sun, 08 Nov 2009 12:18:15 -0500 Received: from list by lo.gmane.org with local (Exim 4.50) id 1N7BP0-00045h-4W for emacs-orgmode@gnu.org; Sun, 08 Nov 2009 18:18:10 +0100 Received: from 94-21-239-125.pool.digikabel.hu ([94.21.239.125]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 08 Nov 2009 18:18:10 +0100 Received: from spamfilteraccount by 94-21-239-125.pool.digikabel.hu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 08 Nov 2009 18:18:10 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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.