Просмотр исходного кода

New option: org-fontify-whole-heading-line

Non-nil means modify the regexp in org-set-font-lock-defaults so
that headlines are fontified till the end of the line.  This is
useful when setting a background color for the org-level-* faces.
This defaults to nil so that the old behavior is preserved.
Bastien Guerry 15 лет назад
Родитель
Сommit
68ec49e101
2 измененных файлов с 16 добавлено и 2 удалено
  1. 3 0
      lisp/ChangeLog
  2. 13 2
      lisp/org.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-07-23  Bastien Guerry  <bzg@altern.org>
 
+	* org.el (org-fontify-whole-heading-line): New option.
+	(org-set-font-lock-defaults): Use the new option.
+
 	* org-clock.el (org-show-notification-handler): New option.
 	(org-show-notification): Use the new option.
 

+ 13 - 2
lisp/org.el

@@ -2660,6 +2660,13 @@ Changing this variable requires a restart of Emacs to take effect."
   :group 'org-font-lock
   :type 'boolean)
 
+(defcustom org-fontify-whole-heading-line nil
+  "Non-nil means fontify the whole line for headings.
+This is useful when setting a background color for the
+org-leve-* faces."
+  :group 'org-font-lock
+  :type 'boolean)
+
 (defcustom org-highlight-latex-fragments-and-specials nil
   "Non-nil means, fontify what is treated specially by the exporters."
   :group 'org-font-lock
@@ -4527,8 +4534,12 @@ between words."
 	   ;; Call the hook
 	   '(org-font-lock-hook)
 	   ;; Headlines
-	   '("^\\(\\**\\)\\(\\* \\)\\(.*\\)" (1 (org-get-level-face 1))
-	     (2 (org-get-level-face 2)) (3 (org-get-level-face 3)))
+	   `(,(if org-fontify-whole-heading-line
+		  "^\\(\\**\\)\\(\\* \\)\\(.*\xa\\)"
+		"^\\(\\**\\)\\(\\* \\)\\(.*\\)")
+	     (1 (org-get-level-face 1))
+	     (2 (org-get-level-face 2)) 
+	     (3 (org-get-level-face 3)))
 	   ;; Table lines
 	   '("^[ \t]*\\(\\(|\\|\\+-[-+]\\).*\\S-\\)"
 	     (1 'org-table t))