summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2012-05-25 20:23:43 +0200
committerNicolas Goaziou <n.goaziou@gmail.com>2012-05-25 20:23:43 +0200
commit8b4652121173b8cee9f9cb6c8996f23752677f0e (patch)
tree22c7e0882546474efde2c099e814d84b38d22653
parent4e4e161f8f1563a1dabbef5e721f17acec2ddaf7 (diff)
downloadorg-mode-6720f1aea86d1e3da7f4d8ec92a4f27d2b1300cc.tar.gz
Restrict priorities fontification to headlines and inlinetasksrelease_7.8.11
* lisp/org.el (org-font-lock-add-priority-faces): Restrict priorities fontification to headlines and inlinetasks.
-rw-r--r--lisp/org.el17
1 files changed, 9 insertions, 8 deletions
diff --git a/lisp/org.el b/lisp/org.el
index b3ae935..972f780 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.