summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/ldg-commodities.el7
1 files 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))))