emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jonathan BISSON <bissonjonathan@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Proposing a new way for org-get-level-face to behave (customizable)
Date: Tue, 09 Nov 2010 17:42:04 +0100	[thread overview]
Message-ID: <1289320924.3401.9.camel@localhost.localdomain> (raw)

Hi,

I needed to get my outline-level-9 and further to look at least like the
outline-level-8 and not cycling to outline-level-1 as my customization
for this one got a bigger face. And I don't want a child to be bigger
than its parent for visibility purpose.

So I'm proposing this (I could provide a patch but as I'm not using the
very last version of orgmode neither the git one, I thought it was
useless to do so):

(defcustom org-cycle-level-faces t
  "If non-nil, level styles cycle after level org-n-level-faces, so
level org-n-level-faces+1 is styled like level 1. If nil, then all
levels >=org-n-level-faces are styled like level org-n-level-faces"
  :group 'org-appearance
  :type 'boolean)

(defun org-get-level-face (n)
  "Get the right face for match N in font-lock matching of headlines."
  (setq org-l (- (match-end 2) (match-beginning 1) 1))
  (if org-odd-levels-only (setq org-l (1+ (/ org-l 2))))
  (if org-cycle-level-faces
  (setq org-f (nth (% (1- org-l) org-n-level-faces) org-level-faces))
  (setq org-f (nth (1- (if (< org-l org-n-level-faces) org-l
org-n-level-faces)) org-level-faces))
  )
  (cond
   ((eq n 1) (if org-hide-leading-stars 'org-hide org-f))
   ((eq n 2) org-f)
   (t (if org-level-color-stars-only nil org-f))))


Hope it will be of some interest for some of you.

Thanks to quicksilver on irc.freenode.net #org-mode for the help.


Cheers.

             reply	other threads:[~2010-11-09 16:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-09 16:42 Jonathan BISSON [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-11-10 13:15 Proposing a new way for org-get-level-face to behave (customizable) Jonathan BISSON
2010-11-12 19:39 ` Carsten Dominik
2010-11-12 21:47   ` Jonathan BISSON

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=1289320924.3401.9.camel@localhost.localdomain \
    --to=bissonjonathan@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 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).