org-faces.el 32 KB

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