From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: adding more color to agenda events Date: Wed, 28 Feb 2007 09:58:14 +0100 Message-ID: <286a22d00313775b9b71f6b0e93d4f0b@science.uva.nl> References: Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HMLZt-0002dm-Bh for emacs-orgmode@gnu.org; Wed, 28 Feb 2007 04:58:29 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HMLZp-0002bZ-Oo for emacs-orgmode@gnu.org; Wed, 28 Feb 2007 04:58:28 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HMLZp-0002bT-I3 for emacs-orgmode@gnu.org; Wed, 28 Feb 2007 04:58:25 -0500 Received: from korteweg.uva.nl ([146.50.98.70]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HMLZp-0006X1-2A for emacs-orgmode@gnu.org; Wed, 28 Feb 2007 04:58:25 -0500 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Scott Jaderholm Cc: emacs-orgmode@gnu.org 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 "\\ " nil t) (add-text-properties (match-beginning 0) (match-end 0) '(face secondary-selection))) (goto-char (point-min)) (while (re-search-forward "\\ " nil t) (add-text-properties (match-beginning 0) (match-end 0) '(face bold)))))) > > Thanks, > Scott > _______________________________________________ > Emacs-orgmode mailing list > Emacs-orgmode@gnu.org > 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