Browse Source

Checkboxes: New face

Checkboxes not have their own face.  This can be used to make them
look different.  Default is still just bold.
Carsten Dominik 16 năm trước cách đây
mục cha
commit
cf6cdd5c44
3 tập tin đã thay đổi với 11 bổ sung1 xóa
  1. 4 0
      lisp/ChangeLog
  2. 6 0
      lisp/org-faces.el
  3. 1 1
      lisp/org.el

+ 4 - 0
lisp/ChangeLog

@@ -1,5 +1,9 @@
 2009-03-20  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org.el (org-set-font-lock-defaults): Use new checkbox face.
+
+	* org-faces.el (org-checkbox): New face.
+
 	* org-exp.el (org-export-html-preprocess): Only create LaTeX
 	fragement images if there is an export file.
 

+ 6 - 0
lisp/org-faces.el

@@ -343,6 +343,12 @@ list of attributes, like (:foreground \"blue\" :weight bold :underline t)."
     (setq org-tags-special-faces-re
 	  (concat ":\\(" (mapconcat 'car value "\\|") "\\):"))))
 
+(defface org-checkbox
+  (org-compatible-face 'bold
+    '((t (:bold t))))
+  "Face for checkboxes"
+  :group 'org-faces)
+
 (defcustom org-tag-faces nil
   "Faces for specific tags.
 This is a list of cons cells, with tags in the car and faces in the cdr.

+ 1 - 1
lisp/org.el

@@ -4352,7 +4352,7 @@ between words."
                  '(org-do-emphasis-faces)))
 	   ;; Checkboxes
 	   '("^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +\\(\\[[- X]\\]\\)"
-	     2 'bold prepend)
+	     2 'org-checkbox prepend)
 	   (if org-provide-checkbox-statistics
 	       '("\\[\\([0-9]*%\\)\\]\\|\\[\\([0-9]*\\)/\\([0-9]*\\)\\]"
 		 (0 (org-get-checkbox-statistics-face) t)))