From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Wiegley Subject: Re: Code snippet for bolding or italicizing A/C priority strings Date: Wed, 10 Oct 2007 04:37:52 -0400 Message-ID: References: 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 1IfX4y-0002i1-Jw for emacs-orgmode@gnu.org; Wed, 10 Oct 2007 04:38:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IfX4u-0002hN-4v for emacs-orgmode@gnu.org; Wed, 10 Oct 2007 04:38:07 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IfX4t-0002hI-VF for emacs-orgmode@gnu.org; Wed, 10 Oct 2007 04:38:03 -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 1IfX4t-0004UP-Of for emacs-orgmode@gnu.org; Wed, 10 Oct 2007 04:38:03 -0400 Received: from Hermes.local (unknown [72.22.154.84]) by mail.johnwiegley.com (Postfix) with ESMTP id C67514224DC for ; Wed, 10 Oct 2007 03:38:02 -0500 (CDT) In-Reply-To: (John Wiegley's message of "Wed\, 10 Oct 2007 02\:02\:24 -0400") 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 John Wiegley writes: > 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. Actually, I'm finding I like having the whole title bolded or italicized, just like Gnus does: (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) (line-end-position)) 'face 'bold)) ((string= priority "C") (overlay-put (make-overlay (match-beginning 0) ;;(match-end 0) (line-end-position)) 'face 'italic)))))))) (add-hook 'org-finalize-agenda-hook 'org-fontify-priorities) John