Add a function to "dwim" align.

If no region is active, align the current transaction.  If a region is
active, align all postings in the region.
This commit is contained in:
Matus Goljer 2015-09-19 13:57:13 +02:00
parent 88ad616d18
commit e6a2579f34

View file

@ -146,6 +146,13 @@ at beginning of account"
(setq lines-left (not (eobp)))))
(setq inhibit-modification-hooks nil))))
(defun ledger-post-align-dwim ()
"Align all the posting of the current xact the current region."
(interactive)
(if (use-region-p)
(call-interactively 'ledger-post-align-postings)
(call-interactively 'ledger-post-align-xact)))
(defun ledger-post-edit-amount ()
"Call 'calc-mode' and push the amount in the posting to the top of stack."
(interactive)