Handle quoted commodities in ledger-split-commodity-string
This commit is contained in:
parent
f1882d0a56
commit
c8c94e9602
1 changed files with 26 additions and 15 deletions
|
|
@ -41,7 +41,18 @@ Returns a list with (value commodity)."
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(insert str)
|
(insert str)
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(cond ((re-search-forward number-regex nil t)
|
(cond
|
||||||
|
((re-search-forward "\"\\(.*\\)\"" nil t)
|
||||||
|
(let ((com (delete-and-extract-region
|
||||||
|
(match-beginning 1)
|
||||||
|
(match-end 1))))
|
||||||
|
(if (re-search-forward number-regex nil t)
|
||||||
|
(list
|
||||||
|
(string-to-number
|
||||||
|
(ledger-commodity-string-number-decimalize
|
||||||
|
(delete-and-extract-region (match-beginning 0) (match-end 0)) :from-user))
|
||||||
|
com))))
|
||||||
|
((re-search-forward number-regex nil t)
|
||||||
;; found a number in the current locale, return it in
|
;; found a number in the current locale, return it in
|
||||||
;; the car. Anything left over is annotation,
|
;; the car. Anything left over is annotation,
|
||||||
;; the first thing should be the commodity, separated
|
;; the first thing should be the commodity, separated
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue