0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-22 12:10:44 +00:00

sexp can set its face (was: Including current time in agenda)

suvayu ali <fatkasuvayu+linux@gmail.com> 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---
--8<---------------cut here---------------end--------------->8---
This commit is contained in:
Łukasz Stelmach 2010-12-09 04:46:20 +00:00 committed by Carsten Dominik
parent 651e137c50
commit ad006dea13

View file

@ -4650,8 +4650,7 @@ the documentation of `org-diary'."
(defun org-agenda-get-sexps () (defun org-agenda-get-sexps ()
"Return the sexp information for agenda display." "Return the sexp information for agenda display."
(require 'diary-lib) (require 'diary-lib)
(let* ((props (list 'face nil (let* ((props (list 'mouse-face 'highlight
'mouse-face 'highlight
'help-echo 'help-echo
(format "mouse-2 or RET jump to org file %s" (format "mouse-2 or RET jump to org file %s"
(abbreviate-file-name buffer-file-name)))) (abbreviate-file-name buffer-file-name))))