From 99f7456213ac02cf5a12b7576b22cf516262228b Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 5 Aug 2017 05:36:54 -0500 Subject: [PATCH] Add priority face --- org-agenda-ng.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/org-agenda-ng.el b/org-agenda-ng.el index 3352fc8..7d34310 100644 --- a/org-agenda-ng.el +++ b/org-agenda-ng.el @@ -124,7 +124,11 @@ Its property list should be the second item in the list, as returned by `org-ele (org-add-props it nil 'face 'org-tag))) (level (org-element-property :level element)) (category (org-element-property :category element)) - (string (s-join " " (list todo-keyword title tag-string)))) + (priority-string (-some->> (org-element-property :priority element) + (char-to-string) + (format "[#%s]") + (org-agenda-ng--add-priority-face))) + (string (s-join " " (list todo-keyword priority-string title tag-string)))) (remove-list-of-text-properties 0 (length string) '(line-prefix) string) ;; Add all the necessary properties and faces to the whole string (--> string @@ -135,6 +139,12 @@ Its property list should be the second item in the list, as returned by `org-ele (org-agenda-ng--add-scheduled-face) (org-agenda-ng--add-deadline-face))) +(defun org-agenda-ng--add-priority-face (string) + "Return STRING with priority face added." + (when (string-match "\\(\\[#\\(.\\)\\]\\)" string) + (let ((face (org-get-priority-face (string-to-char (match-string 2))))) + (org-add-props string nil 'face face 'font-lock-fontified t)))) + (defun org-agenda-ng--add-scheduled-face (element) "Add faces to ELEMENT's title for its scheduled status." (if-let ((scheduled-date (org-element-property :scheduled element)))