|
From: | Scott Jaderholm |
Subject: | Re: [Orgmode] adding more color to agenda events |
Date: | Thu, 1 Mar 2007 10:43:01 -0700 |
On Feb 27, 2007, at 22:30, Scott Jaderholm wrote:
> Hi,
>
> Is there an easy way to add new faces to org-agenda?
>
> I would like to add a face for events including the text "meeting" or
> "birthday" and other phrases. I'd also like to create a special face
> for event subjects, such as Diary, life, or work (the first column in
> agenda). It'd also be nice to be able to do faces based on tags.
>
> Is this possible without a lot of hacking?
There is special way of doing this. In particular, the agenda does
*not* use font-lock, it sets its own faces.
However, there is a hook you can use, and the code to write for it
is relatuvely simple. For example:
(add-hook 'org-finalize-agenda-hook
(lambda ()
(save-excursion
(goto-char (point-min))
(while (re-search-forward "\\<birthday\\> " nil t)
(add-text-properties (match-beginning 0) (match-end 0)
'(face secondary-selection)))
(goto-char (point-min))
(while (re-search-forward "\\<meeting\\> " nil t)
(add-text-properties (match-beginning 0) (match-end 0)
'(face bold))))))
[Prev in Thread] | Current Thread | [Next in Thread] |