summaryrefslogtreecommitdiff
path: root/lisp/ldg-post.el
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-03-06 21:13:06 -0500
committerCraig Earls <enderw88@gmail.com>2013-03-06 21:13:06 -0500
commit27d27ecb6c5be3a9523fd4efc895b6d0b2a6cfb4 (patch)
tree35e45d46c2cfd17953a522f52106d9c0e17925f4 /lisp/ldg-post.el
parent81eeb210e8e2b33077624fd9d0fd3ef63837701a (diff)
downloadfork-ledger-27d27ecb6c5be3a9523fd4efc895b6d0b2a6cfb4.tar.gz
fork-ledger-27d27ecb6c5be3a9523fd4efc895b6d0b2a6cfb4.tar.bz2
fork-ledger-27d27ecb6c5be3a9523fd4efc895b6d0b2a6cfb4.zip
Account auto formatting now works with tab completion
Diffstat (limited to 'lisp/ldg-post.el')
-rw-r--r--lisp/ldg-post.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/ldg-post.el b/lisp/ldg-post.el
index e794f071..d68d7f16 100644
--- a/lisp/ldg-post.el
+++ b/lisp/ldg-post.el
@@ -133,10 +133,15 @@ the account"
(setq column ledger-post-amount-alignment-column))
(save-excursion
;; Position the account
- ;; (beginning-of-line)
- (set-mark (point))
- ;; (delete-horizontal-space)
- ;; (insert ledger-default-acct-transaction-indent)
+ (if (not
+ (and (looking-at "[ \t]+\n")
+ (looking-back "[ \n]" (- (point) 2))))
+ (progn
+ (beginning-of-line)
+ (set-mark (point))
+ (delete-horizontal-space)
+ (insert ledger-default-acct-transaction-indent))
+ (set-mark (point)))
(goto-char (1+ (line-end-position)))
(let* ((mark-first (< (mark) (point)))
(begin (if mark-first (mark) (point)))