Implement description lists.
[org-mode.git] / lisp / org-faces.el
blobb637524d1653d03674119819e2ccc0336a1e03f4
1 ;;; org-faces.el --- Face definitions for Org-mode.
3 ;; Copyright (C) 2004, 2005, 2006, 2007, 2008 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 ;; Version: 6.02b
9 ;;
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 3, or (at your option)
15 ;; any later version.
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 ;; Boston, MA 02110-1301, USA.
26 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
28 ;;; Commentary:
30 ;; This file contains the face definitons for Org.
32 ;;; Code:
34 (require 'org-macs)
35 (require 'org-compat)
37 (defgroup org-faces nil
38 "Faces in Org-mode."
39 :tag "Org Faces"
40 :group 'org-font-lock)
42 (defface org-hide
43 '((((background light)) (:foreground "white"))
44 (((background dark)) (:foreground "black")))
45 "Face used to hide leading stars in headlines.
46 The forground color of this face should be equal to the background
47 color of the frame."
48 :group 'org-faces)
50 (defface org-level-1 ;; originally copied from font-lock-function-name-face
51 (org-compatible-face 'outline-1
52 '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
53 (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
54 (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
55 (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
56 (((class color) (min-colors 8)) (:foreground "blue" :bold t))
57 (t (:bold t))))
58 "Face used for level 1 headlines."
59 :group 'org-faces)
61 (defface org-level-2 ;; originally copied from font-lock-variable-name-face
62 (org-compatible-face 'outline-2
63 '((((class color) (min-colors 16) (background light)) (:foreground "DarkGoldenrod"))
64 (((class color) (min-colors 16) (background dark)) (:foreground "LightGoldenrod"))
65 (((class color) (min-colors 8) (background light)) (:foreground "yellow"))
66 (((class color) (min-colors 8) (background dark)) (:foreground "yellow" :bold t))
67 (t (:bold t))))
68 "Face used for level 2 headlines."
69 :group 'org-faces)
71 (defface org-level-3 ;; originally copied from font-lock-keyword-face
72 (org-compatible-face 'outline-3
73 '((((class color) (min-colors 88) (background light)) (:foreground "Purple"))
74 (((class color) (min-colors 88) (background dark)) (:foreground "Cyan1"))
75 (((class color) (min-colors 16) (background light)) (:foreground "Purple"))
76 (((class color) (min-colors 16) (background dark)) (:foreground "Cyan"))
77 (((class color) (min-colors 8) (background light)) (:foreground "purple" :bold t))
78 (((class color) (min-colors 8) (background dark)) (:foreground "cyan" :bold t))
79 (t (:bold t))))
80 "Face used for level 3 headlines."
81 :group 'org-faces)
83 (defface org-level-4 ;; originally copied from font-lock-comment-face
84 (org-compatible-face 'outline-4
85 '((((class color) (min-colors 88) (background light)) (:foreground "Firebrick"))
86 (((class color) (min-colors 88) (background dark)) (:foreground "chocolate1"))
87 (((class color) (min-colors 16) (background light)) (:foreground "red"))
88 (((class color) (min-colors 16) (background dark)) (:foreground "red1"))
89 (((class color) (min-colors 8) (background light)) (:foreground "red" :bold t))
90 (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t))
91 (t (:bold t))))
92 "Face used for level 4 headlines."
93 :group 'org-faces)
95 (defface org-level-5 ;; originally copied from font-lock-type-face
96 (org-compatible-face 'outline-5
97 '((((class color) (min-colors 16) (background light)) (:foreground "ForestGreen"))
98 (((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen"))
99 (((class color) (min-colors 8)) (:foreground "green"))))
100 "Face used for level 5 headlines."
101 :group 'org-faces)
103 (defface org-level-6 ;; originally copied from font-lock-constant-face
104 (org-compatible-face 'outline-6
105 '((((class color) (min-colors 16) (background light)) (:foreground "CadetBlue"))
106 (((class color) (min-colors 16) (background dark)) (:foreground "Aquamarine"))
107 (((class color) (min-colors 8)) (:foreground "magenta"))))
108 "Face used for level 6 headlines."
109 :group 'org-faces)
111 (defface org-level-7 ;; originally copied from font-lock-builtin-face
112 (org-compatible-face 'outline-7
113 '((((class color) (min-colors 16) (background light)) (:foreground "Orchid"))
114 (((class color) (min-colors 16) (background dark)) (:foreground "LightSteelBlue"))
115 (((class color) (min-colors 8)) (:foreground "blue"))))
116 "Face used for level 7 headlines."
117 :group 'org-faces)
119 (defface org-level-8 ;; originally copied from font-lock-string-face
120 (org-compatible-face 'outline-8
121 '((((class color) (min-colors 16) (background light)) (:foreground "RosyBrown"))
122 (((class color) (min-colors 16) (background dark)) (:foreground "LightSalmon"))
123 (((class color) (min-colors 8)) (:foreground "green"))))
124 "Face used for level 8 headlines."
125 :group 'org-faces)
127 (defface org-special-keyword ;; originally copied from font-lock-string-face
128 (org-compatible-face nil
129 '((((class color) (min-colors 16) (background light)) (:foreground "RosyBrown"))
130 (((class color) (min-colors 16) (background dark)) (:foreground "LightSalmon"))
131 (t (:italic t))))
132 "Face used for special keywords."
133 :group 'org-faces)
135 (defface org-drawer ;; originally copied from font-lock-function-name-face
136 (org-compatible-face nil
137 '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
138 (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
139 (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
140 (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
141 (((class color) (min-colors 8)) (:foreground "blue" :bold t))
142 (t (:bold t))))
143 "Face used for drawers."
144 :group 'org-faces)
146 (defface org-property-value nil
147 "Face used for the value of a property."
148 :group 'org-faces)
150 (defface org-column
151 (org-compatible-face nil
152 '((((class color) (min-colors 16) (background light))
153 (:background "grey90" :weight normal :strike-through nil :underline nil))
154 (((class color) (min-colors 16) (background dark))
155 (:background "grey30" :weight normal :strike-through nil :underline nil))
156 (((class color) (min-colors 8))
157 (:background "cyan" :foreground "black"
158 :weight normal :strike-through nil :underline nil))
159 (t (:inverse-video t))))
160 "Face for column display of entry properties."
161 :group 'org-faces)
163 (defface org-column-title
164 (org-compatible-face nil
165 '((((class color) (min-colors 16) (background light))
166 (:background "grey90" :underline t :weight bold))
167 (((class color) (min-colors 16) (background dark))
168 (:background "grey30" :underline t :weight bold))
169 (((class color) (min-colors 8))
170 (:background "cyan" :foreground "black" :underline t :weight bold))
171 (t (:inverse-video t))))
172 "Face for column display of entry properties."
173 :group 'org-faces)
175 (when (fboundp 'set-face-attribute)
176 ;; Make sure that a fixed-width face is used when we have a column table.
177 (set-face-attribute 'org-column nil
178 :height (face-attribute 'default :height)
179 :family (face-attribute 'default :family)))
181 (defface org-warning
182 (org-compatible-face 'font-lock-warning-face
183 '((((class color) (min-colors 16) (background light)) (:foreground "Red1" :bold t))
184 (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :bold t))
185 (((class color) (min-colors 8) (background light)) (:foreground "red" :bold t))
186 (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t))
187 (t (:bold t))))
188 "Face for deadlines and TODO keywords."
189 :group 'org-faces)
191 (defface org-archived ; similar to shadow
192 (org-compatible-face 'shadow
193 '((((class color grayscale) (min-colors 88) (background light))
194 (:foreground "grey50"))
195 (((class color grayscale) (min-colors 88) (background dark))
196 (:foreground "grey70"))
197 (((class color) (min-colors 8) (background light))
198 (:foreground "green"))
199 (((class color) (min-colors 8) (background dark))
200 (:foreground "yellow"))))
201 "Face for headline with the ARCHIVE tag."
202 :group 'org-faces)
204 (defface org-link
205 '((((class color) (background light)) (:foreground "Purple" :underline t))
206 (((class color) (background dark)) (:foreground "Cyan" :underline t))
207 (t (:underline t)))
208 "Face for links."
209 :group 'org-faces)
211 (defface org-ellipsis
212 '((((class color) (background light)) (:foreground "DarkGoldenrod" :underline t))
213 (((class color) (background dark)) (:foreground "LightGoldenrod" :underline t))
214 (t (:strike-through t)))
215 "Face for the ellipsis in folded text."
216 :group 'org-faces)
218 (defface org-target
219 '((((class color) (background light)) (:underline t))
220 (((class color) (background dark)) (:underline t))
221 (t (:underline t)))
222 "Face for links."
223 :group 'org-faces)
225 (defface org-date
226 '((((class color) (background light)) (:foreground "Purple" :underline t))
227 (((class color) (background dark)) (:foreground "Cyan" :underline t))
228 (t (:underline t)))
229 "Face for links."
230 :group 'org-faces)
232 (defface org-sexp-date
233 '((((class color) (background light)) (:foreground "Purple"))
234 (((class color) (background dark)) (:foreground "Cyan"))
235 (t (:underline t)))
236 "Face for links."
237 :group 'org-faces)
239 (defface org-tag
240 '((t (:bold t)))
241 "Face for tags."
242 :group 'org-faces)
244 (defface org-todo ; font-lock-warning-face
245 (org-compatible-face nil
246 '((((class color) (min-colors 16) (background light)) (:foreground "Red1" :bold t))
247 (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :bold t))
248 (((class color) (min-colors 8) (background light)) (:foreground "red" :bold t))
249 (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t))
250 (t (:inverse-video t :bold t))))
251 "Face for TODO keywords."
252 :group 'org-faces)
254 (defface org-done ;; originally copied from font-lock-type-face
255 (org-compatible-face nil
256 '((((class color) (min-colors 16) (background light)) (:foreground "ForestGreen" :bold t))
257 (((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen" :bold t))
258 (((class color) (min-colors 8)) (:foreground "green"))
259 (t (:bold t))))
260 "Face used for todo keywords that indicate DONE items."
261 :group 'org-faces)
263 (defface org-headline-done ;; originally copied from font-lock-string-face
264 (org-compatible-face nil
265 '((((class color) (min-colors 16) (background light)) (:foreground "RosyBrown"))
266 (((class color) (min-colors 16) (background dark)) (:foreground "LightSalmon"))
267 (((class color) (min-colors 8) (background light)) (:bold nil))))
268 "Face used to indicate that a headline is DONE.
269 This face is only used if `org-fontify-done-headline' is set. If applies
270 to the part of the headline after the DONE keyword."
271 :group 'org-faces)
273 (defcustom org-todo-keyword-faces nil
274 "Faces for specific TODO keywords.
275 This is a list of cons cells, with TODO keywords in the car
276 and faces in the cdr. The face can be a symbol, or a property
277 list of attributes, like (:foreground \"blue\" :weight bold :underline t)."
278 :group 'org-faces
279 :group 'org-todo
280 :type '(repeat
281 (cons
282 (string :tag "keyword")
283 (sexp :tag "face"))))
285 (defface org-table ;; originally copied from font-lock-function-name-face
286 (org-compatible-face nil
287 '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
288 (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
289 (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
290 (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
291 (((class color) (min-colors 8) (background light)) (:foreground "blue"))
292 (((class color) (min-colors 8) (background dark)))))
293 "Face used for tables."
294 :group 'org-faces)
296 (defface org-formula
297 (org-compatible-face nil
298 '((((class color) (min-colors 88) (background light)) (:foreground "Firebrick"))
299 (((class color) (min-colors 88) (background dark)) (:foreground "chocolate1"))
300 (((class color) (min-colors 8) (background light)) (:foreground "red"))
301 (((class color) (min-colors 8) (background dark)) (:foreground "red"))
302 (t (:bold t :italic t))))
303 "Face for formulas."
304 :group 'org-faces)
306 (defface org-code
307 (org-compatible-face nil
308 '((((class color grayscale) (min-colors 88) (background light))
309 (:foreground "grey50"))
310 (((class color grayscale) (min-colors 88) (background dark))
311 (:foreground "grey70"))
312 (((class color) (min-colors 8) (background light))
313 (:foreground "green"))
314 (((class color) (min-colors 8) (background dark))
315 (:foreground "yellow"))))
316 "Face for fixed-with text like code snippets."
317 :group 'org-faces
318 :version "22.1")
320 (defface org-verbatim
321 (org-compatible-face nil
322 '((((class color grayscale) (min-colors 88) (background light))
323 (:foreground "grey50" :underline t))
324 (((class color grayscale) (min-colors 88) (background dark))
325 (:foreground "grey70" :underline t))
326 (((class color) (min-colors 8) (background light))
327 (:foreground "green" :underline t))
328 (((class color) (min-colors 8) (background dark))
329 (:foreground "yellow" :underline t))))
330 "Face for fixed-with text like code snippets."
331 :group 'org-faces
332 :version "22.1")
334 (defface org-agenda-structure ;; originally copied from font-lock-function-name-face
335 (org-compatible-face nil
336 '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
337 (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
338 (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
339 (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
340 (((class color) (min-colors 8)) (:foreground "blue" :bold t))
341 (t (:bold t))))
342 "Face used in agenda for captions and dates."
343 :group 'org-faces)
345 (unless (facep 'org-agenda-date)
346 (copy-face 'org-agenda-structure 'org-agenda-date)
347 (set-face-doc-string 'org-agenda-date
348 "Face used in agenda for normal days."))
350 (unless (facep 'org-agenda-date-weekend)
351 (copy-face 'org-agenda-date 'org-agenda-date-weekend)
352 (set-face-doc-string 'org-agenda-date-weekend
353 "Face used in agenda for weekend days.
354 See the variable `org-agenda-weekend-days' for a definition of which days
355 belong to the weekend.")
356 (when (fboundp 'set-face-attribute)
357 (set-face-attribute 'org-agenda-date-weekend nil :weight 'bold)))
359 (defface org-scheduled-today
360 (org-compatible-face nil
361 '((((class color) (min-colors 88) (background light)) (:foreground "DarkGreen"))
362 (((class color) (min-colors 88) (background dark)) (:foreground "PaleGreen"))
363 (((class color) (min-colors 8)) (:foreground "green"))
364 (t (:bold t :italic t))))
365 "Face for items scheduled for a certain day."
366 :group 'org-faces)
368 (defface org-scheduled-previously
369 (org-compatible-face nil
370 '((((class color) (min-colors 88) (background light)) (:foreground "Firebrick"))
371 (((class color) (min-colors 88) (background dark)) (:foreground "chocolate1"))
372 (((class color) (min-colors 8) (background light)) (:foreground "red"))
373 (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t))
374 (t (:bold t))))
375 "Face for items scheduled previously, and not yet done."
376 :group 'org-faces)
378 (defface org-upcoming-deadline
379 (org-compatible-face nil
380 '((((class color) (min-colors 88) (background light)) (:foreground "Firebrick"))
381 (((class color) (min-colors 88) (background dark)) (:foreground "chocolate1"))
382 (((class color) (min-colors 8) (background light)) (:foreground "red"))
383 (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t))
384 (t (:bold t))))
385 "Face for items scheduled previously, and not yet done."
386 :group 'org-faces)
388 (defcustom org-agenda-deadline-faces
389 '((1.0 . org-warning)
390 (0.5 . org-upcoming-deadline)
391 (0.0 . default))
392 "Faces for showing deadlines in the agenda.
393 This is a list of cons cells. The cdr of each cell is a face to be used,
394 and it can also just be like '(:foreground \"yellow\").
395 Each car is a fraction of the head-warning time that must have passed for
396 this the face in the cdr to be used for display. The numbers must be
397 given in descending order. The head-warning time is normally taken
398 from `org-deadline-warning-days', but can also be specified in the deadline
399 timestamp itself, like this:
401 DEADLINE: <2007-08-13 Mon -8d>
403 You may use d for days, w for weeks, m for months and y for years. Months
404 and years will only be treated in an approximate fashion (30.4 days for a
405 month and 365.24 days for a year)."
406 :group 'org-faces
407 :group 'org-agenda-daily/weekly
408 :type '(repeat
409 (cons
410 (number :tag "Fraction of head-warning time passed")
411 (sexp :tag "Face"))))
413 (defface org-agenda-restriction-lock
414 (org-compatible-face nil
415 '((((class color) (min-colors 88) (background light)) (:background "yellow1"))
416 (((class color) (min-colors 88) (background dark)) (:background "skyblue4"))
417 (((class color) (min-colors 16) (background light)) (:background "yellow1"))
418 (((class color) (min-colors 16) (background dark)) (:background "skyblue4"))
419 (((class color) (min-colors 8)) (:background "cyan" :foreground "black"))
420 (t (:inverse-video t))))
421 "Face for showing the agenda restriction lock."
422 :group 'org-faces)
424 (defface org-time-grid ;; originally copied from font-lock-variable-name-face
425 (org-compatible-face nil
426 '((((class color) (min-colors 16) (background light)) (:foreground "DarkGoldenrod"))
427 (((class color) (min-colors 16) (background dark)) (:foreground "LightGoldenrod"))
428 (((class color) (min-colors 8)) (:foreground "yellow" :weight light))))
429 "Face used for time grids."
430 :group 'org-faces)
432 (defconst org-level-faces
433 '(org-level-1 org-level-2 org-level-3 org-level-4
434 org-level-5 org-level-6 org-level-7 org-level-8
437 (defcustom org-n-level-faces (length org-level-faces)
438 "The number of different faces to be used for headlines.
439 Org-mode defines 8 different headline faces, so this can be at most 8.
440 If it is less than 8, the level-1 face gets re-used for level N+1 etc."
441 :type 'number
442 :group 'org-faces)
444 (defface org-latex-and-export-specials
445 (let ((font (cond ((assq :inherit custom-face-attributes)
446 '(:inherit underline))
447 (t '(:underline t)))))
448 `((((class grayscale) (background light))
449 (:foreground "DimGray" ,@font))
450 (((class grayscale) (background dark))
451 (:foreground "LightGray" ,@font))
452 (((class color) (background light))
453 (:foreground "SaddleBrown"))
454 (((class color) (background dark))
455 (:foreground "burlywood"))
456 (t (,@font))))
457 "Face used to highlight math latex and other special exporter stuff."
458 :group 'org-faces)
460 (provide 'org-faces)
462 ;; arch-tag: 9dab5f91-c4b9-4d6f-bac3-1f6211ad0a04
464 ;;; org-faces.el ends here