all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: PT <spamfilteraccount@gmail.com>
To: emacs-orgmode@gnu.org
Subject: On demand face for headers
Date: Fri, 18 Dec 2009 19:21:27 +0000 (UTC)	[thread overview]
Message-ID: <loom.20091218T201803-914@post.gmane.org> (raw)

In this thread there was a solution for highlighting the whole
header line, so it stands out more from the buffer text:

http://thread.gmane.org/gmane.emacs.orgmode/15721/


This solution was a bit too heavy, because it affected all header
lines, and I didn't want all headers to be so conspicuous
everywhere, so I set a background color only for top-level
headers in my setup.

Here's an other solution which can be used to highlight headers
selectively if you want only particular headers to stand
out (bigger font, background color, etc.) without affecting other
headers on the same level.

To highlight a header with a custom color, simply put a space to
the end of the header line. (Headers with tags are not handled,
because I did not need it.)



(defface my-org-level-2
  '((t :background "darkseagreen1"))
  "")

(defface my-org-level-3
  '((t :background "moccasin"))
  "")


(setq my-org-level-emphasis-faces
      '((org-level-2 . my-org-level-2)
        (org-level-3 . my-org-level-3)
        ))


(defadvice org-get-level-face (after my-org-get-level-face activate)
  (if (and (eq (ad-get-arg 0) 3)
           (equal (aref (match-string 0)
                        (- (length (match-string 0)) 
                           (if org-fontify-whole-heading-line 2 1)))
                  ? ))
      (let ((new-face (assoc-default ad-return-value
                                     my-org-level-emphasis-faces)))
        (if new-face
            (setq ad-return-value new-face)))))

                 reply	other threads:[~2009-12-18 19:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20091218T201803-914@post.gmane.org \
    --to=spamfilteraccount@gmail.com \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.