org-faces.el 20 KB

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