From e6a2579f349d7935657d20344115bb6903ea707d Mon Sep 17 00:00:00 2001 From: Matus Goljer Date: Sat, 19 Sep 2015 13:57:13 +0200 Subject: 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. --- lisp/ledger-post.el | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lisp') diff --git a/lisp/ledger-post.el b/lisp/ledger-post.el index 21e856db..f648ea8f 100644 --- a/lisp/ledger-post.el +++ b/lisp/ledger-post.el @@ -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) -- cgit v1.2.3