Skip to content

Commit

Permalink
[ledger-report] Delay report command expansion
Browse files Browse the repository at this point in the history
Delays the expansion of the report command until execution time.  This leaves
the command in `ledger-report-cmd' unexpanded, which prevents the expanded
version of the command from being edited / saved by the user.

Resolves #325
  • Loading branch information
kevinjfoley committed Feb 4, 2022
1 parent f47df6a commit 7746467
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ledger-report.el
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,6 @@ Optionally EDIT the command."
(when (or (null report-cmd) edit)
(setq report-cmd (ledger-report-read-command report-cmd))
(setq ledger-report-saved nil)) ;; this is a new report, or edited report
(setq report-cmd (ledger-report-expand-format-specifiers report-cmd))
(set (make-local-variable 'ledger-report-cmd) report-cmd)
(or (ledger-report-string-empty-p report-name)
(ledger-report-name-exists report-name)
Expand Down Expand Up @@ -526,6 +525,7 @@ arguments returned by `ledger-report--compute-extra-args'."
(marker-re (concat " *" (regexp-quote marker)))
(args (ledger-report--compute-extra-args cmd))
(args-str (concat " " (mapconcat #'shell-quote-argument args " ")))
(cmd (ledger-report-expand-format-specifiers cmd))
(clean-cmd (replace-regexp-in-string marker-re "" cmd t t))
(real-cmd (replace-regexp-in-string marker-re args-str cmd t t)))
(setq header-line-format
Expand Down

0 comments on commit 7746467

Please sign in to comment.