From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Lohmar Subject: [PATCH] Nicer fontification for org-todo-list Date: Fri, 2 Nov 2012 17:47:19 +0000 (UTC) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TULLF-0000WO-81 for emacs-orgmode@gnu.org; Fri, 02 Nov 2012 13:47:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TULLE-000485-17 for emacs-orgmode@gnu.org; Fri, 02 Nov 2012 13:47:37 -0400 Received: from plane.gmane.org ([80.91.229.3]:48243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TULLD-00047q-Rb for emacs-orgmode@gnu.org; Fri, 02 Nov 2012 13:47:35 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TULLI-00039K-Rm for emacs-orgmode@gnu.org; Fri, 02 Nov 2012 18:47:40 +0100 Received: from koln-4d0b496a.pool.mediaWays.net ([77.11.73.106]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 02 Nov 2012 18:47:40 +0100 Received: from i.lohmar by koln-4d0b496a.pool.mediaWays.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 02 Nov 2012 18:47:40 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.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. Regards, Ingo ----- --- 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 "ALL")))) (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]")