From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin Svenson Subject: Visual indication on unscheduled TODOs Date: Wed, 1 Dec 2010 21:29:26 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0631225592==" Return-path: Received: from [140.186.70.92] (port=38051 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PNtIy-0005qU-Qs for emacs-orgmode@gnu.org; Wed, 01 Dec 2010 15:29:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PNtIx-0000EO-29 for emacs-orgmode@gnu.org; Wed, 01 Dec 2010 15:29:32 -0500 Received: from mail-wy0-f169.google.com ([74.125.82.169]:37856) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PNtIw-0000EF-Ok for emacs-orgmode@gnu.org; Wed, 01 Dec 2010 15:29:30 -0500 Received: by wyb39 with SMTP id 39so43625wyb.0 for ; Wed, 01 Dec 2010 12:29:29 -0800 (PST) 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 --===============0631225592== Content-Type: multipart/alternative; boundary=0016e65b60fe794a4f04965f29e4 --0016e65b60fe794a4f04965f29e4 Content-Type: text/plain; charset=ISO-8859-1 Hi (this is my first post), I'm trying to get a visual hint that a certain TODO is unscheduled, so that I can immediately see this when I go through the outline during regular reviews. My first strategy was to try and add a font-lock hook to achieve this multiline font-lock behaviour: See http://paste.lisp.org/+2IFV However, this failed. I presume my added faces are being overwritten by org-mode since the hook is being called before org-mode writes the faces. What could I do about that? My second option was to write an interactive function: (defun org-mark-unscheduled () (interactive) (save-excursion (goto-char (point-min)) (while (re-search-forward org-complex-heading-regexp nil t) (let* ((state (match-string 2)) (state-start (match-beginning 2)) (state-end (match-end 2)) (scheduled (org-entry-get nil "SCHEDULED")) (deadline (org-entry-get nil "DEADLINE"))) (when (and (not scheduled) state-start state-end) (overlay-put (make-overlay state-start state-end) 'face 'org-todo-scheduled)))))) This works quite well but I get the nagging feeling I'm going about this the wrong way. Surely, being able to see which items are due for scheduling is a common task? (I do note that I could search for them, but then I would not have the context of the actually scheduled tasks in the same view...) Regards, Martin --0016e65b60fe794a4f04965f29e4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi (this is my first post),

I'm trying to get a visual hint that= a certain TODO is unscheduled, so that I can immediately see this when I g= o through the outline during regular reviews.

My first strategy was = to try and add a font-lock hook to achieve this multiline font-lock behavio= ur:

See
http://paste.lisp.org/+2= IFV

However, this failed. I presume my added faces are being ove= rwritten by org-mode since the hook is being called before org-mode writes = the faces. What could I do about that?

My second option was to write an interactive function:

(defun or= g-mark-unscheduled ()
=A0 (interactive)=A0
=A0 (save-excursion
= =A0=A0=A0 (goto-char (point-min))
=A0=A0=A0 (while (re-search-forward or= g-complex-heading-regexp nil t)
=A0=A0=A0=A0=A0 (let* ((state (match-string 2))=A0=A0=A0
=A0=A0=A0 =A0= =A0=A0=A0 (state-start (match-beginning 2))
=A0=A0=A0 =A0=A0=A0=A0 (stat= e-end (match-end 2))
=A0=A0=A0 =A0=A0=A0=A0 (scheduled (org-entry-get ni= l "SCHEDULED"))
=A0=A0=A0 =A0=A0=A0=A0 (deadline (org-entry-ge= t nil "DEADLINE")))
=A0=A0=A0 (when (and (not scheduled) state-start state-end)
=A0=A0=A0 = =A0 (overlay-put
=A0=A0=A0 =A0=A0 (make-overlay state-start state-end)=A0=A0=A0 =A0=A0 'face 'org-todo-scheduled))))))

This work= s quite well but I get the nagging feeling I'm going about this the wro= ng way. Surely, being able to see which items are due for scheduling is a c= ommon task? (I do note that I could search for them, but then I would not h= ave the context of the actually scheduled tasks in the same view...)

Regards,
Martin
--0016e65b60fe794a4f04965f29e4-- --===============0631225592== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0631225592==--