From 2f0dcec10e0cd3f747f4db5155c534f79f1b13c1 Mon Sep 17 00:00:00 2001 From: Craig Earls Date: Sun, 7 Dec 2014 12:15:15 -0700 Subject: Make sure there is alive window to switch back to when quitting reconcile buffer --- lisp/ledger-reconcile.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lisp/ledger-reconcile.el') 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." -- cgit v1.2.3