summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-03-23 20:22:40 -0700
committerCraig Earls <enderw88@gmail.com>2013-03-23 20:22:40 -0700
commit0bcef93e29a67310cef209074f2162415f1cffd3 (patch)
tree1b6b90801c7ae63a5031a1167ce22992b8f909d1 /lisp
parentf855d7e745a41f8c91f0d6f593274df794a83589 (diff)
downloadfork-ledger-0bcef93e29a67310cef209074f2162415f1cffd3.tar.gz
fork-ledger-0bcef93e29a67310cef209074f2162415f1cffd3.tar.bz2
fork-ledger-0bcef93e29a67310cef209074f2162415f1cffd3.zip
Bug 915 maintain point in buffer when saved.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ldg-reconcile.el31
1 files changed, 15 insertions, 16 deletions
diff --git a/lisp/ldg-reconcile.el b/lisp/ldg-reconcile.el
index a4960260..3d73cca9 100644
--- a/lisp/ldg-reconcile.el
+++ b/lisp/ldg-reconcile.el
@@ -159,13 +159,14 @@ Return the number of uncleared xacts found."
"Refresh the recon-window after the ledger buffer is saved."
(let ((curbuf (current-buffer))
(curpoint (point))
- (buf (get-buffer ledger-recon-buffer-name)))
- (if buf
+ (recon-buf (get-buffer ledger-recon-buffer-name)))
+ (if (buffer-live-p recon-buf)
(progn
- (with-current-buffer buf
- (ledger-reconcile-refresh)
- (set-buffer-modified-p nil))
- (select-window (get-buffer-window curbuf))))))
+ (with-current-buffer recon-buf
+ (ledger-reconcile-refresh)
+ (set-buffer-modified-p nil))
+ (select-window (get-buffer-window curbuf))
+ (goto-char curpoint)))))
(defun ledger-reconcile-add ()
"Use ledger xact to add a new transaction."
@@ -211,14 +212,14 @@ Return the number of uncleared xacts found."
"Save the ledger buffer."
(interactive)
(let ((curpoint (point)))
- (dolist (buf (cons ledger-buf ledger-bufs))
- (with-current-buffer buf
- (save-buffer)))
- (with-current-buffer (get-buffer ledger-recon-buffer-name)
- (set-buffer-modified-p nil)
- (ledger-display-balance)
- (goto-char curpoint)
- (ledger-reconcile-visit t))))
+ (dolist (buf (cons ledger-buf ledger-bufs))
+ (with-current-buffer buf
+ (save-buffer)))
+ (with-current-buffer (get-buffer ledger-recon-buffer-name)
+ (set-buffer-modified-p nil)
+ (ledger-display-balance)
+ (goto-char curpoint)
+ (ledger-reconcile-visit t))))
(defun ledger-reconcile-finish ()
"Mark all pending posting or transactions as cleared.
@@ -401,8 +402,6 @@ moved and recentered. If they aren't strange things happen."
(set (make-local-variable 'ledger-acct) account))))
;; Narrow the ledger buffer
-
- ;; Now, actually run the reconciliation
(with-current-buffer rbuf
(save-excursion
(if ledger-narrow-on-reconcile