diff options
Diffstat (limited to 'lisp/ledger-post.el')
-rw-r--r-- | lisp/ledger-post.el | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/lisp/ledger-post.el b/lisp/ledger-post.el index e0c7aaee..21e856db 100644 --- a/lisp/ledger-post.el +++ b/lisp/ledger-post.el @@ -95,28 +95,20 @@ at beginning of account" (current-column)))) (defun ledger-post-align-xact (pos) - "Align all the posting in the xact at POS." - (interactive "d") + "Align all the posting in the xact at POS." + (interactive "d") (let ((bounds (ledger-navigate-find-xact-extents pos))) (ledger-post-align-postings (car bounds) (cadr bounds)))) -(defun ledger-post-align-postings (&optional beg end) - "Align all accounts and amounts between BEG and END, or the current line." - (interactive) +(defun ledger-post-align-postings (beg end) + "Align all accounts and amounts between BEG and END, or the current region, or, if no region, the current line." + (interactive "r") (save-excursion - (if (or (not (mark)) - (not (use-region-p))) - (set-mark (point))) - (let ((inhibit-modification-hooks t) - (mark-first (< (mark) (point))) acct-start-column acct-end-column acct-adjust amt-width amt-adjust (lines-left 1)) - (unless beg (setq beg (if mark-first (mark) (point)))) - (unless end (setq end (if mark-first (mark) (point)))) - ;; Extend region to whole lines (let ((start-marker (set-marker (make-marker) (save-excursion (goto-char beg) |