summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-02-01 11:39:48 -0700
committerCraig Earls <enderw88@gmail.com>2013-02-01 11:39:48 -0700
commitedd82b2639e8a4d1f865dfae898caf678a9e7cbd (patch)
tree7e94613175616bcbea264f55b84b0a6af10ea9f7 /lisp
parent0675208a63837b0ce6802b5124bb90514f07b5e0 (diff)
downloadfork-ledger-edd82b2639e8a4d1f865dfae898caf678a9e7cbd.tar.gz
fork-ledger-edd82b2639e8a4d1f865dfae898caf678a9e7cbd.tar.bz2
fork-ledger-edd82b2639e8a4d1f865dfae898caf678a9e7cbd.zip
Add custom faces to the reconciler
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ldg-fonts.el15
-rw-r--r--lisp/ldg-reconcile.el17
2 files changed, 26 insertions, 6 deletions
diff --git a/lisp/ldg-fonts.el b/lisp/ldg-fonts.el
index 9f98a9fd..2b7717c6 100644
--- a/lisp/ldg-fonts.el
+++ b/lisp/ldg-fonts.el
@@ -56,6 +56,21 @@
"Face for Ledger comments"
:group 'ledger-faces)
+(defface ledger-font-reconciler-uncleared-face
+ `((t :foreground "green" :weight normal ))
+ "Default face for uncleared transactions in the reconcile window"
+ :group 'ledger-faces)
+
+(defface ledger-font-reconciler-cleared-face
+ `((t :foreground "grey70" :weight normal ))
+ "Default face for cleared (*) transactions in the reconcile window"
+ :group 'ledger-faces)
+
+(defface ledger-font-reconciler-pending-face
+ `((t :foreground "yellow" :weight normal ))
+ "Default face for pending (!) transactions in the reconcile window"
+ :group 'ledger-faces)
+
(defvar ledger-font-lock-keywords
'(("^[0-9]+[-/.=][-/.=0-9]+\\s-\\!\\s-+\\(([^)]+)\\s-+\\)?\\([^*].+?\\)\\(\\( ;\\| ;\\|$\\)\\)" 2 'ledger-font-pending-face)
diff --git a/lisp/ldg-reconcile.el b/lisp/ldg-reconcile.el
index aaccfb07..02d0662a 100644
--- a/lisp/ldg-reconcile.el
+++ b/lisp/ldg-reconcile.el
@@ -55,13 +55,17 @@
(with-current-buffer ledger-buf
(goto-char (cdr where))
(setq cleared (ledger-toggle-current-entry)))
+ ;remove the existing face and add the new face
+ (remove-text-properties (line-beginning-position)
+ (line-end-position)
+ (list 'face))
(if cleared
(add-text-properties (line-beginning-position)
(line-end-position)
- (list 'face 'bold))
- (remove-text-properties (line-beginning-position)
- (line-end-position)
- (list 'face))))
+ (list 'face 'ledger-font-reconciler-cleared-face ))
+ (add-text-properties (line-beginning-position)
+ (line-end-position)
+ (list 'face 'ledger-font-reconciler-uncleared-face ))))
(forward-line)
(ledger-display-balance)))
@@ -172,10 +176,11 @@
(nth 4 item) (nth 1 xact) (nth 2 xact)))
(if (nth 3 xact)
(set-text-properties beg (1- (point))
- (list 'face 'bold
+ (list 'face 'ledger-font-reconciler-cleared-face
'where where))
(set-text-properties beg (1- (point))
- (list 'where where))))
+ (list 'face 'ledger-font-reconciler-uncleared-face
+ 'where where))))
(setq index (1+ index)))))
(goto-char (point-min))
(set-buffer-modified-p nil)