Update copyright years again.
[org-mode.git] / lisp / org-faces.el
blobf8625f12958e0ff337b4d0c6b4ed069fab76647c
1 ;;; org-faces.el --- Face definitions for Org-mode.
3 ;; Copyright (C) 2004-2014 Free Software Foundation, Inc.
5 ;; Author: Carsten Dominik <carsten at orgmode dot org>
6 ;; Keywords: outlines, hypermedia, calendar, wp
7 ;; Homepage: http://orgmode.org
8 ;;
9 ;; This file is part of GNU Emacs.
11 ;; GNU Emacs is free software: you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation, either version 3 of the License, or
14 ;; (at your option) any later version.
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
23 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
25 ;;; Commentary:
27 ;; This file contains the face definitions for Org.
29 ;;; Code:
31 (require 'org-macs)
32 (require 'org-compat)
34 (defun org-copy-face (old-face new-face docstring &rest attributes)
35 (unless (facep new-face)
36 (if (fboundp 'set-face-attribute)
37 (progn
38 (make-face new-face)
39 (set-face-attribute new-face nil :inherit old-face)
40 (apply 'set-face-attribute new-face nil attributes)
41 (set-face-doc-string new-face docstring))
42 (copy-face old-face new-face)
43 (if (fboundp 'set-face-doc-string)
44 (set-face-doc-string new-face docstring)))))
45 (put 'org-copy-face 'lisp-indent-function 2)
47 (when (featurep 'xemacs)
48 (put 'mode-line 'face-alias 'modeline))
50 (defgroup org-faces nil
51 "Faces in Org-mode."
52 :tag "Org Faces"
53 :group 'org-appearance)
55 (defface org-default
56 (org-compatible-face 'default nil)
57 "Face used for default text."
58 :group 'org-faces)
60 (defface org-hide
61 '((((background light)) (:foreground "white"))
62 (((background dark)) (:foreground "black")))
63 "Face used to hide leading stars in headlines.
64 The foreground color of this face should be equal to the background
65 color of the frame."
66 :group 'org-faces)
68 (defface org-level-1 ;; originally copied from font-lock-function-name-face
69 (org-compatible-face 'outline-1
70 '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
71 (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
72 (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
73 (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
74 (((class color) (min-colors 8)) (:foreground "blue" :bold t))
75 (t (:bold t))))
76 "Face used for level 1 headlines."
77 :group 'org-faces)
79 (defface org-level-2 ;; originally copied from font-lock-variable-name-face
80 (org-compatible-face 'outline-2
81 '((((class color) (min-colors 16) (background light)) (:foreground "DarkGoldenrod"))
82 (((class color) (min-colors 16) (background dark)) (:foreground "LightGoldenrod"))
83 (((class color) (min-colors 8) (background light)) (:foreground "yellow"))
84 (((class color) (min-colors 8) (background dark)) (:foreground "yellow" :bold t))
85 (t (:bold t))))
86 "Face used for level 2 headlines."
87 :group 'org-faces)
89 (defface org-level-3 ;; originally copied from font-lock-keyword-face
90 (org-compatible-face 'outline-3
91 '((((class color) (min-colors 88) (background light)) (:foreground "Purple"))
92 (((class color) (min-colors 88) (background dark)) (:foreground "Cyan1"))
93 (((class color) (min-colors 16) (background light)) (:foreground "Purple"))
94 (((class color) (min-colors 16) (background dark)) (:foreground "Cyan"))
95 (((class color) (min-colors 8) (background light)) (:foreground "purple" :bold t))
96 (((class color) (min-colors 8) (background dark)) (:foreground "cyan" :bold t))
97 (t (:bold t))))
98 "Face used for level 3 headlines."
99 :group 'org-faces)
101 (defface org-level-4 ;; originally copied from font-lock-comment-face
102 (org-compatible-face 'outline-4
103 '((((class color) (min-colors 88) (background light)) (:foreground "Firebrick"))
104 (((class color) (min-colors 88) (background dark)) (:foreground "chocolate1"))
105 (((class color) (min-colors 16) (background light)) (:foreground "red"))
106 (((class color) (min-colors 16) (background dark)) (:foreground "red1"))
107 (((class color) (min-colors 8) (background light)) (:foreground "red" :bold t))
108 (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t))
109 (t (:bold t))))
110 "Face used for level 4 headlines."
111 :group 'org-faces)
113 (defface org-level-5 ;; originally copied from font-lock-type-face
114 (org-compatible-face 'outline-5
115 '((((class color) (min-colors 16) (background light)) (:foreground "ForestGreen"))
116 (((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen"))
117 (((class color) (min-colors 8)) (:foreground "green"))))
118 "Face used for level 5 headlines."
119 :group 'org-faces)
121 (defface org-level-6 ;; originally copied from font-lock-constant-face
122 (org-compatible-face 'outline-6
123 '((((class color) (min-colors 16) (background light)) (:foreground "CadetBlue"))
124 (((class color) (min-colors 16) (background dark)) (:foreground "Aquamarine"))
125 (((class color) (min-colors 8)) (:foreground "magenta"))))
126 "Face used for level 6 headlines."
127 :group 'org-faces)
129 (defface org-level-7 ;; originally copied from font-lock-builtin-face
130 (org-compatible-face 'outline-7
131 '((((class color) (min-colors 16) (background light)) (:foreground "Orchid"))
132 (((class color) (min-colors 16) (background dark)) (:foreground "LightSteelBlue"))
133 (((class color) (min-colors 8)) (:foreground "blue"))))
134 "Face used for level 7 headlines."
135 :group 'org-faces)
137 (defface org-level-8 ;; originally copied from font-lock-string-face
138 (org-compatible-face 'outline-8
139 '((((class color) (min-colors 16) (background light)) (:foreground "RosyBrown"))
140 (((class color) (min-colors 16) (background dark)) (:foreground "LightSalmon"))
141 (((class color) (min-colors 8)) (:foreground "green"))))
142 "Face used for level 8 headlines."
143 :group 'org-faces)
145 (defface org-special-keyword ;; originally copied from font-lock-string-face
146 (org-compatible-face 'font-lock-keyword-face
147 '((((class color) (min-colors 16) (background light)) (:foreground "RosyBrown"))
148 (((class color) (min-colors 16) (background dark)) (:foreground "LightSalmon"))
149 (t (:italic t))))
150 "Face used for special keywords."
151 :group 'org-faces)
153 (defface org-drawer ;; originally copied from font-lock-function-name-face
154 (org-compatible-face nil
155 '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
156 (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
157 (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
158 (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
159 (((class color) (min-colors 8)) (:foreground "blue" :bold t))
160 (t (:bold t))))
161 "Face used for drawers."
162 :group 'org-faces)
164 (defface org-property-value nil
165 "Face used for the value of a property."
166 :group 'org-faces)
168 (defface org-column
169 (org-compatible-face nil
170 '((((class color) (min-colors 16) (background light))
171 (:background "grey90" :weight normal :slant normal :strike-through nil
172 :underline nil))
173 (((class color) (min-colors 16) (background dark))
174 (:background "grey30" :weight normal :slant normal :strike-through nil
175 :underline nil))
176 (((class color) (min-colors 8))
177 (:background "cyan" :foreground "black"
178 :weight normal :slant normal :strike-through nil
179 :underline nil))
180 (t (:inverse-video t))))
181 "Face for column display of entry properties.
182 This is actually only part of the face definition for the text in column view.
183 The following faces apply, with this priority.
185 1. The color of the reference face. This is normally the level fact that
186 is used in the outline. In agenda-mode, it will be the face of the
187 first character in the line. The color is explicitly retained to
188 make sure that the column line still looks a bit like the structure
189 line it is masking.
191 2. The `org-column' face.
193 3. The remaining properties of the reference face.
195 Since column view works by putting overlays with a display property
196 over individual characters in the buffer, the face of the underlining
197 character (this might for example be the a TODO keyword) might still
198 shine through in some properties. So when your column view looks
199 funny, with \"random\" colors, weight, strike-through, try to explicitly
200 set the properties in the `org-column' face. For example, set
201 :underline to nil, or the :slant to `normal'.
203 Under XEmacs, the rules are simpler, because the XEmacs version of
204 column view defines special faces for each outline level. See the file
205 `org-colview-xemacs.el' in Org's contrib/ directory for details."
206 :group 'org-faces)
208 (defface org-column-title
209 (org-compatible-face nil
210 '((((class color) (min-colors 16) (background light))
211 (:background "grey90" :underline t :weight bold))
212 (((class color) (min-colors 16) (background dark))
213 (:background "grey30" :underline t :weight bold))
214 (((class color) (min-colors 8))
215 (:background "cyan" :foreground "black" :underline t :weight bold))
216 (t (:inverse-video t))))
217 "Face for column display of entry properties."
218 :group 'org-faces)
220 (defface org-agenda-column-dateline
221 (org-compatible-face 'org-column
222 '((t nil)))
223 "Face used in agenda column view for datelines with summaries."
224 :group 'org-faces)
226 (defface org-warning
227 (org-compatible-face 'font-lock-warning-face
228 '((((class color) (min-colors 16) (background light)) (:foreground "Red1" :bold t))
229 (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :bold t))
230 (((class color) (min-colors 8) (background light)) (:foreground "red" :bold t))
231 (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t))
232 (t (:bold t))))
233 "Face for deadlines and TODO keywords."
234 :group 'org-faces)
236 (defface org-archived ; similar to shadow
237 (org-compatible-face 'shadow
238 '((((class color grayscale) (min-colors 88) (background light))
239 (:foreground "grey50"))
240 (((class color grayscale) (min-colors 88) (background dark))
241 (:foreground "grey70"))
242 (((class color) (min-colors 8) (background light))
243 (:foreground "green"))
244 (((class color) (min-colors 8) (background dark))
245 (:foreground "yellow"))))
246 "Face for headline with the ARCHIVE tag."
247 :group 'org-faces)
249 (defface org-link
250 (org-compatible-face 'link
251 '((((class color) (background light)) (:foreground "Purple" :underline t))
252 (((class color) (background dark)) (:foreground "Cyan" :underline t))
253 (t (:underline t))))
254 "Face for links."
255 :group 'org-faces)
257 (defface org-footnote
258 '((((class color) (background light)) (:foreground "Purple" :underline t))
259 (((class color) (background dark)) (:foreground "Cyan" :underline t))
260 (t (:underline t)))
261 "Face for footnotes."
262 :group 'org-faces)
264 (defface org-ellipsis
265 '((((class color) (background light)) (:foreground "DarkGoldenrod" :underline t))
266 (((class color) (background dark)) (:foreground "LightGoldenrod" :underline t))
267 (t (:strike-through t)))
268 "Face for the ellipsis in folded text."
269 :group 'org-faces)
271 (defface org-target
272 '((((class color) (background light)) (:underline t))
273 (((class color) (background dark)) (:underline t))
274 (t (:underline t)))
275 "Face for link targets."
276 :group 'org-faces)
278 (defface org-date
279 '((((class color) (background light)) (:foreground "Purple" :underline t))
280 (((class color) (background dark)) (:foreground "Cyan" :underline t))
281 (t (:underline t)))
282 "Face for date/time stamps."
283 :group 'org-faces)
285 (defface org-date-selected
286 (org-compatible-face nil
287 '((((class color) (min-colors 16) (background light)) (:foreground "Red1" :inverse-video t))
288 (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :inverse-video t))
289 (((class color) (min-colors 8) (background light)) (:foreground "red" :inverse-video t))
290 (((class color) (min-colors 8) (background dark)) (:foreground "red" :inverse-video t))
291 (t (:inverse-video t))))
292 "Face for highlighting the calendar day when using `org-read-date'.
293 Using a bold face here might cause discrepancies while displaying the
294 calendar."
295 :group 'org-faces)
297 (defface org-sexp-date
298 '((((class color) (background light)) (:foreground "Purple"))
299 (((class color) (background dark)) (:foreground "Cyan"))
300 (t (:underline t)))
301 "Face for diary-like sexp date specifications."
302 :group 'org-faces)
304 (defface org-tag
305 '((t (:bold t)))
306 "Default face for tags.
307 Note that the variable `org-tag-faces' can be used to overrule this face for
308 specific tags."
309 :group 'org-faces)
311 (defface org-list-dt
312 '((t (:bold t)))
313 "Default face for definition terms in lists."
314 :group 'org-faces)
316 (defface org-todo ; font-lock-warning-face
317 (org-compatible-face nil
318 '((((class color) (min-colors 16) (background light)) (:foreground "Red1" :bold t))
319 (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :bold t))
320 (((class color) (min-colors 8) (background light)) (:foreground "red" :bold t))
321 (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t))
322 (t (:inverse-video t :bold t))))
323 "Face for TODO keywords."
324 :group 'org-faces)
326 (defface org-done ;; originally copied from font-lock-type-face
327 (org-compatible-face nil
328 '((((class color) (min-colors 16) (background light)) (:foreground "ForestGreen" :bold t))
329 (((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen" :bold t))
330 (((class color) (min-colors 8)) (:foreground "green"))
331 (t (:bold t))))
332 "Face used for todo keywords that indicate DONE items."
333 :group 'org-faces)
335 (defface org-agenda-done ;; originally copied from font-lock-type-face
336 (org-compatible-face nil
337 '((((class color) (min-colors 16) (background light)) (:foreground "ForestGreen"))
338 (((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen"))
339 (((class color) (min-colors 8)) (:foreground "green"))
340 (t (:bold nil))))
341 "Face used in agenda, to indicate lines switched to DONE.
342 This face is used to de-emphasize items that where brightly colored in the
343 agenda because they were things to do, or overdue. The DONE state itself
344 is of course immediately visible, but for example a passed deadline is
345 \(by default) very bright read. This face could be simply the default face
346 of the frame, for example."
347 :group 'org-faces)
349 (defface org-headline-done ;; originally copied from font-lock-string-face
350 (org-compatible-face nil
351 '((((class color) (min-colors 16) (background light)) (:foreground "RosyBrown"))
352 (((class color) (min-colors 16) (background dark)) (:foreground "LightSalmon"))
353 (((class color) (min-colors 8) (background light)) (:bold nil))))
354 "Face used to indicate that a headline is DONE.
355 This face is only used if `org-fontify-done-headline' is set. If applies
356 to the part of the headline after the DONE keyword."
357 :group 'org-faces)
359 (defcustom org-faces-easy-properties
360 '((todo . :foreground) (tag . :foreground) (priority . :foreground))
361 "The property changes by easy faces.
362 This is an alist, the keys show the area of application, the values
363 can be `:foreground' or `:background'. A color string for special
364 keywords will then be interpreted as either foreground or background
365 color."
366 :group 'org-faces
367 :group 'org-todo
368 :version "24.1"
369 :type '(repeat
370 (cons (choice (const todo) (const tag) (const priority))
371 (choice (const :foreground) (const :background)))))
373 (defcustom org-todo-keyword-faces nil
374 "Faces for specific TODO keywords.
375 This is a list of cons cells, with TODO keywords in the car
376 and faces in the cdr. The face can be a symbol, a color
377 as a string (in which case the rest is inherited from the `org-todo' face),
378 or a property list of attributes, like
379 (:foreground \"blue\" :weight bold :underline t).
380 If it is a color string, the variable `org-faces-easy-properties'
381 determines if it is a foreground or a background color."
382 :group 'org-faces
383 :group 'org-todo
384 :type '(repeat
385 (cons
386 (string :tag "Keyword")
387 (choice :tag "Face "
388 (string :tag "Color")
389 (sexp :tag "Face")))))
391 (defface org-priority ;; originally copied from font-lock-string-face
392 (org-compatible-face 'font-lock-keyword-face
393 '((((class color) (min-colors 16) (background light)) (:foreground "RosyBrown"))
394 (((class color) (min-colors 16) (background dark)) (:foreground "LightSalmon"))
395 (t (:italic t))))
396 "Face used for priority cookies."
397 :group 'org-faces)
399 (defcustom org-priority-faces nil
400 "Faces for specific Priorities.
401 This is a list of cons cells, with priority character in the car
402 and faces in the cdr. The face can be a symbol, a color as
403 as a string, or a property list of attributes, like
404 (:foreground \"blue\" :weight bold :underline t).
405 If it is a color string, the variable `org-faces-easy-properties'
406 determines if it is a foreground or a background color."
407 :group 'org-faces
408 :group 'org-todo
409 :type '(repeat
410 (cons
411 (character :tag "Priority")
412 (choice :tag "Face "
413 (string :tag "Color")
414 (sexp :tag "Face")))))
416 (defvar org-tags-special-faces-re nil)
417 (defun org-set-tag-faces (var value)
418 (set var value)
419 (if (not value)
420 (setq org-tags-special-faces-re nil)
421 (setq org-tags-special-faces-re
422 (concat ":\\(" (mapconcat 'car value "\\|") "\\):"))))
424 (defface org-checkbox
425 (org-compatible-face 'bold
426 '((t (:bold t))))
427 "Face for checkboxes."
428 :group 'org-faces)
431 (org-copy-face 'org-todo 'org-checkbox-statistics-todo
432 "Face used for unfinished checkbox statistics.")
434 (org-copy-face 'org-done 'org-checkbox-statistics-done
435 "Face used for finished checkbox statistics.")
437 (defcustom org-tag-faces nil
438 "Faces for specific tags.
439 This is a list of cons cells, with tags in the car and faces in the cdr.
440 The face can be a symbol, a foreground color (in which case the rest is
441 inherited from the `org-tag' face) or a property list of attributes,
442 like (:foreground \"blue\" :weight bold :underline t).
443 If you set this variable through customize, it will immediately be effective
444 in new buffers and in modified lines.
445 If you set it with Lisp, a restart of Emacs is required to activate the
446 changes."
447 :group 'org-faces
448 :group 'org-tags
449 :set 'org-set-tag-faces
450 :type '(repeat
451 (cons
452 (string :tag "Tag ")
453 (choice :tag "Face"
454 (string :tag "Foreground color")
455 (sexp :tag "Face")))))
457 (defface org-table ;; originally copied from font-lock-function-name-face
458 (org-compatible-face nil
459 '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
460 (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
461 (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
462 (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
463 (((class color) (min-colors 8) (background light)) (:foreground "blue"))
464 (((class color) (min-colors 8) (background dark)))))
465 "Face used for tables."
466 :group 'org-faces)
468 (defface org-formula
469 (org-compatible-face nil
470 '((((class color) (min-colors 88) (background light)) (:foreground "Firebrick"))
471 (((class color) (min-colors 88) (background dark)) (:foreground "chocolate1"))
472 (((class color) (min-colors 8) (background light)) (:foreground "red"))
473 (((class color) (min-colors 8) (background dark)) (:foreground "red"))
474 (t (:bold t :italic t))))
475 "Face for formulas."
476 :group 'org-faces)
478 (defface org-code
479 (org-compatible-face 'shadow
480 '((((class color grayscale) (min-colors 88) (background light))
481 (:foreground "grey50"))
482 (((class color grayscale) (min-colors 88) (background dark))
483 (:foreground "grey70"))
484 (((class color) (min-colors 8) (background light))
485 (:foreground "green"))
486 (((class color) (min-colors 8) (background dark))
487 (:foreground "yellow"))))
488 "Face for fixed-width text like code snippets."
489 :group 'org-faces
490 :version "22.1")
492 (defface org-meta-line
493 (org-compatible-face 'font-lock-comment-face nil)
494 "Face for meta lines startin with \"#+\"."
495 :group 'org-faces
496 :version "22.1")
498 (defface org-document-title
499 '((((class color) (background light)) (:foreground "midnight blue" :weight bold))
500 (((class color) (background dark)) (:foreground "pale turquoise" :weight bold))
501 (t (:weight bold)))
502 "Face for document title, i.e. that which follows the #+TITLE: keyword."
503 :group 'org-faces)
505 (defface org-document-info
506 '((((class color) (background light)) (:foreground "midnight blue"))
507 (((class color) (background dark)) (:foreground "pale turquoise"))
508 (t nil))
509 "Face for document date, author and email; i.e. that which
510 follows a #+DATE:, #+AUTHOR: or #+EMAIL: keyword."
511 :group 'org-faces)
513 (defface org-document-info-keyword
514 (org-compatible-face 'shadow
515 '((((class color grayscale) (min-colors 88) (background light))
516 (:foreground "grey50"))
517 (((class color grayscale) (min-colors 88) (background dark))
518 (:foreground "grey70"))
519 (((class color) (min-colors 8) (background light))
520 (:foreground "green"))
521 (((class color) (min-colors 8) (background dark))
522 (:foreground "yellow"))))
523 "Face for #+TITLE:, #+AUTHOR:, #+EMAIL: and #+DATE: keywords."
524 :group 'org-faces)
526 (defface org-block
527 (org-compatible-face 'shadow
528 '((((class color grayscale) (min-colors 88) (background light))
529 (:foreground "grey50"))
530 (((class color grayscale) (min-colors 88) (background dark))
531 (:foreground "grey70"))
532 (((class color) (min-colors 8) (background light))
533 (:foreground "green"))
534 (((class color) (min-colors 8) (background dark))
535 (:foreground "yellow"))))
536 "Face text in #+begin ... #+end blocks."
537 :group 'org-faces
538 :version "22.1")
540 (defface org-block-background '((t ()))
541 "Face used for the source block background.")
543 (org-copy-face 'org-meta-line 'org-block-begin-line
544 "Face used for the line delimiting the begin of source blocks.")
546 (org-copy-face 'org-meta-line 'org-block-end-line
547 "Face used for the line delimiting the end of source blocks.")
549 (defface org-verbatim
550 (org-compatible-face 'shadow
551 '((((class color grayscale) (min-colors 88) (background light))
552 (:foreground "grey50" :underline t))
553 (((class color grayscale) (min-colors 88) (background dark))
554 (:foreground "grey70" :underline t))
555 (((class color) (min-colors 8) (background light))
556 (:foreground "green" :underline t))
557 (((class color) (min-colors 8) (background dark))
558 (:foreground "yellow" :underline t))))
559 "Face for fixed-with text like code snippets."
560 :group 'org-faces
561 :version "22.1")
563 (org-copy-face 'org-block 'org-quote
564 "Face for #+BEGIN_QUOTE ... #+END_QUOTE blocks.")
565 (org-copy-face 'org-block 'org-verse
566 "Face for #+BEGIN_VERSE ... #+END_VERSE blocks.")
568 (defcustom org-fontify-quote-and-verse-blocks nil
569 "Non-nil means, add a special face to #+begin_quote and #+begin_verse block.
570 When nil, format these as normal Org. This is the default, because the
571 content of these blocks will still be treated as Org syntax."
572 :group 'org-faces
573 :version "24.1"
574 :type 'boolean)
576 (defface org-clock-overlay ;; copied from secondary-selection
577 (org-compatible-face nil
578 '((((class color) (min-colors 88) (background light))
579 (:background "yellow1"))
580 (((class color) (min-colors 88) (background dark))
581 (:background "SkyBlue4"))
582 (((class color) (min-colors 16) (background light))
583 (:background "yellow"))
584 (((class color) (min-colors 16) (background dark))
585 (:background "SkyBlue4"))
586 (((class color) (min-colors 8))
587 (:background "cyan" :foreground "black"))
588 (t (:inverse-video t))))
589 "Basic face for displaying the secondary selection."
590 :group 'org-faces)
592 (defface org-agenda-structure ;; originally copied from font-lock-function-name-face
593 (org-compatible-face nil
594 '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
595 (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
596 (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
597 (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
598 (((class color) (min-colors 8)) (:foreground "blue" :bold t))
599 (t (:bold t))))
600 "Face used in agenda for captions and dates."
601 :group 'org-faces)
603 (org-copy-face 'org-agenda-structure 'org-agenda-date
604 "Face used in agenda for normal days.")
606 (org-copy-face 'org-agenda-date 'org-agenda-date-today
607 "Face used in agenda for today."
608 :weight 'bold :italic 't)
610 (org-copy-face 'secondary-selection 'org-agenda-clocking
611 "Face marking the current clock item in the agenda.")
613 (org-copy-face 'org-agenda-date 'org-agenda-date-weekend
614 "Face used in agenda for weekend days.
615 See the variable `org-agenda-weekend-days' for a definition of which days
616 belong to the weekend."
617 :weight 'bold)
619 (defface org-scheduled
620 (org-compatible-face nil
621 '((((class color) (min-colors 88) (background light)) (:foreground "DarkGreen"))
622 (((class color) (min-colors 88) (background dark)) (:foreground "PaleGreen"))
623 (((class color) (min-colors 8)) (:foreground "green"))
624 (t (:bold t :italic t))))
625 "Face for items scheduled for a certain day."
626 :group 'org-faces)
628 (defface org-scheduled-today
629 (org-compatible-face nil
630 '((((class color) (min-colors 88) (background light)) (:foreground "DarkGreen"))
631 (((class color) (min-colors 88) (background dark)) (:foreground "PaleGreen"))
632 (((class color) (min-colors 8)) (:foreground "green"))
633 (t (:bold t :italic t))))
634 "Face for items scheduled for a certain day."
635 :group 'org-faces)
637 (defface org-agenda-dimmed-todo-face
638 '((((background light)) (:foreground "grey50"))
639 (((background dark)) (:foreground "grey50")))
640 "Face used to dim blocked tasks in the agenda."
641 :group 'org-faces)
643 (defface org-scheduled-previously
644 (org-compatible-face nil
645 '((((class color) (min-colors 88) (background light)) (:foreground "Firebrick"))
646 (((class color) (min-colors 88) (background dark)) (:foreground "chocolate1"))
647 (((class color) (min-colors 8) (background light)) (:foreground "red"))
648 (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t))
649 (t (:bold t))))
650 "Face for items scheduled previously, and not yet done."
651 :group 'org-faces)
653 (defface org-upcoming-deadline
654 (org-compatible-face nil
655 '((((class color) (min-colors 88) (background light)) (:foreground "Firebrick"))
656 (((class color) (min-colors 88) (background dark)) (:foreground "chocolate1"))
657 (((class color) (min-colors 8) (background light)) (:foreground "red"))
658 (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t))
659 (t (:bold t))))
660 "Face for items scheduled previously, and not yet done."
661 :group 'org-faces)
663 (defcustom org-agenda-deadline-faces
664 '((1.0 . org-warning)
665 (0.5 . org-upcoming-deadline)
666 (0.0 . default))
667 "Faces for showing deadlines in the agenda.
668 This is a list of cons cells. The cdr of each cell is a face to be used,
669 and it can also just be like '(:foreground \"yellow\").
670 Each car is a fraction of the head-warning time that must have passed for
671 this the face in the cdr to be used for display. The numbers must be
672 given in descending order. The head-warning time is normally taken
673 from `org-deadline-warning-days', but can also be specified in the deadline
674 timestamp itself, like this:
676 DEADLINE: <2007-08-13 Mon -8d>
678 You may use d for days, w for weeks, m for months and y for years. Months
679 and years will only be treated in an approximate fashion (30.4 days for a
680 month and 365.24 days for a year)."
681 :group 'org-faces
682 :group 'org-agenda-daily/weekly
683 :type '(repeat
684 (cons
685 (number :tag "Fraction of head-warning time passed")
686 (sexp :tag "Face"))))
688 (defface org-agenda-restriction-lock
689 (org-compatible-face nil
690 '((((class color) (min-colors 88) (background light)) (:background "#eeeeee"))
691 (((class color) (min-colors 88) (background dark)) (:background "#1C1C1C"))
692 (((class color) (min-colors 16) (background light)) (:background "#eeeeee"))
693 (((class color) (min-colors 16) (background dark)) (:background "#1C1C1C"))
694 (((class color) (min-colors 8)) (:background "cyan" :foreground "black"))
695 (t (:inverse-video t))))
696 "Face for showing the agenda restriction lock."
697 :group 'org-faces)
699 (defface org-agenda-filter-tags
700 (org-compatible-face 'mode-line nil)
701 "Face for tag(s) in the mode-line when filtering the agenda."
702 :group 'org-faces)
704 (defface org-agenda-filter-regexp
705 (org-compatible-face 'mode-line nil)
706 "Face for regexp(s) in the mode-line when filtering the agenda."
707 :group 'org-faces)
709 (defface org-agenda-filter-category
710 (org-compatible-face 'mode-line nil)
711 "Face for categories(s) in the mode-line when filtering the agenda."
712 :group 'org-faces)
714 (defface org-time-grid ;; originally copied from font-lock-variable-name-face
715 (org-compatible-face nil
716 '((((class color) (min-colors 16) (background light)) (:foreground "DarkGoldenrod"))
717 (((class color) (min-colors 16) (background dark)) (:foreground "LightGoldenrod"))
718 (((class color) (min-colors 8)) (:foreground "yellow" :weight light))))
719 "Face used for time grids."
720 :group 'org-faces)
722 (org-copy-face 'org-time-grid 'org-agenda-current-time
723 "Face used to show the current time in the time grid.")
725 (defface org-agenda-diary
726 (org-compatible-face 'default nil)
727 "Face used for agenda entries that come from the Emacs diary."
728 :group 'org-faces)
730 (defface org-agenda-calendar-event
731 (org-compatible-face 'default nil)
732 "Face used to show events and appointments in the agenda."
733 :group 'org-faces)
735 (defface org-agenda-calendar-sexp
736 (org-compatible-face 'default nil)
737 "Face used to show events computed from a S-expression."
738 :group 'org-faces)
740 (defconst org-level-faces
741 '(org-level-1 org-level-2 org-level-3 org-level-4
742 org-level-5 org-level-6 org-level-7 org-level-8
745 (defcustom org-n-level-faces (length org-level-faces)
746 "The number of different faces to be used for headlines.
747 Org-mode defines 8 different headline faces, so this can be at most 8.
748 If it is less than 8, the level-1 face gets re-used for level N+1 etc."
749 :type 'integer
750 :group 'org-faces)
752 (defcustom org-cycle-level-faces t
753 "Non-nil means level styles cycle after level `org-n-level-faces'.
754 Then so level org-n-level-faces+1 is styled like level 1.
755 If nil, then all levels >=org-n-level-faces are styled like
756 level org-n-level-faces"
757 :group 'org-appearance
758 :group 'org-faces
759 :version "24.1"
760 :type 'boolean)
762 (defface org-latex-and-related
763 (let ((font (cond ((assq :inherit custom-face-attributes)
764 '(:inherit underline))
765 (t '(:underline t)))))
766 `((((class grayscale) (background light))
767 (:foreground "DimGray" ,@font))
768 (((class grayscale) (background dark))
769 (:foreground "LightGray" ,@font))
770 (((class color) (background light))
771 (:foreground "SaddleBrown"))
772 (((class color) (background dark))
773 (:foreground "burlywood"))
774 (t (,@font))))
775 "Face used to highlight LaTeX data, entities and sub/superscript."
776 :group 'org-faces
777 :version "24.4"
778 :package-version '(Org . "8.0"))
780 (defface org-macro
781 (org-compatible-face 'org-latex-and-related nil)
782 "Face for macros."
783 :group 'org-faces
784 :version "24.4"
785 :package-version '(Org . "8.0"))
787 (defface org-tag-group
788 (org-compatible-face 'org-tag nil)
789 "Face for group tags."
790 :group 'org-faces
791 :version "24.4"
792 :package-version '(Org . "8.0"))
794 (org-copy-face 'mode-line 'org-mode-line-clock
795 "Face used for clock display in mode line.")
796 (org-copy-face 'mode-line 'org-mode-line-clock-overrun
797 "Face used for clock display for overrun tasks in mode line."
798 :background "red")
800 (provide 'org-faces)
802 ;;; org-faces.el ends here