summaryrefslogtreecommitdiff
path: root/ledger.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-07-17 23:42:19 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-07-17 23:42:19 -0400
commit899f79d0324a09bb1b6d9445634f192458ca3613 (patch)
treeb5eefc3e2dfa936741bc5ccce7051705cdc5f413 /ledger.el
parent0f7776f7af16a0ea78156b3210658c3ca41f576f (diff)
downloadfork-ledger-899f79d0324a09bb1b6d9445634f192458ca3613.tar.gz
fork-ledger-899f79d0324a09bb1b6d9445634f192458ca3613.tar.bz2
fork-ledger-899f79d0324a09bb1b6d9445634f192458ca3613.zip
Reconciling using ledger.el is now line-based, instead of character based, due
to problems with UTF-8 characters.
Diffstat (limited to 'ledger.el')
-rw-r--r--ledger.el14
1 files changed, 10 insertions, 4 deletions
diff --git a/ledger.el b/ledger.el
index 6f6abbf9..0d58a3e8 100644
--- a/ledger.el
+++ b/ledger.el
@@ -416,7 +416,7 @@ dropped."
;; attempt to auto-reconcile in the background
(with-temp-buffer
(let ((exit-code
- (ledger-run-ledger buffer "--format" "%xB\\n"
+ (ledger-run-ledger buffer "--format" "%xb\\n"
"--reconcile" balance "--reconcile-date" date
"register" account)))
(if (/= 0 exit-code)
@@ -427,7 +427,9 @@ dropped."
(error (buffer-string)))
(while (not (eobp))
(setq cleared
- (cons (1+ (read (current-buffer))) cleared))
+ (cons (save-excursion
+ (goto-line (1+ (read (current-buffer))))
+ (point-marker)) cleared))
(forward-line)))))
(goto-char (point-min))
(with-current-buffer ledger-buf
@@ -531,8 +533,12 @@ dropped."
(cons
(nth 0 item)
(if ledger-clear-whole-entries
- (copy-marker (nth 1 item))
- (copy-marker (nth 0 xact)))))))
+ (save-excursion
+ (goto-line (nth 1 item))
+ (point-marker))
+ (save-excursion
+ (goto-line (nth 0 xact))
+ (point-marker)))))))
(insert (format "%s %-30s %-25s %15s\n"
(format-time-string "%m/%d" (nth 2 item))
(nth 4 item) (nth 1 xact) (nth 2 xact)))