On Sat, Jan 19, 2019 at 10:59:36PM -0700, Daniele Nicolodi wrote:
> I have now re-implemented number alignment.  It is automatically
> triggered on newline and on tab.  I also implemented
> beancount-align-transaction that you can bind to C-C C-q to obtain the
> ledger-mode functionality.

I've tested this, and it works great!

I was initially surprised that the function doesn't also align each line
of the transaction before aligning the amounts (i.e., doing the
equivalent of hitting TAB on each line and *then* align the amounts),
but that is indeed consistent with ledger-mode's behavior.

> By default numbers are aligned to the 52nd column, controlled by the
> beancount-posting-amount-alignment-column defcustom variable. If that
> variable is set to nil the column is computed in a similar way asin
> beancount-align-numbers. This is probably quite slow for huge ledger
> files, and I personally prefer to have the alignment independent of
> the length of the account names.

That is my own preference too, but it's nice to have the re-align
everything option, for those who really want to.

Since we're talking about customizability, it would be nice to have a
local variable to set the desired amount of indentation. I know
beancount goes for 2 spaces by default, but I currently use 4, for
consistency with ledger. YMMV.

Also, on your yesterday's point about breaking the current behavior, I
guess this list is a good start to check if there really are people who
want TAB to trigger autocompletion when the cursor is in the middle of
an account name. But anyway, I'm guessing you'll eventually submit these
amazing improvements to Martin B. as PR, so you can also let him be the
arbiter of the preferred behavior there.

Thanks a lot for all this!

Ciao,
-- 
Stefano Zacchiroli . z...@upsilon.cc . upsilon.cc/zack . . o . . . o . o
Computer Science Professor . CTO Software Heritage . . . . . o . . . o o
Former Debian Project Leader & OSI Board Director  . . . o o o . . . o .
« the first rule of tautology club is the first rule of tautology club »

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beancount+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20190120162658.tmm5fa6m45w2tdxy%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.

Reply via email to