From a4e76727be273185c7eee5758262d58c5aa4ccdd Mon Sep 17 00:00:00 2001 From: Craig Earls Date: Wed, 20 Feb 2013 21:16:05 -0700 Subject: Put in more nil window protection. --- lisp/ldg-occur.el | 3 ++- lisp/ldg-reconcile.el | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/ldg-occur.el b/lisp/ldg-occur.el index 417a3d2a..c3f04c5d 100644 --- a/lisp/ldg-occur.el +++ b/lisp/ldg-occur.el @@ -82,7 +82,8 @@ When REGEX is nil, unhide everything, and remove higlight" (append ledger-occur-overlay-list (ledger-occur-create-folded-overlays buffer-matches))) (setq ledger-occur-last-match regex) - (select-window (get-buffer-window buffer)))) + (if (get-buffer-window buffer) + (select-window (get-buffer-window buffer))))) (recenter))) (defun ledger-occur (regex) diff --git a/lisp/ldg-reconcile.el b/lisp/ldg-reconcile.el index 9ac89915..623d7230 100644 --- a/lisp/ldg-reconcile.el +++ b/lisp/ldg-reconcile.el @@ -320,10 +320,10 @@ POSTING is used in `ledger-clear-whole-transactions' is nil." (fit-window-to-buffer recon-window) (with-current-buffer buf (add-hook 'kill-buffer-hook 'ledger-reconcile-quit nil t) - (select-window (get-buffer-window buf)) + (if (get-window-for-other-buffer buf) + (select-window (get-buffer-window buf))) (goto-char (point-max)) (recenter -1)) - (select-window recon-window) (ledger-reconcile-visit t)) (add-hook 'post-command-hook 'ledger-reconcile-track-xact nil t)))) -- cgit v1.2.3