summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ledger-mode.el1
-rw-r--r--lisp/ledger-post.el7
2 files changed, 8 insertions, 0 deletions
diff --git a/lisp/ledger-mode.el b/lisp/ledger-mode.el
index f2eb4b21..30f25dfc 100644
--- a/lisp/ledger-mode.el
+++ b/lisp/ledger-mode.el
@@ -285,6 +285,7 @@ With a prefix argument, remove the effective date."
(define-key map [(meta ?p)] 'ledger-navigate-prev-xact-or-directive)
(define-key map [(meta ?n)] 'ledger-navigate-next-xact-or-directive)
+ (define-key map [(meta ?q)] 'ledger-post-align-dwim)
map)
"Keymap for `ledger-mode'.")
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)