org-faces.el 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  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 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 forground 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 :strike-through nil :underline nil))
  131. (((class color) (min-colors 16) (background dark))
  132. (:background "grey30" :weight normal :strike-through nil :underline nil))
  133. (((class color) (min-colors 8))
  134. (:background "cyan" :foreground "black"
  135. :weight normal :strike-through nil :underline nil))
  136. (t (:inverse-video t))))
  137. "Face for column display of entry properties."
  138. :group 'org-faces)
  139. (defface org-column-title
  140. (org-compatible-face nil
  141. '((((class color) (min-colors 16) (background light))
  142. (:background "grey90" :underline t :weight bold))
  143. (((class color) (min-colors 16) (background dark))
  144. (:background "grey30" :underline t :weight bold))
  145. (((class color) (min-colors 8))
  146. (:background "cyan" :foreground "black" :underline t :weight bold))
  147. (t (:inverse-video t))))
  148. "Face for column display of entry properties."
  149. :group 'org-faces)
  150. (when (fboundp 'set-face-attribute)
  151. ;; Make sure that a fixed-width face is used when we have a column table.
  152. (set-face-attribute 'org-column nil
  153. :height (face-attribute 'default :height)
  154. :family (face-attribute 'default :family)))
  155. (defface org-warning
  156. (org-compatible-face 'font-lock-warning-face
  157. '((((class color) (min-colors 16) (background light)) (:foreground "Red1" :bold t))
  158. (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :bold t))
  159. (((class color) (min-colors 8) (background light)) (:foreground "red" :bold t))
  160. (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t))
  161. (t (:bold t))))
  162. "Face for deadlines and TODO keywords."
  163. :group 'org-faces)
  164. (defface org-archived ; similar to shadow
  165. (org-compatible-face 'shadow
  166. '((((class color grayscale) (min-colors 88) (background light))
  167. (:foreground "grey50"))
  168. (((class color grayscale) (min-colors 88) (background dark))
  169. (:foreground "grey70"))
  170. (((class color) (min-colors 8) (background light))
  171. (:foreground "green"))
  172. (((class color) (min-colors 8) (background dark))
  173. (:foreground "yellow"))))
  174. "Face for headline with the ARCHIVE tag."
  175. :group 'org-faces)
  176. (defface org-link
  177. '((((class color) (background light)) (:foreground "Purple" :underline t))
  178. (((class color) (background dark)) (:foreground "Cyan" :underline t))
  179. (t (:underline t)))
  180. "Face for links."
  181. :group 'org-faces)
  182. (defface org-ellipsis
  183. '((((class color) (background light)) (:foreground "DarkGoldenrod" :underline t))
  184. (((class color) (background dark)) (:foreground "LightGoldenrod" :underline t))
  185. (t (:strike-through t)))
  186. "Face for the ellipsis in folded text."
  187. :group 'org-faces)
  188. (defface org-target
  189. '((((class color) (background light)) (:underline t))
  190. (((class color) (background dark)) (:underline t))
  191. (t (:underline t)))
  192. "Face for links."
  193. :group 'org-faces)
  194. (defface org-date
  195. '((((class color) (background light)) (:foreground "Purple" :underline t))
  196. (((class color) (background dark)) (:foreground "Cyan" :underline t))
  197. (t (:underline t)))
  198. "Face for links."
  199. :group 'org-faces)
  200. (defface org-sexp-date
  201. '((((class color) (background light)) (:foreground "Purple"))
  202. (((class color) (background dark)) (:foreground "Cyan"))
  203. (t (:underline t)))
  204. "Face for links."
  205. :group 'org-faces)
  206. (defface org-tag
  207. '((t (:bold t)))
  208. "Face for tags."
  209. :group 'org-faces)
  210. (defface org-todo ; font-lock-warning-face
  211. (org-compatible-face nil
  212. '((((class color) (min-colors 16) (background light)) (:foreground "Red1" :bold t))
  213. (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :bold t))
  214. (((class color) (min-colors 8) (background light)) (:foreground "red" :bold t))
  215. (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t))
  216. (t (:inverse-video t :bold t))))
  217. "Face for TODO keywords."
  218. :group 'org-faces)
  219. (defface org-done ;; originally copied from font-lock-type-face
  220. (org-compatible-face nil
  221. '((((class color) (min-colors 16) (background light)) (:foreground "ForestGreen" :bold t))
  222. (((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen" :bold t))
  223. (((class color) (min-colors 8)) (:foreground "green"))
  224. (t (:bold t))))
  225. "Face used for todo keywords that indicate DONE items."
  226. :group 'org-faces)
  227. (defface org-headline-done ;; originally copied from font-lock-string-face
  228. (org-compatible-face nil
  229. '((((class color) (min-colors 16) (background light)) (:foreground "RosyBrown"))
  230. (((class color) (min-colors 16) (background dark)) (:foreground "LightSalmon"))
  231. (((class color) (min-colors 8) (background light)) (:bold nil))))
  232. "Face used to indicate that a headline is DONE.
  233. This face is only used if `org-fontify-done-headline' is set. If applies
  234. to the part of the headline after the DONE keyword."
  235. :group 'org-faces)
  236. (defcustom org-todo-keyword-faces nil
  237. "Faces for specific TODO keywords.
  238. This is a list of cons cells, with TODO keywords in the car
  239. and faces in the cdr. The face can be a symbol, or a property
  240. list of attributes, like (:foreground \"blue\" :weight bold :underline t)."
  241. :group 'org-faces
  242. :group 'org-todo
  243. :type '(repeat
  244. (cons
  245. (string :tag "keyword")
  246. (sexp :tag "face"))))
  247. (defface org-table ;; originally copied from font-lock-function-name-face
  248. (org-compatible-face nil
  249. '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
  250. (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
  251. (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
  252. (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
  253. (((class color) (min-colors 8) (background light)) (:foreground "blue"))
  254. (((class color) (min-colors 8) (background dark)))))
  255. "Face used for tables."
  256. :group 'org-faces)
  257. (defface org-formula
  258. (org-compatible-face nil
  259. '((((class color) (min-colors 88) (background light)) (:foreground "Firebrick"))
  260. (((class color) (min-colors 88) (background dark)) (:foreground "chocolate1"))
  261. (((class color) (min-colors 8) (background light)) (:foreground "red"))
  262. (((class color) (min-colors 8) (background dark)) (:foreground "red"))
  263. (t (:bold t :italic t))))
  264. "Face for formulas."
  265. :group 'org-faces)
  266. (defface org-code
  267. (org-compatible-face nil
  268. '((((class color grayscale) (min-colors 88) (background light))
  269. (:foreground "grey50"))
  270. (((class color grayscale) (min-colors 88) (background dark))
  271. (:foreground "grey70"))
  272. (((class color) (min-colors 8) (background light))
  273. (:foreground "green"))
  274. (((class color) (min-colors 8) (background dark))
  275. (:foreground "yellow"))))
  276. "Face for fixed-with text like code snippets."
  277. :group 'org-faces
  278. :version "22.1")
  279. (defface org-verbatim
  280. (org-compatible-face nil
  281. '((((class color grayscale) (min-colors 88) (background light))
  282. (:foreground "grey50" :underline t))
  283. (((class color grayscale) (min-colors 88) (background dark))
  284. (:foreground "grey70" :underline t))
  285. (((class color) (min-colors 8) (background light))
  286. (:foreground "green" :underline t))
  287. (((class color) (min-colors 8) (background dark))
  288. (:foreground "yellow" :underline t))))
  289. "Face for fixed-with text like code snippets."
  290. :group 'org-faces
  291. :version "22.1")
  292. (defface org-agenda-structure ;; originally copied from font-lock-function-name-face
  293. (org-compatible-face nil
  294. '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
  295. (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
  296. (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
  297. (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
  298. (((class color) (min-colors 8)) (:foreground "blue" :bold t))
  299. (t (:bold t))))
  300. "Face used in agenda for captions and dates."
  301. :group 'org-faces)
  302. (unless (facep 'org-agenda-date)
  303. (copy-face 'org-agenda-structure 'org-agenda-date)
  304. (set-face-doc-string 'org-agenda-date
  305. "Face used in agenda for normal days."))
  306. (unless (facep 'org-agenda-date-weekend)
  307. (copy-face 'org-agenda-date 'org-agenda-date-weekend)
  308. (set-face-doc-string 'org-agenda-date-weekend
  309. "Face used in agenda for weekend days.
  310. See the variable `org-agenda-weekend-days' for a definition of which days
  311. belong to the weekend.")
  312. (when (fboundp 'set-face-attribute)
  313. (set-face-attribute 'org-agenda-date-weekend nil :weight 'bold)))
  314. (defface org-scheduled-today
  315. (org-compatible-face nil
  316. '((((class color) (min-colors 88) (background light)) (:foreground "DarkGreen"))
  317. (((class color) (min-colors 88) (background dark)) (:foreground "PaleGreen"))
  318. (((class color) (min-colors 8)) (:foreground "green"))
  319. (t (:bold t :italic t))))
  320. "Face for items scheduled for a certain day."
  321. :group 'org-faces)
  322. (defface org-scheduled-previously
  323. (org-compatible-face nil
  324. '((((class color) (min-colors 88) (background light)) (:foreground "Firebrick"))
  325. (((class color) (min-colors 88) (background dark)) (:foreground "chocolate1"))
  326. (((class color) (min-colors 8) (background light)) (:foreground "red"))
  327. (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t))
  328. (t (:bold t))))
  329. "Face for items scheduled previously, and not yet done."
  330. :group 'org-faces)
  331. (defface org-upcoming-deadline
  332. (org-compatible-face nil
  333. '((((class color) (min-colors 88) (background light)) (:foreground "Firebrick"))
  334. (((class color) (min-colors 88) (background dark)) (:foreground "chocolate1"))
  335. (((class color) (min-colors 8) (background light)) (:foreground "red"))
  336. (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t))
  337. (t (:bold t))))
  338. "Face for items scheduled previously, and not yet done."
  339. :group 'org-faces)
  340. (defcustom org-agenda-deadline-faces
  341. '((1.0 . org-warning)
  342. (0.5 . org-upcoming-deadline)
  343. (0.0 . default))
  344. "Faces for showing deadlines in the agenda.
  345. This is a list of cons cells. The cdr of each cell is a face to be used,
  346. and it can also just be like '(:foreground \"yellow\").
  347. Each car is a fraction of the head-warning time that must have passed for
  348. this the face in the cdr to be used for display. The numbers must be
  349. given in descending order. The head-warning time is normally taken
  350. from `org-deadline-warning-days', but can also be specified in the deadline
  351. timestamp itself, like this:
  352. DEADLINE: <2007-08-13 Mon -8d>
  353. You may use d for days, w for weeks, m for months and y for years. Months
  354. and years will only be treated in an approximate fashion (30.4 days for a
  355. month and 365.24 days for a year)."
  356. :group 'org-faces
  357. :group 'org-agenda-daily/weekly
  358. :type '(repeat
  359. (cons
  360. (number :tag "Fraction of head-warning time passed")
  361. (sexp :tag "Face"))))
  362. (defface org-agenda-restriction-lock
  363. (org-compatible-face nil
  364. '((((class color) (min-colors 88) (background light)) (:background "yellow1"))
  365. (((class color) (min-colors 88) (background dark)) (:background "skyblue4"))
  366. (((class color) (min-colors 16) (background light)) (:background "yellow1"))
  367. (((class color) (min-colors 16) (background dark)) (:background "skyblue4"))
  368. (((class color) (min-colors 8)) (:background "cyan" :foreground "black"))
  369. (t (:inverse-video t))))
  370. "Face for showing the agenda restriction lock."
  371. :group 'org-faces)
  372. (defface org-time-grid ;; originally copied from font-lock-variable-name-face
  373. (org-compatible-face nil
  374. '((((class color) (min-colors 16) (background light)) (:foreground "DarkGoldenrod"))
  375. (((class color) (min-colors 16) (background dark)) (:foreground "LightGoldenrod"))
  376. (((class color) (min-colors 8)) (:foreground "yellow" :weight light))))
  377. "Face used for time grids."
  378. :group 'org-faces)
  379. (defconst org-level-faces
  380. '(org-level-1 org-level-2 org-level-3 org-level-4
  381. org-level-5 org-level-6 org-level-7 org-level-8
  382. ))
  383. (defcustom org-n-level-faces (length org-level-faces)
  384. "The number of different faces to be used for headlines.
  385. Org-mode defines 8 different headline faces, so this can be at most 8.
  386. If it is less than 8, the level-1 face gets re-used for level N+1 etc."
  387. :type 'number
  388. :group 'org-faces)
  389. (defface org-latex-and-export-specials
  390. (let ((font (cond ((assq :inherit custom-face-attributes)
  391. '(:inherit underline))
  392. (t '(:underline t)))))
  393. `((((class grayscale) (background light))
  394. (:foreground "DimGray" ,@font))
  395. (((class grayscale) (background dark))
  396. (:foreground "LightGray" ,@font))
  397. (((class color) (background light))
  398. (:foreground "SaddleBrown"))
  399. (((class color) (background dark))
  400. (:foreground "burlywood"))
  401. (t (,@font))))
  402. "Face used to highlight math latex and other special exporter stuff."
  403. :group 'org-faces)
  404. (provide 'org-faces)
  405. ;; arch-tag: 9dab5f91-c4b9-4d6f-bac3-1f6211ad0a04
  406. ;;; org-faces.el ends here