use-package for using beancount-mode from beancount package in emacs

81 views
Skip to first unread message

kprab...@gmail.com

unread,
Jan 17, 2025, 1:55:29 AM1/17/25
to Beancount
For new users of emacs, here's the sample use-package declaration for using beancount-mode:

Ensure that the following line is present somwhere near the beginning of your init.el below (package-initialize) declaration:
(add-to-list 'package-archives '("gnu"   . "https://elpa.gnu.org/packages/")) 

The following lines can be anywhere in init.el

(use-package beancount
  :ensure t
  :commands beancount-mode
  :hook
  (beancount-mode . outline-minor-mode)
  ;; (beancount-mode . flymake-bean-check-enable)
  :config
  (setq-local electric-indent-chars nil)
  :bind (:map beancount-mode-map
              ("C-c C-n" . outline-next-visible-heading)
              ("C-c C-p" . outline-previous-visible-heading)
              ("C-c C-u" . outline-up-heading)
              ("C-c C-b" . outline-backward-same-level)
              ("C-c C-f" . outline-forward-same-level)
              ("C-c C-a" . outline-show-all)
              ("C-c TAB" . beancount-outline-cycle)
              ))

Remember to uncomment line   (beancount-mode . flymake-bean-check-enable) if you use flymake.

For those with multiple files and using emacs, refer to this blogpost "Auto-complete Accounts From Other Beancount Files in Emacs" at https://whatacold.io/blog/2022-09-10-emacs-beancount-account-files/

Posting in the mailing list so that new emacs users may find this quickly.

Regards,
Prabu

Martin Blais

unread,
Jan 17, 2025, 1:58:35 AM1/17/25
to bean...@googlegroups.com
Or just use it the old way, inserting (require 'beancount) in your .emacs...


--
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+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/beancount/8a0dcfd5-b0b9-4d39-b723-b362324a529dn%40googlegroups.com.

gus...@gmail.com

unread,
Feb 15, 2026, 9:24:04 AM (5 days ago) Feb 15
to Beancount

Hi, I definitely could use the group's guidance. 

I have been trying to install/load beancount-mode in emacs and cannot figure it out. 
Disclosure: I am not a programmer, and I am interested in using Beancount for a small business. 
Using CachyOS (arch) Linux.
What I have done:
1. Successfully install beancount through pipx
2. Successfully install emacs
3. Realized beancount-mode is not listed in the elpa packages
4. downloaded beancount.el from https://github.com/beancount/beancount-mode/blob/main/beancount.el and placed it in  ~/.emacs.d folder
5.Created and modified init.el in  ~/.emacs.d to read:
(add-to-list 'load-path /home/"user"/.emacs.d/beancount.el)
(require 'beancount)
(add-to-list 'auto-mode-alist '("\\.beancount\\'" . beancount-mode))
6. Open emacs, enter M-x beancount-mode; I get: [No match]

What would be the best way to get beancount-mode working in emacs?

On another note:
Is beancount.io a recommended service? It looks like a very sleek, comprehensive service. Is anyone from this group involved in it?

Very much appreciate everyone's help and effort to create and maintain this software, and looking forward to the replies.

Gustavo
Reply all
Reply to author
Forward
0 new messages