diff options
author | Craig Earls <enderw88@gmail.com> | 2015-09-28 19:00:01 -0700 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2015-09-28 19:00:01 -0700 |
commit | 1cf83c6f5f5d005fb143f34b32b86bb838cd9674 (patch) | |
tree | e63e21895b68c44f7672569a32cf8324cc0ab70f /lisp/ledger-post.el | |
parent | 5905c21ded741a9d17f67999a7e4c33da6c886c8 (diff) | |
parent | 64426842a34f0517e43a47a404cd15c764f1c7f2 (diff) | |
download | ledger-1cf83c6f5f5d005fb143f34b32b86bb838cd9674.tar.gz ledger-1cf83c6f5f5d005fb143f34b32b86bb838cd9674.tar.bz2 ledger-1cf83c6f5f5d005fb143f34b32b86bb838cd9674.zip |
Merge commit '64426842a34f0517e43a47a404cd15c764f1c7f2' into next
Diffstat (limited to 'lisp/ledger-post.el')
-rw-r--r-- | lisp/ledger-post.el | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lisp/ledger-post.el b/lisp/ledger-post.el index 21e856db..d741442a 100644 --- a/lisp/ledger-post.el +++ b/lisp/ledger-post.el @@ -79,8 +79,7 @@ point at beginning of the commodity." (when (re-search-forward ledger-amount-regex end t) (goto-char (match-beginning 0)) (skip-syntax-forward " ") - (- (or (match-end 4) - (match-end 3)) (point))))) + (- (match-end 3) (point))))) (defun ledger-next-account (&optional end) "Move to the beginning of the posting, or status marker, limit to END. @@ -146,6 +145,19 @@ 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 or the current region. + +If the point is in a comment, fill the comment paragraph as +regular text." + (interactive) + (cond + ((nth 4 (syntax-ppss)) + (call-interactively 'ledger-post-align-postings) + (fill-paragraph)) + ((use-region-p) (call-interactively 'ledger-post-align-postings)) + (t (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) |