Thanks for the pointer. This was very helpful. I'm not familiar enough with 
lisp and what I need to do to get it to work for me--currently getting a 
read error when launching emacs.  My ".emacs" file had the following lines 
(now commented out) below that worked fine. I changed to what is "new" 
below based on following that link. Does "straight" code below mean it 
reads the beancount.el file from GitHub directly? Should I read in the 
beancount.el in a different way?

thanks,
Jonathan


OLD
====

;;(add-to-list 'load-path "/Users/jonathan/.emacs.d/lisp/beancount.el")

;;(require 'beancount)

;;(add-to-list 'auto-mode-alist '("\\.beancount\\'" . beancount-mode))


NEW

====

(use-package beancount

  :straight (beancount

             :type git

             :host github

             :repo "cnsunyour/beancount.el")

  :bind

  ("C-M-b" . (lambda ()

               (interactive)

               (find-file 
"/Users/jonathan/Documents/Finances/beandata/beancount/myjournal/accounts.beancount")))

  :mode

  ("\\.bean\\(?:count\\)?\\'" . beancount-mode)

  :config

  (setq beancount-accounts-files

        (directory-files 
"/Users/jonathan/Documents/Finances/beandata/beancount/myjournal/"

                         'full

                         (rx ".beancount" eos))))

On Friday, April 30, 2021 at 11:17:24 AM UTC+12 b...@bben.us wrote:

> Relevant thread: 
> https://groups.google.com/g/beancount/c/QOJInwm1TZ0/m/ggsT1AsyAQAJ
>
> I was using https://github.com/cnsunyour/beancount.el previously to get 
> completion with accounts defined in different files. However I've since 
> merged into one file and am using the official plugin. Daniele mentioned 
> there is support for this in the official plugin but I haven't tried it out 
> myself.
>
> On Thu, Apr 29, 2021 at 4:05 PM Jonathan Goldman <jrgo...@gmail.com> 
> wrote:
>
>> Thanks for confirming what I thought was the case @TRS-80.
>>
>> Yes I want to create a modification to Emacs Lisp code to specify a 
>> specific file to load. In my case I have one file called 
>> "journal.beancount" that loads "accounts.beancount" and then all the 
>> transactions which are organized by real-world accounts. So ideally all I 
>> need to do is load "accounts.beancount" and then when I'm editing any 
>> specific transactions file I have access to type-ahead for any of the 
>> accounts found in accounts.beancount. 
>>
>> I'm not yet comfortable with Emacs Lisp. I'll try to figure it out but if 
>> anyone knows how to do this modification easily that would save me a lot of 
>> time and perhaps be generally useful as I think there are others who split 
>> up their beancount data among multiple files. 
>>
>> Thanks,
>> Jonathan
>>
>> On Fri, Apr 30, 2021 at 7:31 AM TRS-80 <lists....@isnotmyreal.name> 
>> wrote:
>>
>>> On 2021-04-28 07:45, jrgo...@gmail.com wrote:
>>> > 
>>> > Does beancount mode only look within the current document to create an
>>> > index of accounts for possible autocomplete?
>>>
>>> I am pretty sure that beancount-mode only collects from current
>>> buffer.  If you take a look at the function `beancount-insert-account'
>>> it in turn calls `beancount-collect', if you read the docstring for
>>> that function it says:
>>>
>>>    "Return an unique list of REGEXP group N in the current buffer."
>>>
>>> > Is there anyway to modify this to point to another file with all the
>>> > accounts I have? I have a file called "accounts.beancount" that
>>> > contains all the beancount accounts I want to use to populate
>>>
>>> With a little custom Emacs Lisp, anything is possible.  ;)  For
>>> example, I have made my own little custom function to insert any of my
>>> Beancount account names anywhere in any buffer (or insert transfer
>>> transactions involving 2 accounts, and many others).
>>>
>>> > I'm trying to organize my beancount files a bit to more easily
>>> > rollback changes.
>>>
>>> The tool you may be looking for to "rollback changes" is a good text
>>> editor and/or git.  Although some of concepts may be foreign to you at
>>> first if you never did any some sort of development.
>>>
>>> So I suppose the answer (for /you/) depends on how comfortable you are
>>> with Emacs, Emacs Lisp, git, and/or other tools, as there are many
>>> different ways to skin this particular cat.
>>>
>>> Myself (and some others here) are big proponents, users, and lovers of
>>> Emacs, for many different reasons which go far beyond the scope of
>>> this particular issue.  Therefore our solutions involve Emacs.
>>> However that might not be your cup of tea.
>>>
>>> Cheers,
>>> TRS-80
>>>
>>> -- 
>>> 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 on the web visit 
>>> https://groups.google.com/d/msgid/beancount/68aebfe4c176ef7a766d87f086826f58%40isnotmyreal.name
>>> .
>>>
>> -- 
>> 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 on the web visit 
>> https://groups.google.com/d/msgid/beancount/CANUAcYdfE7kjQcyvKfqw7zmXGvis9kUg%2B5mFSwK8OpU3jWOqGQ%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/beancount/CANUAcYdfE7kjQcyvKfqw7zmXGvis9kUg%2B5mFSwK8OpU3jWOqGQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/5c181ecb-6253-41a1-9b6e-9dc75f27aa0cn%40googlegroups.com.

Reply via email to