Skip to content

Commit

Permalink
WIP use account on report line as default for prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
bcc32 committed Jul 9, 2024
1 parent 6e3723a commit eabc29e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ledger-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,11 @@

(defun ledger-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)))
(let ((account (or (ignore-errors
(with-current-buffer ledger-report-buffer-name
(debug)
(get-text-property (point) 'ledger-report-account)))
(ledger-context-field-value (ledger-context-at-point) 'account))))
(ledger-completing-read-with-default prompt
(when account
(regexp-quote account))
Expand Down

0 comments on commit eabc29e

Please sign in to comment.