[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-orgmode] todo and deadline highlighting

From: Carsten Dominik
Subject: Re: [Emacs-orgmode] todo and deadline highlighting
Date: Mon, 12 Jun 2006 23:16:01 +0200

Hi Piotr,

On Jun 8, 2006, at 1:34, Piotr Zielinski wrote:

It would be nice to be able to tell the org-occur function not to
remove existing highlights in a less hacky way.

In the next version, you can warp your call into

 (let *(org-inhibit-highlight-removal t))

  Another suggestion:
explicit specification of the face used for highlighting so that
deadlines and todos could use a different face.  Yet another
suggestion: the org-occur callback could return the face to use, so
that different faces could be used for deadline highlighting,
depending on the urgency of the deadline (ie. in 3 days vs. in 30

Suggestion noted - maybe at a later time.  Thanks

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.

- Carsten

(defun org-todo-is-current ()
 "Checks whether a TODO items is current."
 (if (re-search-forward org-scheduled-time-regexp (point-at-eol) t)
     (let ((today (calendar-absolute-from-gregorian
            (timestamp (time-to-days
                        (org-time-string-to-time (match-string 1)))))
        (<= timestamp today))

(defun org-show-todo-tree (arg)
 "Make a compact tree which shows all headlines marked with TODO.
The tree will show the lines where the regexp matches, and all higher
headlines above the match.
With \\[universal-argument] prefix, also show the DONE entries.
With a numeric prefix N, construct a sparse tree for the Nth element
of `org-todo-keywords'."
 (interactive "P")
 (let ((case-fold-search nil)
         (cond ((null arg) org-not-done-regexp)
               ((equal arg '(4)) org-todo-regexp)
               ((<= (prefix-numeric-value arg) (length org-todo-keywords))
                (regexp-quote (nth (1- (prefix-numeric-value arg))
               (t (error "Invalid prefix argument: %s" arg)))))
   (message "%d TODO entries found"
             (org-occur (concat "^" outline-regexp " +" kwd-re )


Emacs-orgmode mailing list

Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

reply via email to

[Prev in Thread] Current Thread [Next in Thread]