"Sebastien Vauban" <sva-news-D0wtAvR13HarG/idocf...@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


Reply via email to