From 023e245e9b942968a5c61e494c28de2823b2a222 Mon Sep 17 00:00:00 2001 From: Craig Earls Date: Thu, 21 Feb 2013 14:35:29 -0700 Subject: Another attempt to deal with decimal-comma --- lisp/ldg-commodities.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/ldg-commodities.el b/lisp/ldg-commodities.el index 1b6b332a..c832f375 100644 --- a/lisp/ldg-commodities.el +++ b/lisp/ldg-commodities.el @@ -44,13 +44,14 @@ This only has effect interfacing to calc mode in edit amount" (with-temp-buffer (insert str) (goto-char (point-min)) - (re-search-forward "-?[1-9][0-9]*[.,][0-9]*") + (re-search-forward "-?[1-9][0-9]*[.,][0-9]*" nil t) (setq val (string-to-number (ledger-commodity-string-number-decimalize (delete-and-extract-region (match-beginning 0) (match-end 0)) :from-user))) - (delete-trailing-whitespace) - (setq comm (buffer-substring (point-min) (point-max))) + (re-search-forward "[^[:space:]]" nil t) + (setq comm + (delete-and-extract-region (match-beginning 0) (match-end 0))) (list val comm)))) -- cgit v1.2.3