[Top][All Lists]

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

[O] [PATCH] Nicer fontification for org-todo-list

From: Ingo Lohmar
Subject: [O] [PATCH] Nicer fontification for org-todo-list
Date: Fri, 2 Nov 2012 17:47:19 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Hi all,

recently I was bothered by a very minor thing in my custom agenda:
the headline showing the keywords is always using the "warning" face
for the selected keyword(s), instead of the proper faces used to
display to them everywhere else.  Attached is a patch that changes
this that should work under all conditions as far as I can see (and
tested).  Do you think this is useful?  I feel it is the right thing
(TM) to do.

I used a separate function for the propertization (is that a word?),
in case it might become useful elsewhere --- feel free to refactor
this to your liking.  I would be happy to see this change applied.

Standard disclaimer: Not using the git version, but works in the elpa
version from last night.



--- org-agenda-orig.el  2012-11-02 18:26:43.848678550 +0100
+++ org-agenda.el       2012-11-02 18:43:23.377778537 +0100
@@ -4490,6 +4490,17 @@
 ;;; Agenda TODO list
+(defun org-propertize-todo-keyword-list (keywords)
+  (concat
+   (if (or (equal keywords "ALL") (not keywords))
+       (propertize "ALL" 'face 'warning)
+     (mapconcat
+      (lambda (kw)
+        (propertize kw 'face (org-get-todo-face kw)))
+      (org-split-string keywords "|")
+      "|"))
+   "\n"))
 (defvar org-select-this-todo-keyword nil)
 (defvar org-last-arg nil)
@@ -4550,9 +4561,7 @@
                                   (concat "ToDo: "
                                           (or org-select-this-todo-keyword 
        (org-agenda-mark-header-line (point-min))
-       (setq pos (point))
-       (insert (or org-select-this-todo-keyword "ALL") "\n")
-       (add-text-properties pos (1- (point)) (list 'face 'org-warning))
+       (insert (org-propertize-todo-keyword-list org-select-this-todo-keyword))
        (setq pos (point))
        (unless org-agenda-multi
          (insert "Available with `N r': (0)[ALL]")

reply via email to

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