summaryrefslogtreecommitdiff
path: root/ledger.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2005-05-31 22:38:34 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:11 -0400
commite9ea090035c46092d55f326c33bd071cd4a27381 (patch)
treefb6d3069bf8933f6af7c37b4a312eaa5e0456790 /ledger.el
parentb800e4e2f8650a32291e9bd41bc5388ca11e136e (diff)
downloadfork-ledger-e9ea090035c46092d55f326c33bd071cd4a27381.tar.gz
fork-ledger-e9ea090035c46092d55f326c33bd071cd4a27381.tar.bz2
fork-ledger-e9ea090035c46092d55f326c33bd071cd4a27381.zip
(ledger-do-reconcile): Only allow toggling of reconcilation entries
that are found in the "main" ledger file (for now).
Diffstat (limited to 'ledger.el')
-rw-r--r--ledger.el44
1 files changed, 24 insertions, 20 deletions
diff --git a/ledger.el b/ledger.el
index 918f109f..ea4fe283 100644
--- a/ledger.el
+++ b/ledger.el
@@ -232,16 +232,17 @@ Return the difference in the format of a time value."
(account ledger-acct)
(inhibit-read-only t)
cleared)
- (with-current-buffer ledger-buf
- (goto-char (cdr where))
- (setq cleared (ledger-toggle-current 'pending)))
- (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)))
+ (when (equal (car where) "<stdin>")
+ (with-current-buffer ledger-buf
+ (goto-char (cdr where))
+ (setq cleared (ledger-toggle-current 'pending)))
+ (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))))
(forward-line)))
(defun ledger-auto-reconcile (balance date)
@@ -308,19 +309,21 @@ Return the difference in the format of a time value."
(defun ledger-reconcile-delete ()
(interactive)
(let ((where (get-text-property (point) 'where)))
- (with-current-buffer ledger-buf
- (goto-char (cdr where))
- (ledger-delete-current-entry))
- (let ((inhibit-read-only t))
- (goto-char (line-beginning-position))
- (delete-region (point) (1+ (line-end-position)))
- (set-buffer-modified-p t))))
+ (when (equal (car where) "<stdin>")
+ (with-current-buffer ledger-buf
+ (goto-char (cdr where))
+ (ledger-delete-current-entry))
+ (let ((inhibit-read-only t))
+ (goto-char (line-beginning-position))
+ (delete-region (point) (1+ (line-end-position)))
+ (set-buffer-modified-p t)))))
(defun ledger-reconcile-visit ()
(interactive)
(let ((where (get-text-property (point) 'where)))
- (switch-to-buffer-other-window ledger-buf)
- (goto-char (cdr where))))
+ (when (equal (car where) "<stdin>")
+ (switch-to-buffer-other-window ledger-buf)
+ (goto-char (cdr where)))))
(defun ledger-reconcile-save ()
(interactive)
@@ -340,7 +343,8 @@ Return the difference in the format of a time value."
(while (not (eobp))
(let ((where (get-text-property (point) 'where))
(face (get-text-property (point) 'face)))
- (if (eq face 'bold)
+ (if (and (eq face 'bold)
+ (equal (car where) "<stdin>"))
(with-current-buffer ledger-buf
(goto-char (cdr where))
(ledger-toggle-current 'cleared))))