diff options
author | Simon Michael <simon@joyful.com> | 2015-09-21 12:40:28 -0700 |
---|---|---|
committer | Simon Michael <simon@joyful.com> | 2015-09-21 12:40:28 -0700 |
commit | 4dec0e3829e0d5b9da798265cc60a3feedd57f88 (patch) | |
tree | 4ad06f91fd8e668426548be675f8a53e483f4332 /lisp | |
parent | 3d8fd6d3def733f72f1e0ca1c88c4771f9b3d91f (diff) | |
parent | 593a07364de6bc7d1c4ccdfdc9bc47b2ba3098e8 (diff) | |
download | fork-ledger-4dec0e3829e0d5b9da798265cc60a3feedd57f88.tar.gz fork-ledger-4dec0e3829e0d5b9da798265cc60a3feedd57f88.tar.bz2 fork-ledger-4dec0e3829e0d5b9da798265cc60a3feedd57f88.zip |
Merge pull request #433 from Fuco1/improve-align-dwim
Fill comment paragraph with ledger-post-align-dwim
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ledger-post.el | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lisp/ledger-post.el b/lisp/ledger-post.el index f648ea8f..5696d0e4 100644 --- a/lisp/ledger-post.el +++ b/lisp/ledger-post.el @@ -147,11 +147,17 @@ at beginning of account" (setq inhibit-modification-hooks nil)))) (defun ledger-post-align-dwim () - "Align all the posting of the current xact the current region." + "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) - (if (use-region-p) - (call-interactively 'ledger-post-align-postings) - (call-interactively 'ledger-post-align-xact))) + (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." |