[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Code snippet for bolding or italicizing A/C priority strings
From: |
John Wiegley |
Subject: |
[Orgmode] Code snippet for bolding or italicizing A/C priority strings |
Date: |
Wed, 10 Oct 2007 02:02:24 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (darwin) |
This code snippet will modify your agenda buffer upon creation so that the
string [#A] is bolded, and [#C] is italicized. It keeps whatever color it
had, it's just now strong or weak based on priority.
This doesn't change the display all that much, but it's enough to help pick
out the important and unimportant stuff.
Just pop into your .emacs and go!
John
(defun org-fontify-priorities ()
(interactive)
(save-excursion
(let ((inhibit-read-only t))
(goto-char (point-min))
(while (re-search-forward "\\[#\\([A-C]\\)\\]" nil t)
(let ((priority (match-string 1)))
(cond ((string= priority "A")
(overlay-put (make-overlay (match-beginning 0)
(match-end 0))
'face 'bold))
((string= priority "C")
(overlay-put (make-overlay (match-beginning 0)
(match-end 0))
'face 'italic))))))))
(add-hook 'org-finalize-agenda-hook 'org-fontify-priorities)
- [Orgmode] Code snippet for bolding or italicizing A/C priority strings,
John Wiegley <=