Craig Earls <[email protected]> writes:

> Print has never preserved comments that appear outside of transactions.

Which reminds me that I have a feature request for the emacs mode, based
on the way that I've ended up structuring one of my ledger files -- and
I can imagine implementing the feature myself if there's agreement.
This ledger file is hand-maintained rather than generated from CSV, and
has at the end of it a local variables block:

; Local Variables:
; mode: ledger
; outline-regexp: "\\(;;;;+\\)"
; outline-heading-alist: ((";;;;;" . 1) (";;;;" . 2))
; eval: (progn (outline-minor-mode) (hide-body))
; End:

(which allows a year/month outline like

;;;;; 2012
;;;; January 2012
[ January transactions ]
;;;; February 2012
[ February transactions ]

and so on, with everything hidden when opening the file)

At the moment, ledger-add-entry adds an entry at the latest possible
point in the file that makes sense given the date, if I remember
correctly.  In my case, that often comes after the local variables
block, which means if I use that I have to remember to move the
transactions up, otherwise the local variables block will fail to be
near enough the end of the file.  Would there be any objection to making
ledger-add-entry use the earliest possible point that fits the date?  Or
is my use case exactly opposite to someone else's?

(Preserving top-level comments in "ledger print" would be nice for this
ledger file, too)

Christophe

Reply via email to