From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH 1/2] org-agenda: introduce org-agenda-today and org-agenda-get-day-face Date: Mon, 8 Nov 2010 13:59:02 -0600 Message-ID: <56FE3081-C6E5-43AC-B81C-E05F3654885E@gmail.com> References: <1289236987-21552-1-git-send-email-julien@danjou.info> <629899F4-DD71-4710-8492-367FB443A0DB@gmail.com> <87vd47fwdk.fsf@keller.adm.naquadah.org> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=55724 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PFXrw-0000yb-QI for emacs-orgmode@gnu.org; Mon, 08 Nov 2010 14:59:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PFXru-0001KB-OP for emacs-orgmode@gnu.org; Mon, 08 Nov 2010 14:59:08 -0500 Received: from mail-gy0-f169.google.com ([209.85.160.169]:33742) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PFXru-0001K1-L7 for emacs-orgmode@gnu.org; Mon, 08 Nov 2010 14:59:06 -0500 Received: by gyd8 with SMTP id 8so4050392gyd.0 for ; Mon, 08 Nov 2010 11:59:06 -0800 (PST) In-Reply-To: <87vd47fwdk.fsf@keller.adm.naquadah.org> 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: Julien Danjou Cc: emacs-orgmode@gnu.org 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-=20 >> face- >> function how the day is coming in into the user-defined function? =20= >> As a day >> number or a calendar date list? > > It's a calendar date list. > > Updated patch attached. Thanks! - Carsten > > =46rom e59409e447f18d92eca9c8faf271901c437746ff Mon Sep 17 00:00:00 = 2001 > From: Julien Danjou > 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 > --- > 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 =20 > 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 =20= > 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 > > --=20 > 1.7.2.3 > > > --=20 > Julien Danjou > // =E1=90=B0 http://julien.danjou.info