Hello,
I decided to start a new thread about this to give the subject a bit
more visibility.
I have been working on a general revamp of beancount-mode to transform
it into a major mode, mostly to enable better completion behavior. I
open a pull request with the result of this work:
https://bitbucket.org/blais/beancount/pull-requests/115/revamp-beancountel/diff
I think I fixed all bugs reported so far and I would like some more
extended testing. There are some significant changes in behavior:
- It being a major mode now, composing it with org-mode is not possible
anymore. I tried to preserve functionality adding integration with
outline-minor-mode. To add sectioning functionality back you would need
something like
(define-key* beancount-mode-map (key "C-c C-n")
#'outline-next-visible-heading)
(define-key* beancount-mode-map (key "C-c C-p")
#'outline-previous-visible-heading)
(add-hook 'beancount-mode-hook #'outline-minor-mode)
to your Emacs configuration. Recognized headings either start with three
or more semicolons or with asterisks. As per Martin suggestion I
implemented fontification of section headings a la org-mode. Please
report any other missing functionality and I'll see how hard it is to
bring it back.
- "TAB" now either indents, completes, or folds the heading depending on
the context. It works well for me.
- amounts in postings are indented so that the decimal point is at the
52nd column. This can be configured customizing
`beancount-number-alignment-column`. Setting it to 0 will cause the
alignment column to be determined from file content. Postings in
transactions are indented with `beancount-transaction-indent` spaces.
- pressing "RETURN" on causes the current line to be re-indeted. If the
current line is a posting, the amount will be indented as per above.
This behavior is defined by Emacs auto indent mechanism. If you don't
like it you can disable it setting `electric-indent-chars` to nil, for
example like this (untested):
(defun my-disable-electric-indent ()
(setq-local electric-indent-chars nil))
(add-hook 'beancount-mode-hook #'my-disable-electric-indent)
Thank you for testing!
Cheers,
Dan