diff options
author | Craig Earls <enderw88@gmail.com> | 2014-12-07 12:15:15 -0700 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2014-12-07 12:15:15 -0700 |
commit | 2f0dcec10e0cd3f747f4db5155c534f79f1b13c1 (patch) | |
tree | 6307e3710f90580c7b355f334102caf041d39105 /lisp/ledger-reconcile.el | |
parent | dedc6c7061310b80c0399df87c7ebc1ab44d7810 (diff) | |
download | fork-ledger-2f0dcec10e0cd3f747f4db5155c534f79f1b13c1.tar.gz fork-ledger-2f0dcec10e0cd3f747f4db5155c534f79f1b13c1.tar.bz2 fork-ledger-2f0dcec10e0cd3f747f4db5155c534f79f1b13c1.zip |
Make sure there is alive window to switch back to when quitting reconcile buffer
Diffstat (limited to 'lisp/ledger-reconcile.el')
-rw-r--r-- | lisp/ledger-reconcile.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/ledger-reconcile.el b/lisp/ledger-reconcile.el index 8789a3e1..61e2ba6f 100644 --- a/lisp/ledger-reconcile.el +++ b/lisp/ledger-reconcile.el @@ -197,15 +197,16 @@ Return the number of uncleared xacts found." (defun ledger-reconcile-refresh-after-save () "Refresh the recon-window after the ledger buffer is saved." - (let ((curbuf (current-buffer)) + (let ((curbufwin (get-buffer-window (current-buffer))) (curpoint (point)) (recon-buf (get-buffer ledger-recon-buffer-name))) (when (buffer-live-p recon-buf) (with-current-buffer recon-buf (ledger-reconcile-refresh) (set-buffer-modified-p nil)) - (select-window (get-buffer-window curbuf)) - (goto-char curpoint)))) + (when curbufwin + (select-window curbufwin) + (goto-char curpoint))))) (defun ledger-reconcile-add () "Use ledger xact to add a new transaction." |