From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: todo and deadline highlighting Date: Tue, 20 Jun 2006 09:09:39 +0200 Message-ID: <51495e013973953fee5ddac4741cd7a2@science.uva.nl> References: <3c12eb8d0606071634k6bdcf44dh37207ab742221d2f@mail.gmail.com> <8d4e5559aac3ee21d130dd05102c89f7@science.uva.nl> <3c12eb8d0606191309m24dc4cd3p7c73f14229a17f09@mail.gmail.com> Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FsaMp-0004c4-SW for emacs-orgmode@gnu.org; Tue, 20 Jun 2006 03:09:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FsaMm-0004XX-Uf for emacs-orgmode@gnu.org; Tue, 20 Jun 2006 03:09:43 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FsaMm-0004XL-Oe for emacs-orgmode@gnu.org; Tue, 20 Jun 2006 03:09:40 -0400 Received: from [194.134.35.144] (helo=smtp04.wanadoo.nl) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FsaXF-0003vc-TR for emacs-orgmode@gnu.org; Tue, 20 Jun 2006 03:20:30 -0400 In-Reply-To: <3c12eb8d0606191309m24dc4cd3p7c73f14229a17f09@mail.gmail.com> 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: Piotr Zielinski Cc: emacs-orgmode@gnu.org This looks like it is doing the right thing. - Carsten On Jun 19, 2006, at 22:09, Piotr Zielinski wrote: > On 12/06/06, Carsten Dominik wrote: > >> On Jun 8, 2006, at 1:34, Piotr Zielinski wrote: >> >> > The following two functions redefine org-show-todo-tree, so that >> TODO >> > items SCHEDULED for the future are not highlighted. Only >> > non-scheduled TODO items or TODO items scheduled for the past or >> > present are highlighted. The SCHEDULED directive must be on the >> same >> > line as the TODO keyword. >> >> This is another interesting idea, but the search must allow more than >> the current line. Everything up to the next headline (or any level) >> should be searched. > > Another try: > > (defun org-todo-is-current () > "Checks whether a TODO item is current." > (if (re-search-forward org-scheduled-time-regexp > (save-excursion (outline-next-heading) (point)) t) > (let ((today (calendar-absolute-from-gregorian > (calendar-current-date))) > (timestamp (time-to-days > (org-time-string-to-time (match-string 1))))) > (<= timestamp today)) > t)) > > > Piotr > > -- Carsten Dominik Sterrenkundig Instituut "Anton Pannekoek" Universiteit van Amsterdam Kruislaan 403 NL-1098SJ Amsterdam phone: +31 20 525 7477