From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Piotr Zielinski" Subject: Re: todo and deadline highlighting Date: Mon, 19 Jun 2006 21:09:51 +0100 Message-ID: <3c12eb8d0606191309m24dc4cd3p7c73f14229a17f09@mail.gmail.com> References: <3c12eb8d0606071634k6bdcf44dh37207ab742221d2f@mail.gmail.com> <8d4e5559aac3ee21d130dd05102c89f7@science.uva.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FsQ4J-0007VW-6g for emacs-orgmode@gnu.org; Mon, 19 Jun 2006 16:09:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FsQ4G-0007VF-OU for emacs-orgmode@gnu.org; Mon, 19 Jun 2006 16:09:53 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FsQ4G-0007VC-In for emacs-orgmode@gnu.org; Mon, 19 Jun 2006 16:09:52 -0400 Received: from [64.233.162.193] (helo=nz-out-0102.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FsQEd-0004za-FE for emacs-orgmode@gnu.org; Mon, 19 Jun 2006 16:20:35 -0400 Received: by nz-out-0102.google.com with SMTP id 18so1076531nzp for ; Mon, 19 Jun 2006 13:09:51 -0700 (PDT) In-Reply-To: <8d4e5559aac3ee21d130dd05102c89f7@science.uva.nl> Content-Disposition: inline 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: Carsten Dominik Cc: emacs-orgmode@gnu.org 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