summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorthdox <thdox@free.fr>2015-02-26 12:21:03 +0100
committerthdox <thdox@free.fr>2015-04-05 16:00:15 +0200
commitf5ba76442c45a87f2eefe46c78a18ff291d85166 (patch)
tree2c10161befc8318a30c7441a401dc4c3e2bb4fa0 /lisp
parentc7fa772310bacf57a185e47efb1c07c83b902a59 (diff)
downloadfork-ledger-f5ba76442c45a87f2eefe46c78a18ff291d85166.tar.gz
fork-ledger-f5ba76442c45a87f2eefe46c78a18ff291d85166.tar.bz2
fork-ledger-f5ba76442c45a87f2eefe46c78a18ff291d85166.zip
[emacs] Fix bug 1060.
Set as an option to kill (or not) the reconcile buffer after ledger-reconcile-finish. The default is set to *not* kill the buffer. This is justified as the facts that: 1. In old ledger mode (the one from Ledger 2.6), the default is to *not* kill the buffer. Also for the ones who will migrate from 2.6 to 3 when package will be available in their linux distribution, this will be the path of least surprise. 2. The current documentation does state that the buffer is to be killed with 'q' after 'C-c C-c'. This has been made configurable, as killing buffer may already be part of the workflow of some persons. [ci skip]
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ledger-reconcile.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/ledger-reconcile.el b/lisp/ledger-reconcile.el
index 2396748a..326266b7 100644
--- a/lisp/ledger-reconcile.el
+++ b/lisp/ledger-reconcile.el
@@ -118,6 +118,11 @@ Possible values are '(date)', '(amount)', '(payee)' or '(0)' for no sorting, i.e
:type 'boolean
:group 'ledger-reconcile)
+(defcustom ledger-reconcile-finish-force-quit nil
+ "If t, will force closing reconcile window after \\[ledger-reconcile-finish]."
+ :type 'boolean
+ :group 'ledger-reconcile)
+
;; s-functions below are copied from Magnars' s.el
;; prefix ledger-reconcile- is added to not conflict with s.el
(defun ledger-reconcile-s-pad-left (len padding s)
@@ -314,7 +319,7 @@ Return the number of uncleared xacts found."
(defun ledger-reconcile-finish ()
"Mark all pending posting or transactions as cleared.
Depends on ledger-reconcile-clear-whole-transactions, save the buffers
-and exit reconcile mode"
+and exit reconcile mode if `ledger-reconcile-finish-force-quit'"
(interactive)
(save-excursion
(goto-char (point-min))
@@ -327,7 +332,8 @@ and exit reconcile mode"
(ledger-toggle-current 'cleared))))
(forward-line 1)))
(ledger-reconcile-save)
- (ledger-reconcile-quit))
+ (when ledger-reconcile-finish-force-quit
+ (ledger-reconcile-quit)))
(defun ledger-reconcile-quit ()