ledger.el: fix broken ledger reconcile

This commit is contained in:
Levin Du 2008-07-31 16:08:16 +08:00
parent 19fcf4c99d
commit 37cf3c6f6e

View file

@ -510,14 +510,14 @@ dropped."
(unless (looking-at "[0-9]") (unless (looking-at "[0-9]")
(error (buffer-string))) (error (buffer-string)))
(while (not (eobp)) (while (not (eobp))
(setq cleared (push (read (current-buffer)) cleared)
(cons (save-excursion
(goto-line (1+ (read (current-buffer))))
(point-marker)) cleared))
(forward-line))))) (forward-line)))))
(goto-char (point-min)) (goto-char (point-min))
(with-current-buffer ledger-buf (with-current-buffer ledger-buf
(setq cleared (mapcar 'copy-marker (nreverse cleared)))) (setq cleared (mapcar (lambda (line)
(goto-line line)
(point-marker))
(nreverse cleared))))
(let ((inhibit-redisplay t)) (let ((inhibit-redisplay t))
(dolist (pos cleared) (dolist (pos cleared)
(while (and (not (eobp)) (while (and (not (eobp))
@ -616,13 +616,9 @@ dropped."
(with-current-buffer buf (with-current-buffer buf
(cons (cons
(nth 0 item) (nth 0 item)
(if ledger-clear-whole-entries (save-excursion
(save-excursion (goto-line (nth 0 xact))
(goto-line (nth 1 item)) (point-marker))))))
(point-marker))
(save-excursion
(goto-line (nth 0 xact))
(point-marker)))))))
(insert (format "%s %-30s %-25s %15s\n" (insert (format "%s %-30s %-25s %15s\n"
(format-time-string "%m/%d" (nth 2 item)) (format-time-string "%m/%d" (nth 2 item))
(nth 4 item) (nth 1 xact) (nth 2 xact))) (nth 4 item) (nth 1 xact) (nth 2 xact)))