summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2013-01-24 13:16:11 (GMT)
committer Bastien Guerry <bzg@altern.org>2013-01-24 13:16:11 (GMT)
commitb2abdfb95a61f9d694bf66e94121d6c5d245d4fa (patch)
treef1c350d6e60aaadb891ae5f6e9a64c6d636d7767
parentaf49713a95f4b8f89794106e6d351bd5e7c0e2c2 (diff)
downloadorg-mode-b2abdfb95a61f9d694bf66e94121d6c5d245d4fa.zip
org-mode-b2abdfb95a61f9d694bf66e94121d6c5d245d4fa.tar.gz
New face `org-priority'. Enhance fontification of priority cookies in agenda.
* org-faces.el (org-priority): New face. * org.el (org-font-lock-add-priority-faces): Use the new face. * org-agenda.el (org-agenda-fontify-priorities): Use the org-priority face and add specific agenda face on top of it.
-rw-r--r--lisp/org-agenda.el22
-rw-r--r--lisp/org-faces.el8
-rw-r--r--lisp/org.el4
3 files changed, 21 insertions, 13 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 1d58b69..5ff6b22 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -3673,8 +3673,7 @@ generating a new one."
(delete-overlay o)))
(overlays-in (point-min) (point-max)))
(save-excursion
- (let ((inhibit-read-only t)
- b e p ov h l)
+ (let (b e p ov h l)
(goto-char (point-min))
(while (re-search-forward "\\[#\\(.\\)\\]" nil t)
(setq h (or (get-char-property (point) 'org-highest-priority)
@@ -3689,15 +3688,16 @@ generating a new one."
ov (make-overlay b e))
(overlay-put
ov 'face
- (cond ((org-face-from-face-or-color
- 'priority nil
- (cdr (assoc p org-priority-faces))))
- ((and (listp org-agenda-fontify-priorities)
- (org-face-from-face-or-color
- 'priority nil
- (cdr (assoc p org-agenda-fontify-priorities)))))
- ((equal p l) 'italic)
- ((equal p h) 'bold)))
+ (cons (cond ((org-face-from-face-or-color
+ 'priority nil
+ (cdr (assoc p org-priority-faces))))
+ ((and (listp org-agenda-fontify-priorities)
+ (org-face-from-face-or-color
+ 'priority nil
+ (cdr (assoc p org-agenda-fontify-priorities)))))
+ ((equal p l) 'italic)
+ ((equal p h) 'bold))
+ 'org-priority))
(overlay-put ov 'org-type 'org-priority)))))
(defun org-agenda-dim-blocked-tasks (&optional invisible)
diff --git a/lisp/org-faces.el b/lisp/org-faces.el
index 606db08..de5a08c 100644
--- a/lisp/org-faces.el
+++ b/lisp/org-faces.el
@@ -394,6 +394,14 @@ determines if it is a foreground or a background color."
(string :tag "Color")
(sexp :tag "Face")))))
+(defface org-priority ;; originally copied from font-lock-string-face
+ (org-compatible-face 'font-lock-keyword-face
+ '((((class color) (min-colors 16) (background light)) (:foreground "RosyBrown"))
+ (((class color) (min-colors 16) (background dark)) (:foreground "LightSalmon"))
+ (t (:italic t))))
+ "Face used for priority cookies."
+ :group 'org-faces)
+
(defcustom org-priority-faces nil
"Faces for specific Priorities.
This is a list of cons cells, with priority character in the car
diff --git a/lisp/org.el b/lisp/org.el
index 45842d5..5bebb5f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6128,10 +6128,10 @@ When FACE-OR-COLOR is not a string, just return it."
(add-text-properties
(match-beginning 0) (match-end 0)
(list 'face (or (org-face-from-face-or-color
- 'priority 'org-special-keyword
+ 'priority 'org-priority
(cdr (assoc (char-after (match-beginning 1))
org-priority-faces)))
- 'org-special-keyword)
+ 'org-priority)
'font-lock-fontified t)))))
(defun org-get-tag-face (kwd)