summaryrefslogtreecommitdiff
path: root/lisp/ldg-reconcile.el
diff options
context:
space:
mode:
authorRémi Vanicat <vanicat@debian.org>2013-02-13 15:54:01 +0100
committerRémi Vanicat <vanicat@debian.org>2013-02-13 17:08:09 +0100
commit24a9e422eb811224d4340905e68867181cb26861 (patch)
tree43f86962e470d15a9773510dad2fead8772c0da9 /lisp/ldg-reconcile.el
parenta13bcd4109711ea756727c6e8a00a262ad220dae (diff)
downloadfork-ledger-24a9e422eb811224d4340905e68867181cb26861.tar.gz
fork-ledger-24a9e422eb811224d4340905e68867181cb26861.tar.bz2
fork-ledger-24a9e422eb811224d4340905e68867181cb26861.zip
In ledger-do-reconcile, don't act on windows when reconcile hasn't one
Ledger-do-reconcile might be called indirectly (in the after-save-hook for example) and one might not want this buffer she has buried to show up again when she is saving another (even related) buffer.
Diffstat (limited to 'lisp/ldg-reconcile.el')
-rw-r--r--lisp/ldg-reconcile.el22
1 files changed, 11 insertions, 11 deletions
diff --git a/lisp/ldg-reconcile.el b/lisp/ldg-reconcile.el
index 25d2e981..03663b6b 100644
--- a/lisp/ldg-reconcile.el
+++ b/lisp/ldg-reconcile.el
@@ -276,17 +276,17 @@
;; when the buffer point is moved and recentered. If they aren't
;; strange things happen.
- (let
- ((recon-window (get-buffer-window (get-buffer ledger-recon-buffer-name))))
- (fit-window-to-buffer recon-window)
- (with-current-buffer buf
- (select-window (get-buffer-window buf))
- (goto-char (point-max))
- (recenter -1))
-
- (select-window recon-window)
- (add-hook 'post-command-hook 'ledger-reconcile-track-xact nil t)
- (ledger-reconcile-visit t))))
+ (let ((recon-window (get-buffer-window (get-buffer ledger-recon-buffer-name))))
+ (when recon-window
+ (fit-window-to-buffer recon-window)
+ (with-current-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))))
(defun ledger-reconcile-track-xact ()
(if (member this-command (list 'next-line