Skip to content

Hold on to ledger-reports variable's local value #440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ledger-report.el
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,13 @@ used to generate the buffer, navigating the buffer, etc."
(edit (not (null current-prefix-arg))))
(list rname edit))))
(let* ((file (ledger-master-file))
(buf (find-file-noselect file)))
(buf (find-file-noselect file))
(local-ledger-reports (when (local-variable-p 'ledger-reports) ledger-reports)))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be simpler to unconditionally use whatever value ledger-reports has in the current buffer.

(with-current-buffer
(pop-to-buffer (get-buffer-create ledger-report-buffer-name))
(ledger-report-mode)
(when local-ledger-reports
(set (make-local-variable 'ledger-reports) local-ledger-reports))
(setq ledger-report-saved nil)
(setq ledger-report-ledger-buf buf)
(setq ledger-report-name report-name)
Expand Down