I have several .org files, e.g. personal.org and work.org.
When viewing the agenda, I'd like to have events from each file differently colored.
For example,
Wednesday 12 June 2013
personal: 11:00am........ Personal Meeting
work: 2:00pm- 3:00pm Work Meeting
There are already some colors in the agenda, but those two lines are both white. How can I set the line coming from personal to one color, and the line coming from work to another? I figure at least there has to be a way to define a color scheme based on the personal:
and work:
text if there's no easy way to have org do it by file.
Thanks!
The only thing I found as solution for what you ask, you have to use a hook function, changing faces after the agenda view is ready. The following code is untested, but should get you going:
(add-hook 'org-finalize-agenda-hook
(lambda ()
(save-excursion
(goto-char (point-min))
(while (re-search-forward "personal:" nil t)
(add-text-properties (match-beginning 0) (point-at-eol)
'(face secondary-selection)))
(goto-char (point-min))
(while (re-search-forward "work:" nil t)
(add-text-properties (match-beginning 0) (point-at-eol)
'(face bold))))))
John Wiegley sent once a patch he wrote so that, with an :OVERLAY: property, all Work items have the same background color. And with another value for Personal, those items have a different color.
See http://comments.gmane.org/gmane.emacs.orgmode/54342
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With