summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorGergely Risko <gergely@risko.hu>2013-07-12 01:07:25 +0200
committerGergely Risko <gergely@risko.hu>2013-07-12 01:17:40 +0200
commit515ae05d6b51d1488615f4fb09fb30fbd8181c3c (patch)
tree4ca4ceafbf81314899390c4196fa2ad7d7b239cd /lisp
parent78e65ee4ab7f31eff707429c74b043819d016e1e (diff)
downloadfork-ledger-515ae05d6b51d1488615f4fb09fb30fbd8181c3c.tar.gz
fork-ledger-515ae05d6b51d1488615f4fb09fb30fbd8181c3c.tar.bz2
fork-ledger-515ae05d6b51d1488615f4fb09fb30fbd8181c3c.zip
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.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ledger-post.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/ledger-post.el b/lisp/ledger-post.el
index 447a34f8..5d30e954 100644
--- a/lisp/ledger-post.el
+++ b/lisp/ledger-post.el
@@ -117,11 +117,12 @@ to choose from."
Return the width of the amount field as an integer and leave
point at beginning of the commodity."
;;(beginning-of-line)
- (when (re-search-forward ledger-amount-regex end t)
- (goto-char (match-beginning 0))
- (skip-syntax-forward " ")
- (- (or (match-end 4)
- (match-end 3)) (point))))
+ (let ((case-fold-search nil))
+ (when (re-search-forward ledger-amount-regex end t)
+ (goto-char (match-beginning 0))
+ (skip-syntax-forward " ")
+ (- (or (match-end 4)
+ (match-end 3)) (point)))))
(defun ledger-next-account (&optional end)