summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2010-11-12 13:37:38 -0600
committerCarsten Dominik <carsten.dominik@gmail.com>2010-11-12 13:37:38 -0600
commit1f40cbc59643e1404ebf80a23092e3efbf951c24 (patch)
tree66bd8af95c66dfd861effa593094f4067a3d9e5e
parent42dd7afe45bbf8ea976c39cfb0c50660779cdfe8 (diff)
downloadorg-mode-1f40cbc59643e1404ebf80a23092e3efbf951c24.tar.gz
New option to stop level nine headline to use level 1 face
* lisp/org-faces.el (org-cycle-level-faces): New option. * lisp/org.el (org-get-level-face): Honor org-cycle-level-faces Original patch by Jonathan BISSON, modified by Carsten Dominik
-rw-r--r--lisp/org-faces.el9
-rw-r--r--lisp/org.el19
2 files changed, 20 insertions, 8 deletions
diff --git a/lisp/org-faces.el b/lisp/org-faces.el
index e4e17f1..ea98e59 100644
--- a/lisp/org-faces.el
+++ b/lisp/org-faces.el
@@ -685,6 +685,15 @@ If it is less than 8, the level-1 face gets re-used for level N+1 etc."
:type 'integer
:group 'org-faces)
+(defcustom org-cycle-level-faces t
+ "Non-nil means level styles cycle after level `org-n-level-faces'.
+Then 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
+ :group 'org-faces
+ :type 'boolean)
+
(defface org-latex-and-export-specials
(let ((font (cond ((assq :inherit custom-face-attributes)
'(:inherit underline))
diff --git a/lisp/org.el b/lisp/org.el
index d774a35..35fa462 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5581,14 +5581,17 @@ needs to be inserted at a specific position in the font-lock sequence.")
(defvar org-l nil)
(defvar org-f nil)
(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))))
- (setq org-f (nth (% (1- 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))))
+ "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- (min 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))))
+
(defun org-get-todo-face (kwd)
"Get the right face for a TODO keyword KWD.