(ledger-do-reconcile): Only allow toggling of reconcilation entries
that are found in the "main" ledger file (for now).
This commit is contained in:
parent
b800e4e2f8
commit
e9ea090035
1 changed files with 24 additions and 20 deletions
44
ledger.el
44
ledger.el
|
|
@ -232,16 +232,17 @@ Return the difference in the format of a time value."
|
||||||
(account ledger-acct)
|
(account ledger-acct)
|
||||||
(inhibit-read-only t)
|
(inhibit-read-only t)
|
||||||
cleared)
|
cleared)
|
||||||
(with-current-buffer ledger-buf
|
(when (equal (car where) "<stdin>")
|
||||||
(goto-char (cdr where))
|
(with-current-buffer ledger-buf
|
||||||
(setq cleared (ledger-toggle-current 'pending)))
|
(goto-char (cdr where))
|
||||||
(if cleared
|
(setq cleared (ledger-toggle-current 'pending)))
|
||||||
(add-text-properties (line-beginning-position)
|
(if cleared
|
||||||
(line-end-position)
|
(add-text-properties (line-beginning-position)
|
||||||
(list 'face 'bold))
|
(line-end-position)
|
||||||
(remove-text-properties (line-beginning-position)
|
(list 'face 'bold))
|
||||||
(line-end-position)
|
(remove-text-properties (line-beginning-position)
|
||||||
(list 'face)))
|
(line-end-position)
|
||||||
|
(list 'face))))
|
||||||
(forward-line)))
|
(forward-line)))
|
||||||
|
|
||||||
(defun ledger-auto-reconcile (balance date)
|
(defun ledger-auto-reconcile (balance date)
|
||||||
|
|
@ -308,19 +309,21 @@ Return the difference in the format of a time value."
|
||||||
(defun ledger-reconcile-delete ()
|
(defun ledger-reconcile-delete ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((where (get-text-property (point) 'where)))
|
(let ((where (get-text-property (point) 'where)))
|
||||||
(with-current-buffer ledger-buf
|
(when (equal (car where) "<stdin>")
|
||||||
(goto-char (cdr where))
|
(with-current-buffer ledger-buf
|
||||||
(ledger-delete-current-entry))
|
(goto-char (cdr where))
|
||||||
(let ((inhibit-read-only t))
|
(ledger-delete-current-entry))
|
||||||
(goto-char (line-beginning-position))
|
(let ((inhibit-read-only t))
|
||||||
(delete-region (point) (1+ (line-end-position)))
|
(goto-char (line-beginning-position))
|
||||||
(set-buffer-modified-p t))))
|
(delete-region (point) (1+ (line-end-position)))
|
||||||
|
(set-buffer-modified-p t)))))
|
||||||
|
|
||||||
(defun ledger-reconcile-visit ()
|
(defun ledger-reconcile-visit ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((where (get-text-property (point) 'where)))
|
(let ((where (get-text-property (point) 'where)))
|
||||||
(switch-to-buffer-other-window ledger-buf)
|
(when (equal (car where) "<stdin>")
|
||||||
(goto-char (cdr where))))
|
(switch-to-buffer-other-window ledger-buf)
|
||||||
|
(goto-char (cdr where)))))
|
||||||
|
|
||||||
(defun ledger-reconcile-save ()
|
(defun ledger-reconcile-save ()
|
||||||
(interactive)
|
(interactive)
|
||||||
|
|
@ -340,7 +343,8 @@ Return the difference in the format of a time value."
|
||||||
(while (not (eobp))
|
(while (not (eobp))
|
||||||
(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 (eq face 'bold)
|
(if (and (eq face 'bold)
|
||||||
|
(equal (car where) "<stdin>"))
|
||||||
(with-current-buffer ledger-buf
|
(with-current-buffer ledger-buf
|
||||||
(goto-char (cdr where))
|
(goto-char (cdr where))
|
||||||
(ledger-toggle-current 'cleared))))
|
(ledger-toggle-current 'cleared))))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue