From: Rainer Stengele <rainer.stengele@diplan.de>
To: emacs-orgmode@gnu.org
Subject: Re: Code snippet for bolding or italicizing A/C priority strings
Date: Wed, 10 Oct 2007 14:32:27 +0200 [thread overview]
Message-ID: <feigor$n2$1@sea.gmane.org> (raw)
In-Reply-To: <m24pgzz7of.fsf@newartisans.com>
John Wiegley schrieb:
> John Wiegley <johnw@newartisans.com> 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.
> Emacs-orgmode@gnu.org
> 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
next prev parent reply other threads:[~2007-10-10 12:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2007-10-11 10:20 ` Carsten Dominik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='feigor$n2$1@sea.gmane.org' \
--to=rainer.stengele@diplan.de \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).