In ledger-reconcile, use a function to get where the transaction is.
This commit is contained in:
parent
bdf404112e
commit
3b44a9fd2a
1 changed files with 13 additions and 9 deletions
|
|
@ -53,14 +53,18 @@
|
||||||
(equal file "<stdin>")
|
(equal file "<stdin>")
|
||||||
(equal file "/dev/stdin")))
|
(equal file "/dev/stdin")))
|
||||||
|
|
||||||
|
(defun ledger-reconcile-get-buffer (where)
|
||||||
|
(when (is-stdin (car where))
|
||||||
|
ledger-buf))
|
||||||
|
|
||||||
(defun ledger-reconcile-toggle ()
|
(defun ledger-reconcile-toggle ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((where (get-text-property (point) 'where))
|
(let ((where (get-text-property (point) 'where))
|
||||||
(account ledger-acct)
|
(account ledger-acct)
|
||||||
(inhibit-read-only t)
|
(inhibit-read-only t)
|
||||||
cleared)
|
cleared)
|
||||||
(when (is-stdin (car where))
|
(when (ledger-reconcile-get-buffer where)
|
||||||
(with-current-buffer ledger-buf
|
(with-current-buffer (ledger-reconcile-get-buffer where)
|
||||||
(goto-char (cdr where))
|
(goto-char (cdr where))
|
||||||
(setq cleared (ledger-toggle-current-entry)))
|
(setq cleared (ledger-toggle-current-entry)))
|
||||||
;remove the existing face and add the new face
|
;remove the existing face and add the new face
|
||||||
|
|
@ -112,8 +116,8 @@
|
||||||
(defun ledger-reconcile-delete ()
|
(defun ledger-reconcile-delete ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((where (get-text-property (point) 'where)))
|
(let ((where (get-text-property (point) 'where)))
|
||||||
(when (is-stdin (car where))
|
(when (ledger-reconcile-get-buffer where)
|
||||||
(with-current-buffer ledger-buf
|
(with-current-buffer (ledger-reconcile-get-buffer where)
|
||||||
(goto-char (cdr where))
|
(goto-char (cdr where))
|
||||||
(ledger-delete-current-entry))
|
(ledger-delete-current-entry))
|
||||||
(let ((inhibit-read-only t))
|
(let ((inhibit-read-only t))
|
||||||
|
|
@ -124,8 +128,8 @@
|
||||||
(defun ledger-reconcile-visit ()
|
(defun ledger-reconcile-visit ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((where (get-text-property (point) 'where)))
|
(let ((where (get-text-property (point) 'where)))
|
||||||
(when (is-stdin (car where))
|
(when (ledger-reconcile-get-buffer where)
|
||||||
(switch-to-buffer-other-window ledger-buf)
|
(switch-to-buffer-other-window (ledger-reconcile-get-buffer where))
|
||||||
(goto-char (cdr where))
|
(goto-char (cdr where))
|
||||||
(recenter))))
|
(recenter))))
|
||||||
|
|
||||||
|
|
@ -154,8 +158,8 @@
|
||||||
(let ((where (get-text-property (point) 'where))
|
(let ((where (get-text-property (point) 'where))
|
||||||
(face (get-text-property (point) 'face)))
|
(face (get-text-property (point) 'face)))
|
||||||
(if (and (eq face 'bold)
|
(if (and (eq face 'bold)
|
||||||
(when (is-stdin (car where))))
|
(ledger-reconcile-get-buffer where))
|
||||||
(with-current-buffer ledger-buf
|
(with-current-buffer (ledger-reconcile-get-buffer where)
|
||||||
(goto-char (cdr where))
|
(goto-char (cdr where))
|
||||||
(ledger-toggle-current 'cleared))))
|
(ledger-toggle-current 'cleared))))
|
||||||
(forward-line 1)))
|
(forward-line 1)))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue