From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: color header based on priority/tags rather than level Date: Tue, 14 Jan 2014 10:21:47 +0100 Message-ID: <87a9eyhqac.fsf@bzg.ath.cx> References: <86vbxn6k0f.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W30CR-0007wG-SR for emacs-orgmode@gnu.org; Tue, 14 Jan 2014 04:22:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W30CJ-00049P-PY for emacs-orgmode@gnu.org; Tue, 14 Jan 2014 04:22:19 -0500 Received: from plane.gmane.org ([80.91.229.3]:58967) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W30CI-00049C-Ht for emacs-orgmode@gnu.org; Tue, 14 Jan 2014 04:22:11 -0500 Received: from public by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1W30CG-0001yJ-IY for emacs-orgmode@gnu.org; Tue, 14 Jan 2014 10:22:08 +0100 In-Reply-To: <86vbxn6k0f.fsf@somewhere.org> (Sebastien Vauban's message of "Tue, 14 Jan 2014 09:32:48 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sebastien Vauban Cc: public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org "Sebastien Vauban" 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