emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] adding more color to agenda events


From: Carsten Dominik
Subject: Re: [Orgmode] adding more color to agenda events
Date: Wed, 28 Feb 2007 09:58:14 +0100


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))))))




Thanks,
Scott
_______________________________________________
Emacs-orgmode mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


--
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]