emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Code snippet for bolding or italicizing A/C priority strings
@ 2007-10-10  6:02 John Wiegley
  2007-10-10  8:37 ` John Wiegley
  0 siblings, 1 reply; 4+ messages in thread
From: John Wiegley @ 2007-10-10  6:02 UTC (permalink / raw)
  To: emacs-orgmode

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)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-10-11 10:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-10  6:02 Code snippet for bolding or italicizing A/C priority strings John Wiegley
2007-10-10  8:37 ` John Wiegley
2007-10-10 12:32   ` Rainer Stengele
2007-10-11 10:20   ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).