summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2015-06-28 19:35:31 -0700
committerCraig Earls <enderw88@gmail.com>2015-06-28 19:35:31 -0700
commit6e92d87d907cb3663f9c463da215f21c7e30bc39 (patch)
tree138ae6d97c0a53d6f8174aae985c4b0fd92a83d5 /lisp
parent5f03a94b522f4c348ae952e2dfdba98e71a35b8f (diff)
parent45e74103607a77c5945615692c3a35f9ce6aadde (diff)
downloadfork-ledger-6e92d87d907cb3663f9c463da215f21c7e30bc39.tar.gz
fork-ledger-6e92d87d907cb3663f9c463da215f21c7e30bc39.tar.bz2
fork-ledger-6e92d87d907cb3663f9c463da215f21c7e30bc39.zip
Merge commit '45e74103607a77c5945615692c3a35f9ce6aadde' into next
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ledger-post.el14
1 files changed, 3 insertions, 11 deletions
diff --git a/lisp/ledger-post.el b/lisp/ledger-post.el
index 527a2044..21e856db 100644
--- a/lisp/ledger-post.el
+++ b/lisp/ledger-post.el
@@ -100,23 +100,15 @@ at beginning of account"
(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)