org-faces.el 21 KB

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