]> code.delx.au - gnu-emacs/blobdiff - lisp/org/org-faces.el
Close bug#3992.
[gnu-emacs] / lisp / org / org-faces.el
index 31200839dcfef9389f761c164ebe8089bd2fb390..2e5e63199a05a86ad9d68daa0c6eb37b9ab8bb55 100644 (file)
@@ -1,11 +1,12 @@
 ;;; org-faces.el --- Face definitions for Org-mode.
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;;   Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 6.16
+;; Version: 6.33x
 ;;
 ;; This file is part of GNU Emacs.
 ;;
 (require 'org-macs)
 (require 'org-compat)
 
+(defun org-copy-face (old-face new-face docstring &rest attributes)
+  (unless (facep new-face)
+    (if (fboundp 'set-face-attribute)
+       (progn
+         (make-face new-face)
+         (set-face-attribute new-face nil :inherit old-face)
+         (apply 'set-face-attribute new-face nil attributes)
+         (set-face-doc-string new-face docstring))
+      (copy-face old-face new-face)
+      (if (fboundp 'set-face-doc-string)
+         (set-face-doc-string new-face docstring)))))
+(put 'org-copy-face 'lisp-indent-function 2)
+
 (defgroup org-faces nil
   "Faces in Org-mode."
   :tag "Org Faces"
@@ -239,6 +253,13 @@ column view defines special faces for each outline level.  See the file
   "Face for links."
   :group 'org-faces)
 
+(defface org-footnote
+  '((((class color) (background light)) (:foreground "Purple" :underline t))
+    (((class color) (background dark)) (:foreground "Cyan" :underline t))
+    (t (:underline t)))
+  "Face for links."
+  :group 'org-faces)
+
 (defface org-ellipsis
   '((((class color) (background light)) (:foreground "DarkGoldenrod" :underline t))
     (((class color) (background dark)) (:foreground "LightGoldenrod" :underline t))
@@ -250,21 +271,21 @@ column view defines special faces for each outline level.  See the file
   '((((class color) (background light)) (:underline t))
     (((class color) (background dark)) (:underline t))
     (t (:underline t)))
-  "Face for links."
+  "Face for link targets."
   :group 'org-faces)
 
 (defface org-date
   '((((class color) (background light)) (:foreground "Purple" :underline t))
     (((class color) (background dark)) (:foreground "Cyan" :underline t))
     (t (:underline t)))
-  "Face for links."
+  "Face for date/time stamps."
   :group 'org-faces)
 
 (defface org-sexp-date
   '((((class color) (background light)) (:foreground "Purple"))
     (((class color) (background dark)) (:foreground "Cyan"))
     (t (:underline t)))
-  "Face for links."
+  "Face for diary-like sexp date specifications."
   :group 'org-faces)
 
 (defface org-tag
@@ -293,6 +314,20 @@ specific tags."
   "Face used for todo keywords that indicate DONE items."
   :group 'org-faces)
 
+(defface org-agenda-done ;; originally copied from font-lock-type-face
+  (org-compatible-face nil
+    '((((class color) (min-colors 16) (background light)) (:foreground "ForestGreen"))
+      (((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen"))
+      (((class color) (min-colors 8)) (:foreground "green"))
+      (t (:bold nil))))
+  "Face used in agenda, to indicate lines switched to DONE.
+This face is used to de-emphasize items that where brightly colord in the
+agenda because they were things to do, or overdue.  The DONE state itself
+is of course immediately visible, but for example a passed deadline is
+\(by default) very bright read.  This face could be simply the default face
+of the frame, for example."
+  :group 'org-faces)
+
 (defface org-headline-done ;; originally copied from font-lock-string-face
   (org-compatible-face nil
     '((((class color) (min-colors 16) (background light)) (:foreground "RosyBrown"))
@@ -315,6 +350,18 @@ list of attributes, like (:foreground \"blue\" :weight bold :underline t)."
           (string :tag "keyword")
           (sexp :tag "face"))))
 
+(defcustom org-priority-faces nil
+  "Faces for specific Priorities.
+This is a list of cons cells, with priority character in the car
+and faces in the cdr.  The face can be a symbol, or a property
+list of attributes, like (:foreground \"blue\" :weight bold :underline t)."
+  :group 'org-faces
+  :group 'org-todo
+  :type '(repeat
+         (cons
+          (character :tag "Priority")
+          (sexp :tag "face"))))
+
 (defvar org-tags-special-faces-re nil)
 (defun org-set-tag-faces (var value)
   (set var value)
@@ -323,6 +370,19 @@ 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)
+
+
+(org-copy-face 'org-todo 'org-checkbox-statistics-todo
+              "Face used for unfinished checkbox statistics.")
+
+(org-copy-face 'org-done '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.
@@ -362,7 +422,7 @@ changes."
   :group 'org-faces)
 
 (defface org-code
-  (org-compatible-face nil
+  (org-compatible-face 'shadow
     '((((class color grayscale) (min-colors 88) (background light))
        (:foreground "grey50"))
       (((class color grayscale) (min-colors 88) (background dark))
@@ -375,8 +435,28 @@ changes."
   :group 'org-faces
   :version "22.1")
 
+(defface org-meta-line
+  (org-compatible-face 'font-lock-comment-face nil)
+  "Face for meta lines startin with \"#+\"."
+  :group 'org-faces
+  :version "22.1")
+
+(defface org-block
+  (org-compatible-face 'shadow
+    '((((class color grayscale) (min-colors 88) (background light))
+       (:foreground "grey50"))
+      (((class color grayscale) (min-colors 88) (background dark))
+       (:foreground "grey70"))
+      (((class color) (min-colors 8) (background light))
+       (:foreground "green"))
+      (((class color) (min-colors 8) (background dark))
+       (:foreground "yellow"))))
+  "Face text in #+begin ... #+end blocks."
+  :group 'org-faces
+  :version "22.1")
+
 (defface org-verbatim
-  (org-compatible-face nil
+  (org-compatible-face 'shadow
     '((((class color grayscale) (min-colors 88) (background light))
        (:foreground "grey50" :underline t))
       (((class color grayscale) (min-colors 88) (background dark))
@@ -389,6 +469,27 @@ changes."
   :group 'org-faces
   :version "22.1")
 
+(org-copy-face 'org-block 'org-quote
+   "Face for #+BEGIN_QUOTE ... #+END_QUOTE blocks.")
+(org-copy-face 'org-block 'org-verse
+   "Face for #+BEGIN_VERSE ... #+END_VERSE blocks.")
+
+(defface org-clock-overlay ;; copied from secondary-selection
+  (org-compatible-face nil
+    '((((class color) (min-colors 88) (background light))
+       (:background "yellow1"))
+      (((class color) (min-colors 88) (background dark))
+       (:background "SkyBlue4"))
+      (((class color) (min-colors 16) (background light))
+       (:background "yellow"))
+      (((class color) (min-colors 16) (background dark))
+       (:background "SkyBlue4"))
+      (((class color) (min-colors 8))
+       (:background "cyan" :foreground "black"))
+      (t (:inverse-video t))))
+    "Basic face for displaying the secondary selection."
+    :group 'org-faces)
+
 (defface org-agenda-structure ;; originally copied from font-lock-function-name-face
   (org-compatible-face nil
     '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
@@ -400,19 +501,21 @@ changes."
   "Face used in agenda for captions and dates."
   :group 'org-faces)
 
-(unless (facep 'org-agenda-date)
-  (copy-face 'org-agenda-structure 'org-agenda-date)
-  (set-face-doc-string 'org-agenda-date
-                      "Face used in agenda for normal days."))
+(org-copy-face 'org-agenda-structure 'org-agenda-date
+              "Face used in agenda for normal days.")
+
+(org-copy-face 'org-agenda-date 'org-agenda-date-today
+              "Face used in agenda for today."
+              :weight 'bold :italic 't)
 
-(unless (facep 'org-agenda-date-weekend)
-  (copy-face 'org-agenda-date 'org-agenda-date-weekend)
-  (set-face-doc-string 'org-agenda-date-weekend
-                      "Face used in agenda for weekend days.
+(org-copy-face 'secondary-selection 'org-agenda-clocking
+              "Face marking the current clock item in the agenda.")
+
+(org-copy-face 'org-agenda-date 'org-agenda-date-weekend
+              "Face used in agenda for weekend days.
 See the variable `org-agenda-weekend-days' for a definition of which days
-belong to the weekend.")
-  (when (fboundp 'set-face-attribute)
-    (set-face-attribute 'org-agenda-date-weekend nil :weight 'bold)))
+belong to the weekend."
+              :weight 'bold)
 
 (defface org-scheduled
   (org-compatible-face nil
@@ -432,6 +535,11 @@ belong to the weekend.")
   "Face for items scheduled for a certain day."
   :group 'org-faces)
 
+(defface org-agenda-dimmed-todo-face
+  '((((background light)) (:foreground "grey50"))
+    (((background dark)) (:foreground "grey50")))
+  "Face used to dimm blocked tasks in the agenda."
+  :group 'org-faces)
 
 (defface org-scheduled-previously
   (org-compatible-face nil
@@ -506,7 +614,7 @@ month and 365.24 days for a year)."
   "The number of different faces to be used for headlines.
 Org-mode defines 8 different headline faces, so this can be at most 8.
 If it is less than 8, the level-1 face gets re-used for level N+1 etc."
-  :type 'number
+  :type 'integer
   :group 'org-faces)
 
 (defface org-latex-and-export-specials
@@ -525,6 +633,9 @@ If it is less than 8, the level-1 face gets re-used for level N+1 etc."
   "Face used to highlight math latex and other special exporter stuff."
   :group 'org-faces)
 
+(org-copy-face 'modeline 'org-mode-line-clock
+              "Face used for clock display in mode line.")
+
 (provide 'org-faces)
 
 ;; arch-tag: 9dab5f91-c4b9-4d6f-bac3-1f6211ad0a04