beancount / beancount-mode

Emacs major-mode to work with Beancount ledger files
GNU General Public License v3.0
110 stars 32 forks source link

Posting metadata indentation #55

Open TRSx80 opened 1 month ago

TRSx80 commented 1 month ago

Hi Danielle (and others),

I set out this morning to begin hacking away on my parser/writer as mentioned on the mailing list recently, but immediately ran into this.

It has always bothered me that posting metadata is not indented an additional 2 spaces by beancount-mode.

Consider the decision: "scheduled" line in the following:

2013-08-26 * "Buying some shares of Hooli"
  statement: "confirmation-826453.pdf"
  Assets:BTrade:HOOLI      10 HOOL @ {498.45 USD}
    decision: "scheduled"
  Assets:BTrade:Cash

To make sure I did not imagine seeing this, I looked it up in the documentation and indeed, it says:

the additional indentation from the posting is not strictly necessary but it helps with readability

So I had a look around, and if I am interpreting this comment correctly, it seems like it bothers you, too(?).

It does not seem to me like this ever got implemented. I looked through the code (and issues here) as well as starting up a clean, default Emacs and then loading the latest beancount.el (from git), invoking the mode and trying it, but it seems the behavior is as I always remembered it (metadata gets indented 2 spaces just like postings). Did I miss anything?

I started to implement this in my (soon-to-be) downstream library, but then I thought this is something that should better live here. If there is interest, I could try and get a patch together (actually, I'll probably start working on it anyway).

Personally I prefer the additional indentation, but we could make it optional of course.