diff options
author | Rémi Vanicat <vanicat@debian.org> | 2013-02-08 18:05:29 +0100 |
---|---|---|
committer | Rémi Vanicat <vanicat@debian.org> | 2013-02-08 21:14:15 +0100 |
commit | 3b44a9fd2aec421eee2136088edd07efeb330f92 (patch) | |
tree | 72fff26102cee9f797eb99dc2c0f2dac9334a376 | |
parent | bdf404112e81b74a0cec668222c373150a0bc5ce (diff) | |
download | fork-ledger-3b44a9fd2aec421eee2136088edd07efeb330f92.tar.gz fork-ledger-3b44a9fd2aec421eee2136088edd07efeb330f92.tar.bz2 fork-ledger-3b44a9fd2aec421eee2136088edd07efeb330f92.zip |
In ledger-reconcile, use a function to get where the transaction is.
-rw-r--r-- | lisp/ldg-reconcile.el | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lisp/ldg-reconcile.el b/lisp/ldg-reconcile.el index 2d591de5..04c84e63 100644 --- a/lisp/ldg-reconcile.el +++ b/lisp/ldg-reconcile.el @@ -53,14 +53,18 @@ (equal file "<stdin>") (equal file "/dev/stdin"))) +(defun ledger-reconcile-get-buffer (where) + (when (is-stdin (car where)) + ledger-buf)) + (defun ledger-reconcile-toggle () (interactive) (let ((where (get-text-property (point) 'where)) (account ledger-acct) (inhibit-read-only t) cleared) - (when (is-stdin (car where)) - (with-current-buffer ledger-buf + (when (ledger-reconcile-get-buffer where) + (with-current-buffer (ledger-reconcile-get-buffer where) (goto-char (cdr where)) (setq cleared (ledger-toggle-current-entry))) ;remove the existing face and add the new face @@ -112,8 +116,8 @@ (defun ledger-reconcile-delete () (interactive) (let ((where (get-text-property (point) 'where))) - (when (is-stdin (car where)) - (with-current-buffer ledger-buf + (when (ledger-reconcile-get-buffer where) + (with-current-buffer (ledger-reconcile-get-buffer where) (goto-char (cdr where)) (ledger-delete-current-entry)) (let ((inhibit-read-only t)) @@ -124,8 +128,8 @@ (defun ledger-reconcile-visit () (interactive) (let ((where (get-text-property (point) 'where))) - (when (is-stdin (car where)) - (switch-to-buffer-other-window ledger-buf) + (when (ledger-reconcile-get-buffer where) + (switch-to-buffer-other-window (ledger-reconcile-get-buffer where)) (goto-char (cdr where)) (recenter)))) @@ -154,8 +158,8 @@ (let ((where (get-text-property (point) 'where)) (face (get-text-property (point) 'face))) (if (and (eq face 'bold) - (when (is-stdin (car where)))) - (with-current-buffer ledger-buf + (ledger-reconcile-get-buffer where)) + (with-current-buffer (ledger-reconcile-get-buffer where) (goto-char (cdr where)) (ledger-toggle-current 'cleared)))) (forward-line 1))) @@ -298,4 +302,4 @@ (use-local-map map))) -(provide 'ldg-reconcile)
\ No newline at end of file +(provide 'ldg-reconcile) |