Explorar o código

New faces for checkbox statistics

Carsten Dominik %!s(int64=16) %!d(string=hai) anos
pai
achega
7b3d0d40f5
Modificáronse 3 ficheiros con 23 adicións e 3 borrados
  1. 8 0
      lisp/ChangeLog
  2. 10 0
      lisp/org-faces.el
  3. 5 3
      lisp/org-list.el

+ 8 - 0
lisp/ChangeLog

@@ -1,3 +1,11 @@
+2009-06-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-list.el (org-get-checkbox-statistics-face): Use the new
+	faces.
+
+	* org-faces.el (org-checkbox-statistics-todo)
+	(org-checkbox-statistics-done): New faces.
+
 2009-06-09  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-src.el (org-src-mode): Renamed from `org-exit-edit-mode'.

+ 10 - 0
lisp/org-faces.el

@@ -363,6 +363,16 @@ list of attributes, like (:foreground \"blue\" :weight bold :underline t)."
   "Face for checkboxes"
   :group 'org-faces)
 
+(unless (facep 'org-checkbox-statistics-todo)
+  (copy-face 'org-todo 'org-checkbox-statistics-todo)
+  (set-face-doc-string 'org-checkbox-statistics-todo
+		       "Face used for unfinished checkbox statistics."))
+
+(unless (facep 'org-checkbox-statistics-done)
+  (copy-face 'org-done 'org-checkbox-statistics-done)
+  (set-face-doc-string 'org-checkbox-statistics-done
+		       "Face used for finished checkbox statistics."))
+
 (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.

+ 5 - 3
lisp/org-list.el

@@ -484,11 +484,13 @@ the whole buffer."
 The face will be `org-done' when all relevant boxes are checked.  Otherwise
 it will be `org-todo'."
   (if (match-end 1)
-      (if (equal (match-string 1) "100%") 'org-done 'org-todo)
+      (if (equal (match-string 1) "100%")
+	  'org-checkbox-statistics-done
+	'org-checkbox-statistics-todo)
     (if (and (> (match-end 2) (match-beginning 2))
 	     (equal (match-string 2) (match-string 3)))
-	'org-done
-      'org-todo)))
+	'org-checkbox-statistics-done
+      'org-checkbox-statistics-todo)))
 
 (defun org-beginning-of-item ()
   "Go to the beginning of the current hand-formatted item.