From mboxrd@z Thu Jan 1 00:00:00 1970 From: suvayu ali Subject: Re: [PATCH] sexp can set its face (was: Including current time in agenda) Date: Mon, 13 Dec 2010 01:14:13 +0100 Message-ID: References: <87ei9ulky8.fsf@ucl.ac.uk> <87y67zx1yr.fsf_-_%lukasz.stelmach@iem.pw.edu.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=42727 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PRw3o-0003cS-Gb for emacs-orgmode@gnu.org; Sun, 12 Dec 2010 19:14:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PRw3m-0006BV-Ts for emacs-orgmode@gnu.org; Sun, 12 Dec 2010 19:14:36 -0500 Received: from mail-yw0-f41.google.com ([209.85.213.41]:39023) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PRw3m-0006BN-RF for emacs-orgmode@gnu.org; Sun, 12 Dec 2010 19:14:34 -0500 Received: by ywj3 with SMTP id 3so3633232ywj.0 for ; Sun, 12 Dec 2010 16:14:34 -0800 (PST) In-Reply-To: <87y67zx1yr.fsf_-_%lukasz.stelmach@iem.pw.edu.pl> 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: =?ISO-8859-2?Q?=A3ukasz_Stelmach?= Cc: emacs-orgmode@gnu.org Hi =C5=81ukasz, 2010/12/9 =C5=81ukasz Stelmach : > suvayu ali writes: > >> I actually tried to set the text properties for the string instead, >> but looks like org-agenda is ignoring that. >> >> (defun jd:org-current-time () >> =C2=A0 "Return current-time if date is today." >> =C2=A0 (when (equal date (calendar-current-date)) >> =C2=A0 =C2=A0 (propertize (format-time-string "%H:%M Current time") 'fon= t-lock-face >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 '(:weight bold :foregro= und "DodgerBlue4" :background "snow")))) > > To accomplish this you'd have to apply the following patch and use 'face > property rather than font-lock-face. > > Why can't a sexp choose its 'face after all? > Thanks for this patch. Works great. :) > --8<---------------cut here---------------start------------->8--- > diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el > index 20c901a..ba5eafc 100644 > --- a/lisp/org-agenda.el > +++ b/lisp/org-agenda.el > @@ -4650,8 +4650,7 @@ the documentation of `org-diary'." > =C2=A0(defun org-agenda-get-sexps () > =C2=A0 "Return the sexp information for agenda display." > =C2=A0 (require 'diary-lib) > - =C2=A0(let* ((props (list 'face nil > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 '= mouse-face 'highlight > + =C2=A0(let* ((props (list 'mouse-face 'highlight > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0'help-echo > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(format "mouse-2 or RET jump to org file %s" > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(abbreviate-file-name buffer-file-name)))) > --8<---------------cut here---------------end--------------->8--- > --=20 Suvayu Open source is the future. It sets us free.