From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Hide tasks from the agenda until they are due Date: Mon, 9 Nov 2009 22:10:48 +0100 Message-ID: <6BCE52EE-DE9C-4CE9-84F5-DAAA72A8F2DD@gmail.com> References: Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N7bVp-0008Dy-UV for emacs-orgmode@gnu.org; Mon, 09 Nov 2009 16:10:57 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N7bVl-0008Bx-Bb for emacs-orgmode@gnu.org; Mon, 09 Nov 2009 16:10:57 -0500 Received: from [199.232.76.173] (port=46609 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7bVl-0008Br-2X for emacs-orgmode@gnu.org; Mon, 09 Nov 2009 16:10:53 -0500 Received: from mail-ew0-f228.google.com ([209.85.219.228]:52790) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N7bVk-0006dj-MV for emacs-orgmode@gnu.org; Mon, 09 Nov 2009 16:10:52 -0500 Received: by ewy28 with SMTP id 28so4639121ewy.42 for ; Mon, 09 Nov 2009 13:10:51 -0800 (PST) In-Reply-To: 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: PT Cc: emacs-orgmode@gnu.org Looks like a snippet that should go up on the FAQ or maybe in org- hacks.org? Thanks for sharing! - Carsten On Nov 8, 2009, at 6:17 PM, PT wrote: > 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. > > > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten