On Nov 8, 2010, at 1:28 PM, Julien Danjou wrote:
On Mon, Nov 08 2010, Carsten Dominik wrote:
can you please rename org-agenda-today to org-agenda-today-p?
I think it would make its use clearer.
I think you misread the function. I've added org-agenda-today which
returns today, and just rewrite org-agenda-todayp to use that one.
Yes, you are right. Sorry about that.
Also, couly you please specify in the docstring of org-agenda-day-
face-
function how the day is coming in into the user-defined function?
As a day
number or a calendar date list?
It's a calendar date list.
Updated patch attached.
Thanks!
- Carsten
From e59409e447f18d92eca9c8faf271901c437746ff Mon Sep 17 00:00:00 2001
From: Julien Danjou <jul...@danjou.info>
Date: Mon, 8 Nov 2010 18:23:07 +0100
Subject: [PATCH] org-agenda: add org-agenda-day-face-function
* lisp/org-agenda.el (org-agenda-day-face-function): New variable.
(org-agenda-get-day-face): Use org-agenda-day-face-function.
Signed-off-by: Julien Danjou <jul...@danjou.info>
---
lisp/org-agenda.el | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 98371e6..aba85eb 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -1433,6 +1433,14 @@ determines if it is a foreground or a
background color."
(string :tag "Color")
(sexp :tag "Face"))))))
+(defcustom org-agenda-day-face-function nil
+ "Function called to determine what face should be used to display
a day.
+The only argument passed to that function is the day in the
+calendar date list format. It should returns a face, or nil if it
+does not want to specify a face and let the normal rules apply."
+ :group 'org-agenda-line-format
+ :type 'function)
+
(defcustom org-agenda-category-icon-alist nil
"Alist of category icon to be displayed in agenda views.
@@ -3108,11 +3116,13 @@ no longer in use."
(defun org-agenda-get-day-face (date)
"Return the face DATE should be displayed with."
- (cond ((org-agenda-todayp date)
- 'org-agenda-date-today)
- ((member (calendar-day-of-week date) org-agenda-weekend-days)
- 'org-agenda-date-weekend)
- (t 'org-agenda-date)))
+ (or (and (functionp org-agenda-day-face-function)
+ (funcall org-agenda-day-face-function date))
+ (cond ((org-agenda-todayp date)
+ 'org-agenda-date-today)
+ ((member (calendar-day-of-week date) org-agenda-weekend-days)
+ 'org-agenda-date-weekend)
+ (t 'org-agenda-date))))
;;; Agenda timeline
--
1.7.2.3
--
Julien Danjou
// ᐰ <jul...@danjou.info> http://julien.danjou.info
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode