From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?=C5=81ukasz?= Stelmach Subject: [PATCH] sexp can set its face (was: Including current time in agenda) Date: Thu, 09 Dec 2010 00:46:20 +0100 Message-ID: <87y67zx1yr.fsf_-_%lukasz.stelmach@iem.pw.edu.pl> References: <87ei9ulky8.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from [140.186.70.92] (port=48447 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQTiU-0003Yb-Fj for emacs-orgmode@gnu.org; Wed, 08 Dec 2010 18:46:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQTiT-0001Wc-7F for emacs-orgmode@gnu.org; Wed, 08 Dec 2010 18:46:34 -0500 Received: from lo.gmane.org ([80.91.229.12]:38303) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQTiS-0001WH-W4 for emacs-orgmode@gnu.org; Wed, 08 Dec 2010 18:46:33 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PQTiR-0003Oy-DR for emacs-orgmode@gnu.org; Thu, 09 Dec 2010 00:46:31 +0100 Received: from 87-205-163-230.adsl.inetia.pl ([87.205.163.230]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 09 Dec 2010 00:46:31 +0100 Received: from lukasz.stelmach by 87-205-163-230.adsl.inetia.pl with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 09 Dec 2010 00:46:31 +0100 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: emacs-orgmode@gnu.org 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 () > "Return current-time if date is today." > (when (equal date (calendar-current-date)) > (propertize (format-time-string "%H:%M Current time") 'font-lock-face > '(:weight bold :foreground "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? --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'." (defun org-agenda-get-sexps () "Return the sexp information for agenda display." (require 'diary-lib) - (let* ((props (list 'face nil - 'mouse-face 'highlight + (let* ((props (list 'mouse-face 'highlight 'help-echo (format "mouse-2 or RET jump to org file %s" (abbreviate-file-name buffer-file-name)))) --8<---------------cut here---------------end--------------->8--- -- Miłego dnia, Łukasz Stelmach