Skip to content

Commit 0573def

Browse files
committed
[ledger-report] Delay report command expansion
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
1 parent 3ec65b8 commit 0573def

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ledger-report.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,6 @@ Optionally EDIT the command."
471471
(when (or (null report-cmd) edit)
472472
(setq report-cmd (ledger-report-read-command report-cmd))
473473
(setq ledger-report-saved nil)) ;; this is a new report, or edited report
474-
(setq report-cmd (ledger-report-expand-format-specifiers report-cmd))
475474
(set (make-local-variable 'ledger-report-cmd) report-cmd)
476475
(or (ledger-report-string-empty-p report-name)
477476
(ledger-report-name-exists report-name)
@@ -526,6 +525,7 @@ arguments returned by `ledger-report--compute-extra-args'."
526525
(marker-re (concat " *" (regexp-quote marker)))
527526
(args (ledger-report--compute-extra-args cmd))
528527
(args-str (concat " " (mapconcat #'shell-quote-argument args " ")))
528+
(cmd (ledger-report-expand-format-specifiers cmd))
529529
(clean-cmd (replace-regexp-in-string marker-re "" cmd t t))
530530
(real-cmd (replace-regexp-in-string marker-re args-str cmd t t)))
531531
(setq header-line-format

0 commit comments

Comments
 (0)