1 ;;; org-faces.el --- Face definitions for Org-mode.
3 ;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
4 ;; Free Software Foundation, Inc.
6 ;; Author: Carsten Dominik <carsten at orgmode dot org>
7 ;; Keywords: outlines, hypermedia, calendar, wp
8 ;; Homepage: http://orgmode.org
11 ;; This file is part of GNU Emacs.
13 ;; GNU Emacs is free software: you can redistribute it and/or modify
14 ;; it under the terms of the GNU General Public License as published by
15 ;; the Free Software Foundation, either version 3 of the License, or
16 ;; (at your option) any later version.
18 ;; GNU Emacs is distributed in the hope that it will be useful,
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;; GNU General Public License for more details.
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
29 ;; This file contains the face definitions for Org.
36 (defgroup org-faces nil
39 :group
'org-font-lock
)
42 '((((background light
)) (:foreground
"white"))
43 (((background dark
)) (:foreground
"black")))
44 "Face used to hide leading stars in headlines.
45 The foreground color of this face should be equal to the background
49 (defface org-level-1
;; originally copied from font-lock-function-name-face
50 (org-compatible-face 'outline-1
51 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Blue1"))
52 (((class color
) (min-colors 88) (background dark
)) (:foreground
"LightSkyBlue"))
53 (((class color
) (min-colors 16) (background light
)) (:foreground
"Blue"))
54 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightSkyBlue"))
55 (((class color
) (min-colors 8)) (:foreground
"blue" :bold t
))
57 "Face used for level 1 headlines."
60 (defface org-level-2
;; originally copied from font-lock-variable-name-face
61 (org-compatible-face 'outline-2
62 '((((class color
) (min-colors 16) (background light
)) (:foreground
"DarkGoldenrod"))
63 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightGoldenrod"))
64 (((class color
) (min-colors 8) (background light
)) (:foreground
"yellow"))
65 (((class color
) (min-colors 8) (background dark
)) (:foreground
"yellow" :bold t
))
67 "Face used for level 2 headlines."
70 (defface org-level-3
;; originally copied from font-lock-keyword-face
71 (org-compatible-face 'outline-3
72 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Purple"))
73 (((class color
) (min-colors 88) (background dark
)) (:foreground
"Cyan1"))
74 (((class color
) (min-colors 16) (background light
)) (:foreground
"Purple"))
75 (((class color
) (min-colors 16) (background dark
)) (:foreground
"Cyan"))
76 (((class color
) (min-colors 8) (background light
)) (:foreground
"purple" :bold t
))
77 (((class color
) (min-colors 8) (background dark
)) (:foreground
"cyan" :bold t
))
79 "Face used for level 3 headlines."
82 (defface org-level-4
;; originally copied from font-lock-comment-face
83 (org-compatible-face 'outline-4
84 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Firebrick"))
85 (((class color
) (min-colors 88) (background dark
)) (:foreground
"chocolate1"))
86 (((class color
) (min-colors 16) (background light
)) (:foreground
"red"))
87 (((class color
) (min-colors 16) (background dark
)) (:foreground
"red1"))
88 (((class color
) (min-colors 8) (background light
)) (:foreground
"red" :bold t
))
89 (((class color
) (min-colors 8) (background dark
)) (:foreground
"red" :bold t
))
91 "Face used for level 4 headlines."
94 (defface org-level-5
;; originally copied from font-lock-type-face
95 (org-compatible-face 'outline-5
96 '((((class color
) (min-colors 16) (background light
)) (:foreground
"ForestGreen"))
97 (((class color
) (min-colors 16) (background dark
)) (:foreground
"PaleGreen"))
98 (((class color
) (min-colors 8)) (:foreground
"green"))))
99 "Face used for level 5 headlines."
102 (defface org-level-6
;; originally copied from font-lock-constant-face
103 (org-compatible-face 'outline-6
104 '((((class color
) (min-colors 16) (background light
)) (:foreground
"CadetBlue"))
105 (((class color
) (min-colors 16) (background dark
)) (:foreground
"Aquamarine"))
106 (((class color
) (min-colors 8)) (:foreground
"magenta"))))
107 "Face used for level 6 headlines."
110 (defface org-level-7
;; originally copied from font-lock-builtin-face
111 (org-compatible-face 'outline-7
112 '((((class color
) (min-colors 16) (background light
)) (:foreground
"Orchid"))
113 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightSteelBlue"))
114 (((class color
) (min-colors 8)) (:foreground
"blue"))))
115 "Face used for level 7 headlines."
118 (defface org-level-8
;; originally copied from font-lock-string-face
119 (org-compatible-face 'outline-8
120 '((((class color
) (min-colors 16) (background light
)) (:foreground
"RosyBrown"))
121 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightSalmon"))
122 (((class color
) (min-colors 8)) (:foreground
"green"))))
123 "Face used for level 8 headlines."
126 (defface org-special-keyword
;; originally copied from font-lock-string-face
127 (org-compatible-face nil
128 '((((class color
) (min-colors 16) (background light
)) (:foreground
"RosyBrown"))
129 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightSalmon"))
131 "Face used for special keywords."
134 (defface org-drawer
;; originally copied from font-lock-function-name-face
135 (org-compatible-face nil
136 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Blue1"))
137 (((class color
) (min-colors 88) (background dark
)) (:foreground
"LightSkyBlue"))
138 (((class color
) (min-colors 16) (background light
)) (:foreground
"Blue"))
139 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightSkyBlue"))
140 (((class color
) (min-colors 8)) (:foreground
"blue" :bold t
))
142 "Face used for drawers."
145 (defface org-property-value nil
146 "Face used for the value of a property."
150 (org-compatible-face nil
151 '((((class color
) (min-colors 16) (background light
))
152 (:background
"grey90" :weight normal
:slant normal
:strike-through nil
154 (((class color
) (min-colors 16) (background dark
))
155 (:background
"grey30" :weight normal
:slant normal
:strike-through nil
157 (((class color
) (min-colors 8))
158 (:background
"cyan" :foreground
"black"
159 :weight normal
:slant normal
:strike-through nil
161 (t (:inverse-video t
))))
162 "Face for column display of entry properties.
163 This is actually only part of the face definition for the text in column view.
164 The following faces apply, with this priority.
166 1. The color of the reference face. This is normally the level fact that
167 is used in the outline. In agenda-mode, it will be the face of the
168 first character in the line. The color is explicitly retained to
169 make sure that the column line still looks a bit like the structure
172 2. The `org-column' face.
174 3. The remaining properties of the reference face.
176 Since column view works by putting overlays with a display property
177 over individual characters in the buffer, the face of the underlining
178 character (this might for example be the a TODO keyword) might still
179 shine through in some properties. So when your column view looks
180 funny, with \"random\" colors, weight, strike-through, try to explicitly
181 set the properties in the `org-column' face. For example, set
182 :underline to nil, or the :slant to `normal'.
184 Under XEmacs, the rules are simpler, because the XEmacs version of
185 column view defines special faces for each outline level. See the file
186 `org-colview-xemacs.el' for details."
189 (defface org-column-title
190 (org-compatible-face nil
191 '((((class color
) (min-colors 16) (background light
))
192 (:background
"grey90" :underline t
:weight bold
))
193 (((class color
) (min-colors 16) (background dark
))
194 (:background
"grey30" :underline t
:weight bold
))
195 (((class color
) (min-colors 8))
196 (:background
"cyan" :foreground
"black" :underline t
:weight bold
))
197 (t (:inverse-video t
))))
198 "Face for column display of entry properties."
201 (when (fboundp 'set-face-attribute
)
202 ;; Make sure that a fixed-width face is used when we have a column table.
203 (set-face-attribute 'org-column nil
204 :height
(face-attribute 'default
:height
)
205 :family
(face-attribute 'default
:family
)))
207 (defface org-agenda-column-dateline
208 (org-compatible-face 'org-column
210 "Face used in agenda column view for datelines with summaries."
214 (org-compatible-face 'font-lock-warning-face
215 '((((class color
) (min-colors 16) (background light
)) (:foreground
"Red1" :bold t
))
216 (((class color
) (min-colors 16) (background dark
)) (:foreground
"Pink" :bold t
))
217 (((class color
) (min-colors 8) (background light
)) (:foreground
"red" :bold t
))
218 (((class color
) (min-colors 8) (background dark
)) (:foreground
"red" :bold t
))
220 "Face for deadlines and TODO keywords."
223 (defface org-archived
; similar to shadow
224 (org-compatible-face 'shadow
225 '((((class color grayscale
) (min-colors 88) (background light
))
226 (:foreground
"grey50"))
227 (((class color grayscale
) (min-colors 88) (background dark
))
228 (:foreground
"grey70"))
229 (((class color
) (min-colors 8) (background light
))
230 (:foreground
"green"))
231 (((class color
) (min-colors 8) (background dark
))
232 (:foreground
"yellow"))))
233 "Face for headline with the ARCHIVE tag."
237 '((((class color
) (background light
)) (:foreground
"Purple" :underline t
))
238 (((class color
) (background dark
)) (:foreground
"Cyan" :underline t
))
243 (defface org-footnote
244 '((((class color
) (background light
)) (:foreground
"Purple" :underline t
))
245 (((class color
) (background dark
)) (:foreground
"Cyan" :underline t
))
250 (defface org-ellipsis
251 '((((class color
) (background light
)) (:foreground
"DarkGoldenrod" :underline t
))
252 (((class color
) (background dark
)) (:foreground
"LightGoldenrod" :underline t
))
253 (t (:strike-through t
)))
254 "Face for the ellipsis in folded text."
258 '((((class color
) (background light
)) (:underline t
))
259 (((class color
) (background dark
)) (:underline t
))
265 '((((class color
) (background light
)) (:foreground
"Purple" :underline t
))
266 (((class color
) (background dark
)) (:foreground
"Cyan" :underline t
))
271 (defface org-sexp-date
272 '((((class color
) (background light
)) (:foreground
"Purple"))
273 (((class color
) (background dark
)) (:foreground
"Cyan"))
280 "Default face for tags.
281 Note that the variable `org-tag-faces' can be used to overrule this face for
285 (defface org-todo
; font-lock-warning-face
286 (org-compatible-face nil
287 '((((class color
) (min-colors 16) (background light
)) (:foreground
"Red1" :bold t
))
288 (((class color
) (min-colors 16) (background dark
)) (:foreground
"Pink" :bold t
))
289 (((class color
) (min-colors 8) (background light
)) (:foreground
"red" :bold t
))
290 (((class color
) (min-colors 8) (background dark
)) (:foreground
"red" :bold t
))
291 (t (:inverse-video t
:bold t
))))
292 "Face for TODO keywords."
295 (defface org-done
;; originally copied from font-lock-type-face
296 (org-compatible-face nil
297 '((((class color
) (min-colors 16) (background light
)) (:foreground
"ForestGreen" :bold t
))
298 (((class color
) (min-colors 16) (background dark
)) (:foreground
"PaleGreen" :bold t
))
299 (((class color
) (min-colors 8)) (:foreground
"green"))
301 "Face used for todo keywords that indicate DONE items."
304 (defface org-headline-done
;; originally copied from font-lock-string-face
305 (org-compatible-face nil
306 '((((class color
) (min-colors 16) (background light
)) (:foreground
"RosyBrown"))
307 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightSalmon"))
308 (((class color
) (min-colors 8) (background light
)) (:bold nil
))))
309 "Face used to indicate that a headline is DONE.
310 This face is only used if `org-fontify-done-headline' is set. If applies
311 to the part of the headline after the DONE keyword."
314 (defcustom org-todo-keyword-faces nil
315 "Faces for specific TODO keywords.
316 This is a list of cons cells, with TODO keywords in the car
317 and faces in the cdr. The face can be a symbol, or a property
318 list of attributes, like (:foreground \"blue\" :weight bold :underline t)."
323 (string :tag
"keyword")
324 (sexp :tag
"face"))))
326 (defcustom org-priority-faces nil
327 "Faces for specific Priorities.
328 This is a list of cons cells, with priority character in the car
329 and faces in the cdr. The face can be a symbol, or a property
330 list of attributes, like (:foreground \"blue\" :weight bold :underline t)."
335 (character :tag
"Priority")
336 (sexp :tag
"face"))))
338 (defvar org-tags-special-faces-re nil
)
339 (defun org-set-tag-faces (var value
)
342 (setq org-tags-special-faces-re nil
)
343 (setq org-tags-special-faces-re
344 (concat ":\\(" (mapconcat 'car value
"\\|") "\\):"))))
346 (defcustom org-tag-faces nil
347 "Faces for specific tags.
348 This is a list of cons cells, with tags in the car and faces in the cdr.
349 The face can be a symbol, or a property list of attributes,
350 like (:foreground \"blue\" :weight bold :underline t).
351 If you set this variable through customize, it will immediately be effective
352 in new buffers and in modified lines.
353 If you set it with Lisp, a restart of Emacs is required to activate the
357 :set
'org-set-tag-faces
361 (sexp :tag
"Face"))))
363 (defface org-table
;; originally copied from font-lock-function-name-face
364 (org-compatible-face nil
365 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Blue1"))
366 (((class color
) (min-colors 88) (background dark
)) (:foreground
"LightSkyBlue"))
367 (((class color
) (min-colors 16) (background light
)) (:foreground
"Blue"))
368 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightSkyBlue"))
369 (((class color
) (min-colors 8) (background light
)) (:foreground
"blue"))
370 (((class color
) (min-colors 8) (background dark
)))))
371 "Face used for tables."
375 (org-compatible-face nil
376 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Firebrick"))
377 (((class color
) (min-colors 88) (background dark
)) (:foreground
"chocolate1"))
378 (((class color
) (min-colors 8) (background light
)) (:foreground
"red"))
379 (((class color
) (min-colors 8) (background dark
)) (:foreground
"red"))
380 (t (:bold t
:italic t
))))
385 (org-compatible-face nil
386 '((((class color grayscale
) (min-colors 88) (background light
))
387 (:foreground
"grey50"))
388 (((class color grayscale
) (min-colors 88) (background dark
))
389 (:foreground
"grey70"))
390 (((class color
) (min-colors 8) (background light
))
391 (:foreground
"green"))
392 (((class color
) (min-colors 8) (background dark
))
393 (:foreground
"yellow"))))
394 "Face for fixed-with text like code snippets."
398 (defface org-verbatim
399 (org-compatible-face nil
400 '((((class color grayscale
) (min-colors 88) (background light
))
401 (:foreground
"grey50" :underline t
))
402 (((class color grayscale
) (min-colors 88) (background dark
))
403 (:foreground
"grey70" :underline t
))
404 (((class color
) (min-colors 8) (background light
))
405 (:foreground
"green" :underline t
))
406 (((class color
) (min-colors 8) (background dark
))
407 (:foreground
"yellow" :underline t
))))
408 "Face for fixed-with text like code snippets."
412 (defface org-clock-overlay
;; copied from secondary-selection
413 (org-compatible-face nil
414 '((((class color
) (min-colors 88) (background light
))
415 (:background
"yellow1"))
416 (((class color
) (min-colors 88) (background dark
))
417 (:background
"SkyBlue4"))
418 (((class color
) (min-colors 16) (background light
))
419 (:background
"yellow"))
420 (((class color
) (min-colors 16) (background dark
))
421 (:background
"SkyBlue4"))
422 (((class color
) (min-colors 8))
423 (:background
"cyan" :foreground
"black"))
424 (t (:inverse-video t
))))
425 "Basic face for displaying the secondary selection."
428 (defface org-agenda-structure
;; originally copied from font-lock-function-name-face
429 (org-compatible-face nil
430 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Blue1"))
431 (((class color
) (min-colors 88) (background dark
)) (:foreground
"LightSkyBlue"))
432 (((class color
) (min-colors 16) (background light
)) (:foreground
"Blue"))
433 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightSkyBlue"))
434 (((class color
) (min-colors 8)) (:foreground
"blue" :bold t
))
436 "Face used in agenda for captions and dates."
439 (unless (facep 'org-agenda-date
)
440 (copy-face 'org-agenda-structure
'org-agenda-date
)
441 (set-face-doc-string 'org-agenda-date
442 "Face used in agenda for normal days."))
444 (unless (facep 'org-agenda-date-weekend
)
445 (copy-face 'org-agenda-date
'org-agenda-date-weekend
)
446 (set-face-doc-string 'org-agenda-date-weekend
447 "Face used in agenda for weekend days.
448 See the variable `org-agenda-weekend-days' for a definition of which days
449 belong to the weekend.")
450 (when (fboundp 'set-face-attribute
)
451 (set-face-attribute 'org-agenda-date-weekend nil
:weight
'bold
)))
453 (defface org-scheduled
454 (org-compatible-face nil
455 '((((class color
) (min-colors 88) (background light
)) (:foreground
"DarkGreen"))
456 (((class color
) (min-colors 88) (background dark
)) (:foreground
"PaleGreen"))
457 (((class color
) (min-colors 8)) (:foreground
"green"))
458 (t (:bold t
:italic t
))))
459 "Face for items scheduled for a certain day."
462 (defface org-scheduled-today
463 (org-compatible-face nil
464 '((((class color
) (min-colors 88) (background light
)) (:foreground
"DarkGreen"))
465 (((class color
) (min-colors 88) (background dark
)) (:foreground
"PaleGreen"))
466 (((class color
) (min-colors 8)) (:foreground
"green"))
467 (t (:bold t
:italic t
))))
468 "Face for items scheduled for a certain day."
471 (defface org-agenda-dimmed-todo-face
472 '((((background light
)) (:foreground
"grey50"))
473 (((background dark
)) (:foreground
"grey50")))
474 "Face used to dimm blocked tasks in the agenda."
477 (defface org-scheduled-previously
478 (org-compatible-face nil
479 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Firebrick"))
480 (((class color
) (min-colors 88) (background dark
)) (:foreground
"chocolate1"))
481 (((class color
) (min-colors 8) (background light
)) (:foreground
"red"))
482 (((class color
) (min-colors 8) (background dark
)) (:foreground
"red" :bold t
))
484 "Face for items scheduled previously, and not yet done."
487 (defface org-upcoming-deadline
488 (org-compatible-face nil
489 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Firebrick"))
490 (((class color
) (min-colors 88) (background dark
)) (:foreground
"chocolate1"))
491 (((class color
) (min-colors 8) (background light
)) (:foreground
"red"))
492 (((class color
) (min-colors 8) (background dark
)) (:foreground
"red" :bold t
))
494 "Face for items scheduled previously, and not yet done."
497 (defcustom org-agenda-deadline-faces
498 '((1.0 . org-warning
)
499 (0.5 . org-upcoming-deadline
)
501 "Faces for showing deadlines in the agenda.
502 This is a list of cons cells. The cdr of each cell is a face to be used,
503 and it can also just be like '(:foreground \"yellow\").
504 Each car is a fraction of the head-warning time that must have passed for
505 this the face in the cdr to be used for display. The numbers must be
506 given in descending order. The head-warning time is normally taken
507 from `org-deadline-warning-days', but can also be specified in the deadline
508 timestamp itself, like this:
510 DEADLINE: <2007-08-13 Mon -8d>
512 You may use d for days, w for weeks, m for months and y for years. Months
513 and years will only be treated in an approximate fashion (30.4 days for a
514 month and 365.24 days for a year)."
516 :group
'org-agenda-daily
/weekly
519 (number :tag
"Fraction of head-warning time passed")
520 (sexp :tag
"Face"))))
522 (defface org-agenda-restriction-lock
523 (org-compatible-face nil
524 '((((class color
) (min-colors 88) (background light
)) (:background
"yellow1"))
525 (((class color
) (min-colors 88) (background dark
)) (:background
"skyblue4"))
526 (((class color
) (min-colors 16) (background light
)) (:background
"yellow1"))
527 (((class color
) (min-colors 16) (background dark
)) (:background
"skyblue4"))
528 (((class color
) (min-colors 8)) (:background
"cyan" :foreground
"black"))
529 (t (:inverse-video t
))))
530 "Face for showing the agenda restriction lock."
533 (defface org-time-grid
;; originally copied from font-lock-variable-name-face
534 (org-compatible-face nil
535 '((((class color
) (min-colors 16) (background light
)) (:foreground
"DarkGoldenrod"))
536 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightGoldenrod"))
537 (((class color
) (min-colors 8)) (:foreground
"yellow" :weight light
))))
538 "Face used for time grids."
541 (defconst org-level-faces
542 '(org-level-1 org-level-2 org-level-3 org-level-4
543 org-level-5 org-level-6 org-level-7 org-level-8
546 (defcustom org-n-level-faces
(length org-level-faces
)
547 "The number of different faces to be used for headlines.
548 Org-mode defines 8 different headline faces, so this can be at most 8.
549 If it is less than 8, the level-1 face gets re-used for level N+1 etc."
553 (defface org-latex-and-export-specials
554 (let ((font (cond ((assq :inherit custom-face-attributes
)
555 '(:inherit underline
))
556 (t '(:underline t
)))))
557 `((((class grayscale
) (background light
))
558 (:foreground
"DimGray" ,@font
))
559 (((class grayscale
) (background dark
))
560 (:foreground
"LightGray" ,@font
))
561 (((class color
) (background light
))
562 (:foreground
"SaddleBrown"))
563 (((class color
) (background dark
))
564 (:foreground
"burlywood"))
566 "Face used to highlight math latex and other special exporter stuff."
571 ;; arch-tag: 9dab5f91-c4b9-4d6f-bac3-1f6211ad0a04
573 ;;; org-faces.el ends here