emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: Code snippet for bolding or italicizing A/C priority strin


From: Rainer Stengele
Subject: [Orgmode] Re: Code snippet for bolding or italicizing A/C priority strings
Date: Wed, 10 Oct 2007 14:32:27 +0200
User-agent: Thunderbird 2.0.0.6 (Windows/20070728)

John Wiegley schrieb:
> John Wiegley <address@hidden> 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
> 
> 
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
> 

Excellent! I appreciate your function very much!
It helps a lot to get a better overview in the agenda!

rainer





reply via email to

[Prev in Thread] Current Thread [Next in Thread]