beancount/beangulp

HEADER line is printed after SECTION line(s) causing loss of desired major mode in Emacs

blais opened this issue · 3 comments

blais commented

Original report by Milind Kamble (Bitbucket: mbkamble, GitHub: mbkamble).


In extract.py, the HEADER line is printed just before printing new entries. However, identify.py can inject SECTION lines into the output. As a result, the HEADER line whose purpose is to set the file major mode for emacs, is not the first non-blank line. So the mode setting is not honored when Emacs opens the file.

blais commented

Original comment by Martin Blais (Bitbucket: blais, GitHub: blais).


There's a known bug about this and it's been getting on my nerves, I have it on my TODO list to fix it. I think it may have something to do with a thorny issue of ordering due to buffering wrappers in the entry printer. I have to look into this, this only started recently.

blais commented

Original comment by Martin Blais (Bitbucket: blais, GitHub: blais).


Never mind, I found it, it's from a refactoring and is a straightforward issue, I'll fix it now.

blais commented

Original comment by Martin Blais (Bitbucket: blais, GitHub: blais).


Fixed beancount/beancount#330: extract prints section lines out of order.