You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2019-09-21 Store - Buy Two Get One 1/2 Off!
Expenses:Items (2 * $60.00 + $30.00)
Equity:Example
Place point over 'Expenses:Items' and do M-x ledger-display-balance-at-point (or C-c C-p).
Look at the minibuffer:
Result:
Account balance to show (Expenses:Items (2 \* \$60\.00 \+ \$30\.00):
Press RET.
Ledger error: Error: Missing ')'
Expected Result:
Account balance to show (Expenses:Items):
Press RET.
$150.00 0 Expenses:Items
ledger-display-balance-at-point eventually calls ledger-read-account-with-prompt:
(let* ((account (ledger-read-account-with-prompt "Account balance to show"))
...))
(defunledger-read-account-with-prompt (prompt)
"Read an account from the minibuffer with PROMPT."
(let* ((context (ledger-context-at-point))
(account (ledger-context-field-value context 'account)))
(ledger-completing-read-with-default prompt
(when account
(regexp-quote account))
(ledger-accounts-list))))
Note that the result of (ledger-accounts-list) is correct; it is merely the default suggestion given by (ledger-context-field-value context 'account) that is wrong.
Running ledger-context-at-point on the "Expenses" line gives as the result:
I think this means that a regular expression failed to match something,
and so the 'account' regexp matched more than it should have.
I think the issue lies in the constant ledger-line-config,
which is referred to by the function ledger-extract-context-info,
which is called by the function ledger-context-at-point,
which is called by the function ledger-context-field-info,
which is called by the function ledger-context-field-value,
which is called by the function ledger-read-account-with-prompt,
which, finally, is called by ledger-display-balance-at-point.
There's a whole big thing of regex matching here which I don't understand, and I'm not getting much further than this.
The text was updated successfully, but these errors were encountered:
ledger-mode-version
: 3.0.0Place point over 'Expenses:Items' and do
M-x ledger-display-balance-at-point
(orC-c C-p
).Look at the minibuffer:
Result:
Press
RET
.Ledger error:
Error: Missing ')'
Expected Result:
Press
RET
.ledger-display-balance-at-point
eventually callsledger-read-account-with-prompt
:Note that the result of
(ledger-accounts-list)
is correct; it is merely the default suggestion given by(ledger-context-field-value context 'account)
that is wrong.Running
ledger-context-at-point
on the "Expenses" line gives as the result:I think this means that a regular expression failed to match something,
and so the 'account' regexp matched more than it should have.
I think the issue lies in the constant
ledger-line-config
,which is referred to by the function
ledger-extract-context-info
,which is called by the function
ledger-context-at-point
,which is called by the function
ledger-context-field-info
,which is called by the function
ledger-context-field-value
,which is called by the function
ledger-read-account-with-prompt
,which, finally, is called by
ledger-display-balance-at-point
.There's a whole big thing of regex matching here which I don't understand, and I'm not getting much further than this.
The text was updated successfully, but these errors were encountered: