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.
This commit is contained in:
parent
a13bcd4109
commit
24a9e422eb
1 changed files with 11 additions and 11 deletions
|
|
@ -276,17 +276,17 @@
|
||||||
;; when the buffer point is moved and recentered. If they aren't
|
;; when the buffer point is moved and recentered. If they aren't
|
||||||
;; strange things happen.
|
;; strange things happen.
|
||||||
|
|
||||||
(let
|
(let ((recon-window (get-buffer-window (get-buffer ledger-recon-buffer-name))))
|
||||||
((recon-window (get-buffer-window (get-buffer ledger-recon-buffer-name))))
|
(when recon-window
|
||||||
(fit-window-to-buffer recon-window)
|
(fit-window-to-buffer recon-window)
|
||||||
(with-current-buffer buf
|
(with-current-buffer buf
|
||||||
(select-window (get-buffer-window buf))
|
(select-window (get-buffer-window buf))
|
||||||
(goto-char (point-max))
|
(goto-char (point-max))
|
||||||
(recenter -1))
|
(recenter -1))
|
||||||
|
|
||||||
(select-window recon-window)
|
(select-window recon-window)
|
||||||
(add-hook 'post-command-hook 'ledger-reconcile-track-xact nil t)
|
(ledger-reconcile-visit t))
|
||||||
(ledger-reconcile-visit t))))
|
(add-hook 'post-command-hook 'ledger-reconcile-track-xact nil t))))
|
||||||
|
|
||||||
(defun ledger-reconcile-track-xact ()
|
(defun ledger-reconcile-track-xact ()
|
||||||
(if (member this-command (list 'next-line
|
(if (member this-command (list 'next-line
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue