summaryrefslogtreecommitdiff
path: root/lisp/ldg-post.el
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-03-24 23:26:23 -0400
committerCraig Earls <enderw88@gmail.com>2013-03-24 23:26:23 -0400
commit15efb41abacfe81aaa921ec46472bbdffc4b222d (patch)
treea1326efe067f2ddcb0653feabeca138828ee3bd2 /lisp/ldg-post.el
parente8a2ebb6993eb025d536495caae02852caf291d1 (diff)
downloadfork-ledger-15efb41abacfe81aaa921ec46472bbdffc4b222d.tar.gz
fork-ledger-15efb41abacfe81aaa921ec46472bbdffc4b222d.tar.bz2
fork-ledger-15efb41abacfe81aaa921ec46472bbdffc4b222d.zip
Make complete play nice with auto alignment
Diffstat (limited to 'lisp/ldg-post.el')
-rw-r--r--lisp/ldg-post.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/ldg-post.el b/lisp/ldg-post.el
index 0de2de7d..bbed297d 100644
--- a/lisp/ldg-post.el
+++ b/lisp/ldg-post.el
@@ -172,6 +172,9 @@ position, whichever is closer."
region alight the posting on the current line."
(interactive)
(save-excursion
+ (if (or (not (mark))
+ (not (use-region-p)))
+ (set-mark (point)))
(let* ((mark-first (< (mark) (point)))
(begin-region (if mark-first (mark) (point)))
(end-region (if mark-first (point-marker) (mark-marker)))
@@ -180,8 +183,9 @@ region alight the posting on the current line."
(goto-char end-region)
(setq end-region (copy-marker (line-end-position)))
(goto-char begin-region)
- (setq begin-region (copy-marker (line-beginning-position)))
- (goto-char begin-region)
+ (goto-char
+ (setq begin-region
+ (copy-marker (line-beginning-position))))
(while (or (setq acc-col (ledger-next-account (end-of-line-or-region end-region)))
(< (point) (marker-position end-region)))
(when acc-col