ledger-fonts.el 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. ;;; ledger-fonts.el --- Helper code for use with the "ledger" command-line tool
  2. ;; Copyright (C) 2003-2016 John Wiegley (johnw AT gnu DOT org)
  3. ;; This file is not part of GNU Emacs.
  4. ;; This is free software; you can redistribute it and/or modify it under
  5. ;; the terms of the GNU General Public License as published by the Free
  6. ;; Software Foundation; either version 2, or (at your option) any later
  7. ;; version.
  8. ;;
  9. ;; This is distributed in the hope that it will be useful, but WITHOUT
  10. ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  12. ;; for more details.
  13. ;;
  14. ;; You should have received a copy of the GNU General Public License
  15. ;; along with GNU Emacs; see the file COPYING. If not, write to the
  16. ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  17. ;; MA 02110-1301 USA.
  18. ;;; Commentary:
  19. ;; All of the faces for ledger mode are defined here.
  20. ;;; Code:
  21. (require 'ledger-regex)
  22. (defgroup ledger-faces nil "Ledger mode highlighting" :group 'ledger)
  23. (defface ledger-font-default-face
  24. `((t :inherit default))
  25. "Default face"
  26. :group 'ledger-faces)
  27. (defface ledger-font-auto-xact-face
  28. `((t :foreground "orange" :weight normal))
  29. "Default face for automatic transactions"
  30. :group 'ledger-faces)
  31. (defface ledger-font-periodic-xact-face
  32. `((t :foreground "green" :weight normal))
  33. "Default face for automatic transactions"
  34. :group 'ledger-faces)
  35. (defface ledger-font-xact-cleared-face
  36. `((t :foreground "#AAAAAA" :weight normal))
  37. "Default face for cleared transaction"
  38. :group 'ledger-faces)
  39. (defface ledger-font-xact-pending-face
  40. `((t :foreground "#444444" :weight normal))
  41. "Default face for pending transaction"
  42. :group 'ledger-faces)
  43. (defface ledger-font-xact-open-face
  44. `((t :foreground "#000000" :weight normal))
  45. "Default face for transaction under point"
  46. :group 'ledger-faces)
  47. (defface ledger-font-payee-uncleared-face
  48. `((t :foreground "#dc322f" :weight bold ))
  49. "Default face for Ledger"
  50. :group 'ledger-faces)
  51. (defface ledger-font-payee-cleared-face
  52. `((t :inherit ledger-font-other-face))
  53. "Default face for cleared (*) payees"
  54. :group 'ledger-faces)
  55. (defface ledger-font-payee-pending-face
  56. `((t :foreground "#F24B61" :weight normal))
  57. "Default face for pending (!) payees"
  58. :group 'ledger-faces)
  59. (defface ledger-font-xact-highlight-face
  60. `((t :inherit ledger-occur-xact-face))
  61. "Default face for transaction under point"
  62. :group 'ledger-faces)
  63. (defface ledger-font-pending-face
  64. `((t :foreground "#cb4b16" :weight normal ))
  65. "Default face for pending (!) transactions"
  66. :group 'ledger-faces)
  67. (defface ledger-font-other-face
  68. `((t :foreground "#657b83" :weight normal))
  69. "Default face for other transactions"
  70. :group 'ledger-faces)
  71. (defface ledger-font-directive-face
  72. `((t :inherit font-lock-preprocessor-face))
  73. "Default face for other transactions"
  74. :group 'ledger-faces)
  75. (defface ledger-font-account-directive-face
  76. `((t :inherit ledger-font-directive-face))
  77. "Default face for other transactions"
  78. :group 'ledger-faces)
  79. (defface ledger-font-price-directive-face
  80. `((t :inherit ledger-font-directive-face))
  81. "Default face for other transactions"
  82. :group 'ledger-faces)
  83. (defface ledger-font-apply-directive-face
  84. `((t :inherit ledger-font-directive-face))
  85. "Default face for other transactions"
  86. :group 'ledger-faces)
  87. (defface ledger-font-alias-directive-face
  88. `((t :inherit ledger-font-directive-face))
  89. "Default face for other transactions"
  90. :group 'ledger-faces)
  91. (defface ledger-font-assert-directive-face
  92. `((t :inherit ledger-font-directive-face))
  93. "Default face for other transactions"
  94. :group 'ledger-faces)
  95. (defface ledger-font-bucket-directive-face
  96. `((t :inherit ledger-font-directive-face))
  97. "Default face for other transactions"
  98. :group 'ledger-faces)
  99. (defface ledger-font-capture-directive-face
  100. `((t :inherit ledger-font-directive-face))
  101. "Default face for other transactions"
  102. :group 'ledger-faces)
  103. (defface ledger-font-check-directive-face
  104. `((t :inherit ledger-font-directive-face))
  105. "Default face for other transactions"
  106. :group 'ledger-faces)
  107. (defface ledger-font-commodity-directive-face
  108. `((t :inherit ledger-font-directive-face))
  109. "Default face for other transactions"
  110. :group 'ledger-faces)
  111. (defface ledger-font-define-directive-face
  112. `((t :inherit ledger-font-directive-face))
  113. "Default face for other transactions"
  114. :group 'ledger-faces)
  115. (defface ledger-font-end-directive-face
  116. `((t :inherit ledger-font-directive-face))
  117. "Default face for other transactions"
  118. :group 'ledger-faces)
  119. (defface ledger-font-expr-directive-face
  120. `((t :inherit ledger-font-directive-face))
  121. "Default face for other transactions"
  122. :group 'ledger-faces)
  123. (defface ledger-font-fixed-directive-face
  124. `((t :inherit ledger-font-directive-face))
  125. "Default face for other transactions"
  126. :group 'ledger-faces)
  127. (defface ledger-font-include-directive-face
  128. `((t :inherit ledger-font-directive-face))
  129. "Default face for other transactions"
  130. :group 'ledger-faces)
  131. (defface ledger-font-payee-directive-face
  132. `((t :inherit ledger-font-directive-face))
  133. "Default face for other transactions"
  134. :group 'ledger-faces)
  135. (defface ledger-font-tag-directive-face
  136. `((t :inherit ledger-font-directive-face))
  137. "Default face for other transactions"
  138. :group 'ledger-faces)
  139. (defface ledger-font-year-directive-face
  140. `((t :inherit ledger-font-directive-face))
  141. "Default face for other transactions"
  142. :group 'ledger-faces)
  143. (defface ledger-font-posting-account-face
  144. `((t :foreground "#268bd2" ))
  145. "Face for Ledger accounts"
  146. :group 'ledger-faces)
  147. (defface ledger-font-posting-account-cleared-face
  148. `((t :inherit ledger-font-other-face))
  149. "Face for Ledger accounts"
  150. :group 'ledger-faces)
  151. (defface ledger-font-posting-amount-cleared-face
  152. `((t :inherit ledger-font-posting-account-cleared-face))
  153. "Face for Ledger accounts"
  154. :group 'ledger-faces)
  155. (defface ledger-font-posting-account-pending-face
  156. `((t :inherit ledger-font-pending-face))
  157. "Face for Ledger accounts"
  158. :group 'ledger-faces)
  159. (defface ledger-font-posting-amount-pending-face
  160. `((t :inherit ledger-font-posting-account-pending-face))
  161. "Face for Ledger accounts"
  162. :group 'ledger-faces)
  163. (defface ledger-font-posting-amount-face
  164. `((t :foreground "#cb4b16" ))
  165. "Face for Ledger amounts"
  166. :group 'ledger-faces)
  167. (defface ledger-font-posting-date-face
  168. `((t :foreground "#cb4b16" ))
  169. "Face for Ledger dates"
  170. :group 'ledger-faces)
  171. (defface ledger-occur-narrowed-face
  172. `((t :inherit font-lock-comment-face :invisible t))
  173. "Default face for Ledger occur mode hidden transactions"
  174. :group 'ledger-faces)
  175. (defface ledger-occur-xact-face
  176. `((t :inherit highlight))
  177. "Default face for Ledger occur mode shown transactions"
  178. :group 'ledger-faces)
  179. (defface ledger-font-comment-face
  180. `((t :inherit font-lock-comment-face))
  181. "Face for Ledger comments"
  182. :group 'ledger-faces)
  183. (defface ledger-font-reconciler-uncleared-face
  184. `((t :inherit ledger-font-payee-uncleared-face))
  185. "Default face for uncleared transactions in the reconcile window"
  186. :group 'ledger-faces)
  187. (defface ledger-font-reconciler-cleared-face
  188. `((t :inherit ledger-font-other-face))
  189. "Default face for cleared (*) transactions in the reconcile window"
  190. :group 'ledger-faces)
  191. (defface ledger-font-reconciler-pending-face
  192. `((t :inherit ledger-font-pending-face))
  193. "Default face for pending (!) transactions in the reconcile window"
  194. :group 'ledger-faces)
  195. (defface ledger-font-report-clickable-face
  196. `((t :foreground "#cb4b16" :weight normal ))
  197. "Default face for pending (!) transactions in the reconcile window"
  198. :group 'ledger-faces)
  199. (defvar ledger-font-lock-keywords
  200. `(("account" . ledger-font-account-directive-face)
  201. ("apply" . ledger-font-apply-directive-face)
  202. ("alias" . ledger-font-alias-directive-face)
  203. ("assert" . ledger-font-assert-directive-face)
  204. ("bucket" . ledger-font-bucket-directive-face)
  205. ("capture" . ledger-font-capture-directive-face)
  206. ("check" . ledger-font-check-directive-face)
  207. ("commodity" . ledger-font-commodity-directive-face)
  208. ("define" . ledger-font-define-directive-face)
  209. ("end" . ledger-font-end-directive-face)
  210. ("expr" . ledger-font-expr-directive-face)
  211. ("fixed" . ledger-font-fixed-directive-face)
  212. ("include" . ledger-font-include-directive-face)
  213. ("payee" . ledger-font-payee-directive-face)
  214. ("tag" . ledger-font-tag-directive-face)
  215. ("year" . ledger-font-year-directive-face))
  216. "Expressions to highlight in Ledger mode.")
  217. (provide 'ledger-fonts)
  218. ;;; ledger-fonts.el ends here