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]
ledger-xact.el:ledger-copy-transaction-at-point (C-c C-k) led to a confusing change in the ledger file for the case when the target date was smaller than last date in the ledger.
This is a subtle bug that happens only when org-src-fontify-natively is
enabled:
(setq org-src-fontify-natively t)
If then you create a Babel block with ledger text, it won't be
fontified.
This happens because the 'ledger-fontify-buffer-part' starts
fontification from the current 'point', which in case of
org-src-font-lock-fontify-block happens to _not_ point to the beginning
of buffer. Instead it points to the original org-mode buffer.
This doesn't happen when one opens regular files, because the
'point' is almost always at the beginning of the file.
To reproduce the bug, you can do the following:
(defun fontify-test()
(let ((lang-mode 'ledger-mode) pos next)
(with-current-buffer
(get-buffer-create
"ledger-fontification-bug")
(unless (eq major-mode lang-mode) (funcall lang-mode))
(erase-buffer)
(insert "2015/01/09 asdf\n foo\n bar\n" " ")
(font-lock-fontify-buffer)
(switch-to-buffer "ledger-fontification-bug")
)))
Call 'fontify-test' and see that the buffer is not fontified.
[ci skip]
The following script makes it a no-brainer:
% NEXT_YEAR=2015; ag -l 'Copyright.*Wiegley' \
| xargs sed -i '' -e "s/\(Copyright.*\)-20[0-9]\{2\}/\1-${NEXT_YEAR}/"
The minor mode gets restored by desktop.el, and this has long caused
errors. While the ideal would be to restore the mode along with the
current narrowing regexp, this interim fix instead ensures that
ledger-occur-mode will disable itself if it finds no regexp set.
This began with noticing that the code didn't support the (ugly, yet
valid) case of a tab between the date and txn description. I took the
opportunity to make the regexes more consistent along the way.
Sometimes cleaning a buffer would leave the end of the buffer uncleaned,
because the end position would be moved along the way. This commit makes
the corresponding code use markers instead, which track the changes in
the buffer, and therefore ensure that the entire buffer is acted upon.