diff options
author | Craig Earls <enderw88@gmail.com> | 2014-07-12 22:32:59 -0700 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2014-07-12 22:32:59 -0700 |
commit | 2f9240ae00d04dc469df76334fd44e78212246d0 (patch) | |
tree | 687ba84e02a68c478a76e22f3ba5b7bf4be2d22c /lisp | |
parent | 4606bb293dfaf22a3662f197a99499a26f8c097e (diff) | |
download | fork-ledger-2f9240ae00d04dc469df76334fd44e78212246d0.tar.gz fork-ledger-2f9240ae00d04dc469df76334fd44e78212246d0.tar.bz2 fork-ledger-2f9240ae00d04dc469df76334fd44e78212246d0.zip |
Improve report redo logic.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ledger-report.el | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/lisp/ledger-report.el b/lisp/ledger-report.el index 3c51fc10..cf7da31a 100644 --- a/lisp/ledger-report.el +++ b/lisp/ledger-report.el @@ -360,16 +360,18 @@ Optional EDIT the command." (defun ledger-report-redo () "Redo the report in the current ledger report buffer." (interactive) - - (if (and (get-buffer ledger-buf) - (get-buffer ledger-report-buffer-name)) - (progn - (pop-to-buffer (get-buffer ledger-report-buffer-name)) - (shrink-window-if-larger-than-buffer) - (setq buffer-read-only nil) - (erase-buffer) - (ledger-do-report ledger-report-cmd) - (setq buffer-read-only nil)))) + (let ((cur-buf (current-buffer))) + (if (and (string= mode-name "Ledger") + (get-buffer ledger-report-buffer-name)) + (progn + + (pop-to-buffer (get-buffer ledger-report-buffer-name)) + (shrink-window-if-larger-than-buffer) + (setq buffer-read-only nil) + (erase-buffer) + (ledger-do-report ledger-report-cmd) + (setq buffer-read-only nil) + (pop-to-buffer cur-buf))))) (defun ledger-report-quit () "Quit the ledger report buffer." |