diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ledger-post.el | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lisp/ledger-post.el b/lisp/ledger-post.el index 3e9310a3..d67b7ca0 100644 --- a/lisp/ledger-post.el +++ b/lisp/ledger-post.el @@ -209,16 +209,16 @@ region align the posting on the current line." (let ((end-of-amount (re-search-forward "[-.,0-9]+" (line-end-position) t))) ;; determine if there is an amount to edit (if end-of-amount - (let ((val (ledger-string-to-number (match-string 0)))) - (goto-char (match-beginning 0)) - (delete-region (match-beginning 0) (match-end 0)) - (calc) - (calc-eval val 'push)) ;; edit the amount - (progn ;;make sure there are two spaces after the account name and go to calc - (if (search-backward " " (- (point) 3) t) - (goto-char (line-end-position)) - (insert " ")) - (calc)))))) + (let ((val-string (match-string 0))) + (goto-char (match-beginning 0)) + (delete-region (match-beginning 0) (match-end 0)) + (calc) + (calc-eval val-string 'push)) ;; edit the amount + (progn ;;make sure there are two spaces after the account name and go to calc + (if (search-backward " " (- (point) 3) t) + (goto-char (line-end-position)) + (insert " ")) + (calc)))))) (defun ledger-post-prev-xact () "Move point to the previous transaction." |