emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <dominik@science.uva.nl>
To: Scott Jaderholm <jaderholm@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: adding more color to agenda events
Date: Wed, 28 Feb 2007 09:58:14 +0100	[thread overview]
Message-ID: <286a22d00313775b9b71f6b0e93d4f0b@science.uva.nl> (raw)
In-Reply-To: <b2e202b30702271330g5e6376a8md6017518865d3b9f@mail.gmail.com>


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

  reply	other threads:[~2007-02-28  9:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-27 21:30 adding more color to agenda events Scott Jaderholm
2007-02-28  8:58 ` Carsten Dominik [this message]
2007-03-01 17:43   ` Scott Jaderholm
2007-03-03 15:33     ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=286a22d00313775b9b71f6b0e93d4f0b@science.uva.nl \
    --to=dominik@science.uva.nl \
    --cc=emacs-orgmode@gnu.org \
    --cc=jaderholm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).