From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Wiegley Subject: Code snippet for bolding or italicizing A/C priority strings Date: Wed, 10 Oct 2007 02:02:24 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IfUeh-0001CE-DZ for emacs-orgmode@gnu.org; Wed, 10 Oct 2007 02:02:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IfUeZ-00013N-SI for emacs-orgmode@gnu.org; Wed, 10 Oct 2007 02:02:50 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IfUeZ-00012q-Is for emacs-orgmode@gnu.org; Wed, 10 Oct 2007 02:02:43 -0400 Received: from johnwiegley.com ([208.70.150.153] helo=mail.johnwiegley.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IfUeX-0004nv-5I for emacs-orgmode@gnu.org; Wed, 10 Oct 2007 02:02:43 -0400 Received: from Hermes.local (unknown [72.22.154.84]) by mail.johnwiegley.com (Postfix) with ESMTP id 193334224CD for ; Wed, 10 Oct 2007 01:02:31 -0500 (CDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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)