From: Julien Danjou <julien@danjou.info>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH 2/2] org-agenda: add org-agenda-day-face-function
Date: Fri, 12 Nov 2010 16:50:14 +0100 [thread overview]
Message-ID: <sa38w0ybky1.fsf@cigue.easter-eggs.fr> (raw)
In-Reply-To: <A61F3511-EB52-480C-A4C2-6A6B5E7A2308@gmail.com> (Carsten Dominik's message of "Fri, 12 Nov 2010 09:43:03 -0600")
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
// ᐰ <julien@danjou.info> http://julien.danjou.info
next prev parent reply other threads:[~2010-11-12 15:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-08 17:23 [PATCH 1/2] org-agenda: introduce org-agenda-today and org-agenda-get-day-face Julien Danjou
2010-11-08 17:23 ` [PATCH 2/2] org-agenda: add org-agenda-day-face-function Julien Danjou
2010-11-12 15:30 ` Carsten Dominik
2010-11-12 15:34 ` Julien Danjou
2010-11-12 15:43 ` Carsten Dominik
2010-11-12 15:50 ` Julien Danjou [this message]
2010-11-08 18:34 ` [PATCH 1/2] org-agenda: introduce org-agenda-today and org-agenda-get-day-face Carsten Dominik
2010-11-08 19:28 ` Julien Danjou
2010-11-08 19:59 ` Carsten Dominik
2010-11-09 10:59 ` Julien Danjou
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=sa38w0ybky1.fsf@cigue.easter-eggs.fr \
--to=julien@danjou.info \
--cc=carsten.dominik@gmail.com \
--cc=emacs-orgmode@gnu.org \
/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).