[Top][All Lists]

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

Re: [Orgmode] [PATCH 2/2] org-agenda: add org-agenda-day-face-function

From: Julien Danjou
Subject: Re: [Orgmode] [PATCH 2/2] org-agenda: add org-agenda-day-face-function
Date: Fri, 12 Nov 2010 16:50:14 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

On Fri, Nov 12 2010, Carsten Dominik wrote:

> Applied, thanks.
> I did not test it myself (have grown to trust Julien...), so if someone can
> put this to a test, that would be nice.

Thanks Carsten.

If people wants to try it, here's an example of what I'm using to mark
days as holidays using the weekend face.

The function tests the category of all entries from all my Org files,
and if the category is "Holidays" or "Vacation", I return the face used
for weekend days. With that I quickly see I can stay at home and hack on
org-mode. :-)

(setq org-agenda-day-face-function
      (defun jd:org-agenda-day-face-holidays-function (date)
        "Compute DATE face for holidays."
        (unless (org-agenda-todayp date)
          (dolist (file (org-agenda-files nil 'ifmode))
            (let ((face
                   (dolist (entry (org-agenda-get-day-entries file date))
                     (let ((category (with-temp-buffer
                                       (insert entry)
                                       (org-get-category (point-min)))))
                       (when (or (string= "Holidays" category)
                                 (string= "Vacation" category))
                         (return 'org-agenda-date-weekend))))))
              (when face (return face)))))))

Julien Danjou
// ᐰ <address@hidden>   http://julien.danjou.info

reply via email to

[Prev in Thread] Current Thread [Next in Thread]