From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: How to change color of (part of) agenda header Date: Tue, 05 Aug 2014 18:08:18 -0400 Message-ID: <87bnrysi7h.fsf@alphaville.bos.redhat.com> References: <86wqamocme.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEmuP-0004KG-DF for emacs-orgmode@gnu.org; Tue, 05 Aug 2014 18:08:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEmuI-0002ve-Br for emacs-orgmode@gnu.org; Tue, 05 Aug 2014 18:08:40 -0400 Received: from plane.gmane.org ([80.91.229.3]:52088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEmuI-0002ul-5d for emacs-orgmode@gnu.org; Tue, 05 Aug 2014 18:08:34 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XEmuG-0008SV-QV for emacs-orgmode@gnu.org; Wed, 06 Aug 2014 00:08:32 +0200 Received: from nat-pool-bos-t.redhat.com ([66.187.233.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 06 Aug 2014 00:08:32 +0200 Received: from ndokos by nat-pool-bos-t.redhat.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 06 Aug 2014 00:08:32 +0200 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 Sebastien Vauban writes: > Hello, > > I'm trying to get part of the agenda header in another color, here > "TODAY": > > (add-to-list 'org-agenda-custom-commands > `("f" "Today" > (;; list of all TODO entries with deadline today > (tags-todo "DEADLINE=\"<+0d>\"" > ((org-agenda-overriding-header > (concat "DUE " #("TODAY" 0 4 (face (:foreground "red"))))) > (org-agenda-skip-function > '(org-agenda-skip-entry-if 'notdeadline))))) > ((org-agenda-format-date ""))) t) > > The goal is to make what's unique and different from the next agenda > blocks very outstanding. > > Though, it does not work: text is simply copied, as if text properties > did not exist. > > Am I missing something, or writing it in a buggy way? > The limits should be 0 and 5 to get the whole word, but that's not the problem here: if you do C-c a f to display the agenda and then do C-u C-x = on (say) the T of "Today", you will see that the face is org-agenda-structure. Doing a grep for that in the org lisp directory will quickly lead you to this: ,---- | (if org-agenda-overriding-header | (insert (org-add-props (copy-sequence org-agenda-overriding-header) | nil 'face 'org-agenda-structure) "\n") `---- so it doesn't matter what face property the header had to begin with: what is inserted into the buffer is given a different face property. -- Nick