Change ledger-next-amount to be case-sensitive

Otherwise if there is an account that's name only has one part, the
regex can match it as a currency and as the beginning of an amount.
E.g. if we have the line "Expenses         45 USD", then the old
ledger-next-amount will jump to Expenses instead of to 45.
This commit is contained in:
Gergely Risko 2013-07-12 01:07:25 +02:00
parent 78e65ee4ab
commit 515ae05d6b

View file

@ -117,11 +117,12 @@ to choose from."
Return the width of the amount field as an integer and leave Return the width of the amount field as an integer and leave
point at beginning of the commodity." point at beginning of the commodity."
;;(beginning-of-line) ;;(beginning-of-line)
(when (re-search-forward ledger-amount-regex end t) (let ((case-fold-search nil))
(goto-char (match-beginning 0)) (when (re-search-forward ledger-amount-regex end t)
(skip-syntax-forward " ") (goto-char (match-beginning 0))
(- (or (match-end 4) (skip-syntax-forward " ")
(match-end 3)) (point)))) (- (or (match-end 4)
(match-end 3)) (point)))))
(defun ledger-next-account (&optional end) (defun ledger-next-account (&optional end)