From 8b4652121173b8cee9f9cb6c8996f23752677f0e Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Fri, 25 May 2012 20:23:43 +0200 Subject: [PATCH] Restrict priorities fontification to headlines and inlinetasks * lisp/org.el (org-font-lock-add-priority-faces): Restrict priorities fontification to headlines and inlinetasks. --- lisp/org.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index b3ae935cc..972f7801a 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5990,14 +5990,15 @@ When FACE-OR-COLOR is not a string, just return it." (defun org-font-lock-add-priority-faces (limit) "Add the special priority faces." (while (re-search-forward "\\[#\\([A-Z0-9]\\)\\]" limit t) - (add-text-properties - (match-beginning 0) (match-end 0) - (list 'face (or (org-face-from-face-or-color - 'priority 'org-special-keyword - (cdr (assoc (char-after (match-beginning 1)) - org-priority-faces))) - 'org-special-keyword) - 'font-lock-fontified t)))) + (when (save-match-data (org-at-heading-p)) + (add-text-properties + (match-beginning 0) (match-end 0) + (list 'face (or (org-face-from-face-or-color + 'priority 'org-special-keyword + (cdr (assoc (char-after (match-beginning 1)) + org-priority-faces))) + 'org-special-keyword) + 'font-lock-fontified t))))) (defun org-get-tag-face (kwd) "Get the right face for a TODO keyword KWD. -- 2.11.4.GIT