* color header based on priority/tags rather than level
@ 2014-01-14 2:53 David Rees
2014-01-14 8:32 ` Sebastien Vauban
0 siblings, 1 reply; 3+ messages in thread
From: David Rees @ 2014-01-14 2:53 UTC (permalink / raw)
To: emacs-orgmode
Is there way to set the color/face of a header line based on
priority/tags rather than level? Maybe a way of setting a hook method
that takes header line info and returns color/face info?
I've found that I can use org-priority-face to color the priority cookie
and I can use org-agenda-fontify-priorities to apply color to the agenda
line, but I want to color the header line in the original buffer.
FYI, Here is a link to old post on this, but it ended just with solution
for agenda lines
http://article.gmane.org/gmane.emacs.orgmode/17143/match=color+entire+header
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: color header based on priority/tags rather than level
2014-01-14 2:53 color header based on priority/tags rather than level David Rees
@ 2014-01-14 8:32 ` Sebastien Vauban
2014-01-14 9:21 ` Bastien
0 siblings, 1 reply; 3+ messages in thread
From: Sebastien Vauban @ 2014-01-14 8:32 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
David Rees wrote:
> Is there way to set the color/face of a header line based on priority/tags
> rather than level? Maybe a way of setting a hook method that takes header line
> info and returns color/face info?
>
> I've found that I can use org-priority-face to color the priority cookie and
> I can use org-agenda-fontify-priorities to apply color to the agenda line, but
> I want to color the header line in the original buffer.
>
> FYI, Here is a link to old post on this, but it ended just with solution for
> agenda lines
> http://article.gmane.org/gmane.emacs.orgmode/17143/match=color+entire+header
Once again, not what you're looking for, but John Wiegley once shared
his code to highlight agenda lines depending of a tag (home, work,
etc.).
Though, can't find it anymore...
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: color header based on priority/tags rather than level
2014-01-14 8:32 ` Sebastien Vauban
@ 2014-01-14 9:21 ` Bastien
0 siblings, 0 replies; 3+ messages in thread
From: Bastien @ 2014-01-14 9:21 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ
"Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
writes:
> Once again, not what you're looking for, but John Wiegley once shared
> his code to highlight agenda lines depending of a tag (home, work,
> etc.).
(font-lock-add-keywords 'org-mode
'(("^.*:write:.*$" . font-lock-keyword-face)))
will use `font-lock-keyword-face' for headings tagged with ":write:"
in org-mode.
The following snippet can be used for boldifying ":write:"-tagged
lines in the agenda:
(setq org-agenda-face-for-tagged-lines
'(("write" . bold)))
(defun org-agenda-fontify-tagged-line ()
"Use `org-agenda-face-for-tagged-lines' to fontify lines with certain tags."
(goto-char (point-min))
(let (tags)
(while (progn (forward-line 1) (not (eobp)))
(if (setq tags (get-text-property (point) 'tags))
(mapcar
(lambda (pair)
(if (member (car pair) tags)
(add-text-properties (point-at-bol) (point-at-eol) `(face ,(cdr pair)))))
org-agenda-face-for-tagged-lines)))))
(add-hook 'org-agenda-finalize-hook 'org-agenda-fontify-tagged-line)
HTH,
--
Bastien
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-01-14 9:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-14 2:53 color header based on priority/tags rather than level David Rees
2014-01-14 8:32 ` Sebastien Vauban
2014-01-14 9:21 ` Bastien
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).