Re: [emacs] using ledger-mode for beancount

2019-06-03 Thread Daniele Nicolodi
On 02-06-2019 18:26, Martin Blais wrote:
> Another strange thing: when I press ENTER at the end of a line, the
> amount automatically indents itself...
> Personally I find that annoying (especially if there are cases it will
> get it wrong), I think it should be optional.

This behavior is defined by Emacs if the major mode defines
`indent-line-function` which is used to perform the indentation on tab. See

https://www.gnu.org/software/emacs/manual/html_node/elisp/Auto_002dIndentation.html#Auto_002dIndentation)

If you don't like it I think the Emacs way to disable it is to set
`electric-indent-chars` to nil.

I don't think there are cases in which the amount indentation is
computed wrong. Please provide a minimal example if you find any.

Cheers,
Dan

-- 
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/b228b74c-817b-f274-9f51-6e799121cfb1%40grinta.net.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-06-02 Thread Daniele Nicolodi
I just updated the pull request with the fix, unless I messed up fix
mercurial again, I rewrote the history to contain the fix.

On 02/06/2019 19:25, Martin Blais wrote:
> Just add it on top and I'll reimport from scratch
> 
> 
> On Sun, Jun 2, 2019 at 9:17 PM Daniele Nicolodi  > wrote:
> 
> On 02/06/2019 18:32, Daniele Nicolodi wrote:
> > On 02/06/2019 18:24, Martin Blais wrote:
> >> Another issue: The account completion seems broken ; the list of
> account
> >> is in beancount-accounts is empty and I can't insert an account name.
> >
> > That must have broken in the refactoring. I'm on it.
> 
> I indeed forgot to include an hunk in one of the patches. I'm currently
> fighting with `hg histedit`...
> 
> Cheers,
> Dan
> 
> 
> -- 
> 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/CAK21%2BhPoYHFv%2BzhbzJayBAtpefb69d-tSVJMNAgn8CyBrT4pZg%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.

-- 
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/0f9c0a6f-e29f-6ad7-7129-3bad91bb5265%40grinta.net.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-06-02 Thread Daniele Nicolodi
I just noticed that my beancount repository on bitbucket also has two
heads... I need to fix that as well. Apparently `hg push --force` does
not do the same thing as `git push --force`...

On 02/06/2019 19:25, Martin Blais wrote:
> Just add it on top and I'll reimport from scratch
> 
> 
> On Sun, Jun 2, 2019 at 9:17 PM Daniele Nicolodi  > wrote:
> 
> On 02/06/2019 18:32, Daniele Nicolodi wrote:
> > On 02/06/2019 18:24, Martin Blais wrote:
> >> Another issue: The account completion seems broken ; the list of
> account
> >> is in beancount-accounts is empty and I can't insert an account name.
> >
> > That must have broken in the refactoring. I'm on it.
> 
> I indeed forgot to include an hunk in one of the patches. I'm currently
> fighting with `hg histedit`...
> 
> Cheers,
> Dan
> 
> 
> -- 
> 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/CAK21%2BhPoYHFv%2BzhbzJayBAtpefb69d-tSVJMNAgn8CyBrT4pZg%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.

-- 
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/92e8cbf9-2d2e-0b92-94d4-23559990c219%40grinta.net.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-06-02 Thread Martin Blais
Just add it on top and I'll reimport from scratch


On Sun, Jun 2, 2019 at 9:17 PM Daniele Nicolodi  wrote:

> On 02/06/2019 18:32, Daniele Nicolodi wrote:
> > On 02/06/2019 18:24, Martin Blais wrote:
> >> Another issue: The account completion seems broken ; the list of account
> >> is in beancount-accounts is empty and I can't insert an account name.
> >
> > That must have broken in the refactoring. I'm on it.
>
> I indeed forgot to include an hunk in one of the patches. I'm currently
> fighting with `hg histedit`...
>
> Cheers,
> Dan
>
>
>

-- 
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/CAK21%2BhPoYHFv%2BzhbzJayBAtpefb69d-tSVJMNAgn8CyBrT4pZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-06-02 Thread Daniele Nicolodi
On 02/06/2019 18:32, Daniele Nicolodi wrote:
> On 02/06/2019 18:24, Martin Blais wrote:
>> Another issue: The account completion seems broken ; the list of account
>> is in beancount-accounts is empty and I can't insert an account name.
> 
> That must have broken in the refactoring. I'm on it.

I indeed forgot to include an hunk in one of the patches. I'm currently
fighting with `hg histedit`...

Cheers,
Dan


-- 
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/144375c9-7a96-97ff-43ec-f13847cb921c%40grinta.net.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-06-02 Thread Daniele Nicolodi
On 02/06/2019 18:24, Martin Blais wrote:
> Another issue: The account completion seems broken ; the list of account
> is in beancount-accounts is empty and I can't insert an account name.

That must have broken in the refactoring. I'm on it

Cheers,
Dan

-- 
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/45461968-c62c-1b4f-adb5-1c1ac25a7357%40grinta.net.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-06-02 Thread Martin Blais
Another strange thing: when I press ENTER at the end of a line, the amount
automatically indents itself...
Personally I find that annoying (especially if there are cases it will get
it wrong), I think it should be optional.


On Sun, Jun 2, 2019 at 8:24 PM Martin Blais  wrote:

> Another issue: The account completion seems broken ; the list of account
> is in beancount-accounts is empty and I can't insert an account name.
>
>
> On Sun, Jun 2, 2019 at 8:10 PM Martin Blais  wrote:
>
>> On Sun, Jun 2, 2019 at 7:05 PM Daniele Nicolodi 
>> wrote:
>>
>>> On 02/06/2019 16:16, Martin Blais wrote:
>>> > Thanks Dan,
>>> > I fixed most of the issues I had with these changes:
>>>
>>> Nice! Which issues do remain?
>>>
>>
>> Give me a few days to run this myself and see if I encounter anything,
>> then I'll merge.
>>
>> Just the font-locking on the section headings would be super nice to
>> have, but it's not absolutely necessary.
>>
>>
>>> > (require 'beancount)
>>> > (setq beancount-outline-regexp "\\*+ ")
>>>
>>> Yeah, I forgot to escape the * in the regexp...
>>>
>>> > (define-key* beancount-mode-map [(control c)(control n)]
>>> > 'outline-next-visible-heading)
>>> > (define-key* beancount-mode-map [(control c)(control p)]
>>> > 'outline-previous-visible-heading)
>>>
>>> I'm hesitating to add those binding to to beancount.el as I would need
>>> to find a way to make that conditional to having outline-minor-mode
>>> loaded. What do you think?
>>>
>>
>> No need to; I and others can just add them locally in our configs if
>> desired.
>>
>>
>>
>>>
>>> > (add-hook 'beancount-mode-hook 'outline-minor-mode)
>>> >
>>> >
>>> > I have a question. Is there a way to bring back the font-lock coloring
>>> > for the outline headings?
>>> > With or-mode their distinguished color made it really salient which
>>> > level they're at.
>>> > I'm seeing them all white.
>>>
>>> I don't think outline-minor-mode provides fontification for headings.
>>> But it should not be hard to add it. I'll look into this.
>>>
>>
>> Please, that visual  really makes it clear.
>> But it's not an absolute must.
>>
>> Thank you for this, give me a bit of time and I'll merge this for sure.
>>
>>
>>
>>
>>>
>>> Cheers,
>>> Dan
>>>
>>> --
>>> 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/3ff25066-b8eb-cc4e-5b60-ed745c4ce8a1%40grinta.net
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
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/CAK21%2BhOw8n5iUFdMatbzjF1J3r54y9hF7ynWP05N6x2KCVk%3DKQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-06-02 Thread Martin Blais
Another issue: The account completion seems broken ; the list of account is
in beancount-accounts is empty and I can't insert an account name.


On Sun, Jun 2, 2019 at 8:10 PM Martin Blais  wrote:

> On Sun, Jun 2, 2019 at 7:05 PM Daniele Nicolodi 
> wrote:
>
>> On 02/06/2019 16:16, Martin Blais wrote:
>> > Thanks Dan,
>> > I fixed most of the issues I had with these changes:
>>
>> Nice! Which issues do remain?
>>
>
> Give me a few days to run this myself and see if I encounter anything,
> then I'll merge.
>
> Just the font-locking on the section headings would be super nice to have,
> but it's not absolutely necessary.
>
>
>> > (require 'beancount)
>> > (setq beancount-outline-regexp "\\*+ ")
>>
>> Yeah, I forgot to escape the * in the regexp...
>>
>> > (define-key* beancount-mode-map [(control c)(control n)]
>> > 'outline-next-visible-heading)
>> > (define-key* beancount-mode-map [(control c)(control p)]
>> > 'outline-previous-visible-heading)
>>
>> I'm hesitating to add those binding to to beancount.el as I would need
>> to find a way to make that conditional to having outline-minor-mode
>> loaded. What do you think?
>>
>
> No need to; I and others can just add them locally in our configs if
> desired.
>
>
>
>>
>> > (add-hook 'beancount-mode-hook 'outline-minor-mode)
>> >
>> >
>> > I have a question. Is there a way to bring back the font-lock coloring
>> > for the outline headings?
>> > With or-mode their distinguished color made it really salient which
>> > level they're at.
>> > I'm seeing them all white.
>>
>> I don't think outline-minor-mode provides fontification for headings.
>> But it should not be hard to add it. I'll look into this.
>>
>
> Please, that visual  really makes it clear.
> But it's not an absolute must.
>
> Thank you for this, give me a bit of time and I'll merge this for sure.
>
>
>
>
>>
>> Cheers,
>> Dan
>>
>> --
>> 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/3ff25066-b8eb-cc4e-5b60-ed745c4ce8a1%40grinta.net
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/CAK21%2BhMm4oRax5gKhJ%3DfjfGbe3T9w%2BugXCihwJvCLyUYnSQMQw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-06-02 Thread Martin Blais
On Sun, Jun 2, 2019 at 7:05 PM Daniele Nicolodi  wrote:

> On 02/06/2019 16:16, Martin Blais wrote:
> > Thanks Dan,
> > I fixed most of the issues I had with these changes:
>
> Nice! Which issues do remain?
>

Give me a few days to run this myself and see if I encounter anything, then
I'll merge.

Just the font-locking on the section headings would be super nice to have,
but it's not absolutely necessary.


> > (require 'beancount)
> > (setq beancount-outline-regexp "\\*+ ")
>
> Yeah, I forgot to escape the * in the regexp...
>
> > (define-key* beancount-mode-map [(control c)(control n)]
> > 'outline-next-visible-heading)
> > (define-key* beancount-mode-map [(control c)(control p)]
> > 'outline-previous-visible-heading)
>
> I'm hesitating to add those binding to to beancount.el as I would need
> to find a way to make that conditional to having outline-minor-mode
> loaded. What do you think?
>

No need to; I and others can just add them locally in our configs if
desired.



>
> > (add-hook 'beancount-mode-hook 'outline-minor-mode)
> >
> >
> > I have a question. Is there a way to bring back the font-lock coloring
> > for the outline headings?
> > With or-mode their distinguished color made it really salient which
> > level they're at.
> > I'm seeing them all white.
>
> I don't think outline-minor-mode provides fontification for headings.
> But it should not be hard to add it. I'll look into this.
>

Please, that visual  really makes it clear.
But it's not an absolute must.

Thank you for this, give me a bit of time and I'll merge this for sure.




>
> Cheers,
> Dan
>
> --
> 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/3ff25066-b8eb-cc4e-5b60-ed745c4ce8a1%40grinta.net
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAK21%2BhP0YGiV%2B%3DGmo3uPHsWRZqQCkiaUBwsOpQWK8irSivqG9w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-06-02 Thread Daniele Nicolodi
On 02/06/2019 16:16, Martin Blais wrote:
> Thanks Dan,
> I fixed most of the issues I had with these changes:

Nice! Which issues do remain?

> (require 'beancount)
> (setq beancount-outline-regexp "\\*+ ")

Yeah, I forgot to escape the * in the regexp...

> (define-key* beancount-mode-map [(control c)(control n)]
> 'outline-next-visible-heading)
> (define-key* beancount-mode-map [(control c)(control p)]
> 'outline-previous-visible-heading)

I'm hesitating to add those binding to to beancount.el as I would need
to find a way to make that conditional to having outline-minor-mode
loaded. What do you think?

> (add-hook 'beancount-mode-hook 'outline-minor-mode)
> 
> 
> I have a question. Is there a way to bring back the font-lock coloring
> for the outline headings?
> With or-mode their distinguished color made it really salient which
> level they're at.
> I'm seeing them all white.

I don't think outline-minor-mode provides fontification for headings.
But it should not be hard to add it. I'll look into this.

Cheers,
Dan

-- 
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/3ff25066-b8eb-cc4e-5b60-ed745c4ce8a1%40grinta.net.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-06-02 Thread Martin Blais
Thanks Dan,
I fixed most of the issues I had with these changes:

(require 'beancount)
(setq beancount-outline-regexp "\\*+ ")
(define-key* beancount-mode-map [(control c)(control n)]
'outline-next-visible-heading)
(define-key* beancount-mode-map [(control c)(control p)]
'outline-previous-visible-heading)
(add-hook 'beancount-mode-hook 'outline-minor-mode)


I have a question. Is there a way to bring back the font-lock coloring for
the outline headings?
With or-mode their distinguished color made it really salient which level
they're at.
I'm seeing them all white.





On Sun, Jun 2, 2019 at 5:52 PM Daniele Nicolodi  wrote:

> On 02/06/2019 15:39, Martin Blais wrote:
> > Also, TAB seems not to work as previously; with org-mode I used to be
> > able to toggle this way.
> > Now TAB invokes completion.
> >
> > Do you have a config setup I could try that keeps the bindings close to
> > what they used to be, at least for tab and moving between sections?
> > I'd like to merge this, but I have little time to debug.
>
> Hi Martin,
>
> thank you for testing!
>
> Basic outline functionality works for me, but I realized that I tested
> it only using three or more semicolons (";;;") as the section marker. I
> slightly prefer this syntax because the section headings are fontified
> as comments.
>
> However, I just tried with the org-mode syntax and indeed it does not
> work. There a regular expression to fix. It should not take long.
>
> As for the bindings, once this is fixed TAB will do the right thing:
> section folding if the point is on a section header, or completion
> otherwise.  What keybinding do you expect to work for moving between the
> sections? Those are defined by outline mode and are different from the
> ones used by org-mode.
>
> Cheers,
> Dan
>

-- 
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/CAK21%2BhN9SkH3DqjFaTJ1ouid-f3U_98Mpby_%2B3OmVn4nsQWyvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-06-02 Thread Daniele Nicolodi
On 02/06/2019 15:39, Martin Blais wrote:
> Also, TAB seems not to work as previously; with org-mode I used to be
> able to toggle this way.
> Now TAB invokes completion.
> 
> Do you have a config setup I could try that keeps the bindings close to
> what they used to be, at least for tab and moving between sections?
> I'd like to merge this, but I have little time to debug.

Hi Martin,

thank you for testing!

Basic outline functionality works for me, but I realized that I tested
it only using three or more semicolons (";;;") as the section marker. I
slightly prefer this syntax because the section headings are fontified
as comments.

However, I just tried with the org-mode syntax and indeed it does not
work. There a regular expression to fix. It should not take long.

As for the bindings, once this is fixed TAB will do the right thing:
section folding if the point is on a section header, or completion
otherwise.  What keybinding do you expect to work for moving between the
sections? Those are defined by outline mode and are different from the
ones used by org-mode.

Cheers,
Dan

-- 
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/9304b701-3db4-d848-c095-331a85eac234%40grinta.net.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-06-02 Thread Martin Blais
Just spent a half-hour trying to get outline-minor-mode with it, I can't
get the basics to work.
I keep getting this error:
outline-back-to-heading: Before first heading




On Sat, Jun 1, 2019 at 9:20 PM Martin Blais  wrote:

> Yes, just need a bit of time to review and test out the CL.
> Maybe Tomorrow.
> (Limited cycles.)
>
>
>
> On Sat, Jun 1, 2019 at 8:20 PM Daniele Nicolodi 
> wrote:
>
>> On 19/05/2019 17:45, Daniele Nicolodi wrote:
>> > On 31/03/2019 06:15, Stefano Zacchiroli wrote:
>> >> On Sun, Mar 17, 2019 at 05:41:16PM -0600, Daniele Nicolodi wrote:
>> >>> I would like to upstream my changes, however, now that I know how I
>> >>> would like the code to look like at the end, I would need to break up
>> >>> my changes in a patchset and submit if for inclusion. This would
>> >>> require some time investment. I haven't seen any interested from
>> >>> Martin about those changes, thus am I reluctant to put that last bit
>> >>> of work in.
>> >>
>> >> Martin: can you comment on this?
>> >
>> > I have now cleaned up my changes in reviewable patches and submitted a
>> > pull request:
>> >
>> >
>> https://bitbucket.org/blais/beancount/pull-requests/115/revamp-beancountel/diff
>>
>> Martin,
>>
>> do you still have interested in beancount-mode?  I'm happy to move
>> beancount-mode to another repository if you are not.
>>
>> Thank you in advance.
>>
>> Best,
>> Dan
>>
>

-- 
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/CAK21%2BhMXfEL_On4HEOGfnHbVVrBfVX61k%3DB1f3rMuTOQ059O8g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-06-01 Thread Martin Blais
Yes, just need a bit of time to review and test out the CL.
Maybe Tomorrow.
(Limited cycles.)



On Sat, Jun 1, 2019 at 8:20 PM Daniele Nicolodi  wrote:

> On 19/05/2019 17:45, Daniele Nicolodi wrote:
> > On 31/03/2019 06:15, Stefano Zacchiroli wrote:
> >> On Sun, Mar 17, 2019 at 05:41:16PM -0600, Daniele Nicolodi wrote:
> >>> I would like to upstream my changes, however, now that I know how I
> >>> would like the code to look like at the end, I would need to break up
> >>> my changes in a patchset and submit if for inclusion. This would
> >>> require some time investment. I haven't seen any interested from
> >>> Martin about those changes, thus am I reluctant to put that last bit
> >>> of work in.
> >>
> >> Martin: can you comment on this?
> >
> > I have now cleaned up my changes in reviewable patches and submitted a
> > pull request:
> >
> >
> https://bitbucket.org/blais/beancount/pull-requests/115/revamp-beancountel/diff
>
> Martin,
>
> do you still have interested in beancount-mode?  I'm happy to move
> beancount-mode to another repository if you are not.
>
> Thank you in advance.
>
> Best,
> Dan
>

-- 
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/CAK21%2BhNw1kU4%2BhszpYRDXfAzfoU0zk3qny3-jHTUfj4Y_wpRag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-06-01 Thread Daniele Nicolodi
On 19/05/2019 17:45, Daniele Nicolodi wrote:
> On 31/03/2019 06:15, Stefano Zacchiroli wrote:
>> On Sun, Mar 17, 2019 at 05:41:16PM -0600, Daniele Nicolodi wrote:
>>> I would like to upstream my changes, however, now that I know how I
>>> would like the code to look like at the end, I would need to break up
>>> my changes in a patchset and submit if for inclusion. This would
>>> require some time investment. I haven't seen any interested from
>>> Martin about those changes, thus am I reluctant to put that last bit
>>> of work in.
>>
>> Martin: can you comment on this?
> 
> I have now cleaned up my changes in reviewable patches and submitted a
> pull request:
> 
> https://bitbucket.org/blais/beancount/pull-requests/115/revamp-beancountel/diff

Martin,

do you still have interested in beancount-mode?  I'm happy to move
beancount-mode to another repository if you are not.

Thank you in advance.

Best,
Dan

-- 
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/083a027f-a271-78b3-b78c-b5e4d79c9383%40grinta.net.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-05-22 Thread Daniele Nicolodi
On 22-05-2019 06:31, micah anderson wrote:
> Daniele Nicolodi  writes:
> 
>> On 31/03/2019 06:15, Stefano Zacchiroli wrote:
>>> On Sun, Mar 17, 2019 at 05:41:16PM -0600, Daniele Nicolodi wrote:
 I would like to upstream my changes, however, now that I know how I
 would like the code to look like at the end, I would need to break up
 my changes in a patchset and submit if for inclusion. This would
 require some time investment. I haven't seen any interested from
 Martin about those changes, thus am I reluctant to put that last bit
 of work in.
>>>
>>> Martin: can you comment on this?
>>
>> I have now cleaned up my changes in reviewable patches and submitted a
>> pull request:
>>
>> https://bitbucket.org/blais/beancount/pull-requests/115/revamp-beancountel/diff
>>
>> I hope I didn't break anything is the process of rewriting the commit
>> history. Please test and let me know.
> 
> Thanks for doing this! I find this to be vastly superior to the built-in
> mode, and would love to see this integrated into beancount proper!

Thank you for testing, Micah.

I would love to receiver feedback on how benacount-mode could be further
improved. In particular I would like to have input on standard emacs
functions that would make sense to map in beancount-mode. For example, I
set fill-paragraph-function to a function that indents the transaction
at point such that fill-paragraph (M-q) does something sensible [1]. Are
there any other standard facilities that could be implemented?

Cheers,
Dan

[1] Unfortunately there is a bug in the code that I pushed for the pull
request, so this does not work right now. I'll push the trivial fix
later tonight.

-- 
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/f78dc955-5346-a73d-d705-5ee3fe5e9367%40grinta.net.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-05-22 Thread micah anderson
Daniele Nicolodi  writes:

> On 31/03/2019 06:15, Stefano Zacchiroli wrote:
>> On Sun, Mar 17, 2019 at 05:41:16PM -0600, Daniele Nicolodi wrote:
>>> I would like to upstream my changes, however, now that I know how I
>>> would like the code to look like at the end, I would need to break up
>>> my changes in a patchset and submit if for inclusion. This would
>>> require some time investment. I haven't seen any interested from
>>> Martin about those changes, thus am I reluctant to put that last bit
>>> of work in.
>> 
>> Martin: can you comment on this?
>
> I have now cleaned up my changes in reviewable patches and submitted a
> pull request:
>
> https://bitbucket.org/blais/beancount/pull-requests/115/revamp-beancountel/diff
>
> I hope I didn't break anything is the process of rewriting the commit
> history. Please test and let me know.

Thanks for doing this! I find this to be vastly superior to the built-in
mode, and would love to see this integrated into beancount proper!

-- 
micah

-- 
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/87lfyyn00v.fsf%40riseup.net.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-05-19 Thread Daniele Nicolodi
On 31/03/2019 06:15, Stefano Zacchiroli wrote:
> On Sun, Mar 17, 2019 at 05:41:16PM -0600, Daniele Nicolodi wrote:
>> I would like to upstream my changes, however, now that I know how I
>> would like the code to look like at the end, I would need to break up
>> my changes in a patchset and submit if for inclusion. This would
>> require some time investment. I haven't seen any interested from
>> Martin about those changes, thus am I reluctant to put that last bit
>> of work in.
> 
> Martin: can you comment on this?

I have now cleaned up my changes in reviewable patches and submitted a
pull request:

https://bitbucket.org/blais/beancount/pull-requests/115/revamp-beancountel/diff

I hope I didn't break anything is the process of rewriting the commit
history. Please test and let me know.

Cheers,
Dan

-- 
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/d84d7850-4d5d-b4fd-3935-2c9292fcdbfc%40grinta.net.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-03-31 Thread Josh Slater
Just wanted to chime in that I’ve been using ledger-mode with outline mode for 
folding on top of beancount files and it works well enough for me, with some of 
the caveats in this thread. Would welcome a beancount major mode!

-- 
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/9dfd3456-2b7c-4723-a219-8065cfd0a4df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-03-31 Thread Stefano Zacchiroli
On Sun, Mar 17, 2019 at 05:41:16PM -0600, Daniele Nicolodi wrote:
> I would like to upstream my changes, however, now that I know how I
> would like the code to look like at the end, I would need to break up
> my changes in a patchset and submit if for inclusion. This would
> require some time investment. I haven't seen any interested from
> Martin about those changes, thus am I reluctant to put that last bit
> of work in.

Martin: can you comment on this?

Many thanks in advance,
Cheers
-- 
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/20190331121529.mld6za2i22fijp2r%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-03-17 Thread Stefan Monnier
> I would like to upstream my changes, however, now that I know how I
> would like the code to look like at the end, I would need to break up my
> changes in a patchset and submit if for inclusion. This would require
> some time investment. I haven't seen any interested from Martin about
> those changes, thus am I reluctant to put that last bit of work in.

Please please pretty please,


Stefan

-- 
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/jwv1s350ymo.fsf-monnier%2Bgmane.comp.finance.beancount%40gnu.org.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-03-17 Thread Daniele Nicolodi
On 17/03/2019 14:17, Stefano Zacchiroli wrote:
> On Sun, Jan 20, 2019 at 07:36:13PM -0700, Daniele Nicolodi wrote:
>> Please test and let me know.
> 
> I understand it's embarrassingly late to get back to you with feedback,
> but I only got around playing with the changes you described now. The
> good news is that they are all great, and work perfectly for me :-)
> 
> Thanks a lot!
> 
> Any plan to upstream this now? It all feels pretty solid.

Hi Stefano,

you are not late at all with your feedback, I haven't found any time to
continue working on this since my last messages to the list.

I would like to upstream my changes, however, now that I know how I
would like the code to look like at the end, I would need to break up my
changes in a patchset and submit if for inclusion. This would require
some time investment. I haven't seen any interested from Martin about
those changes, thus am I reluctant to put that last bit of work in.

Cheers,
Dan

-- 
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/a514a7aa-6a3d-4c61-6603-b547556d60d5%40grinta.net.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-23 Thread Daniele Nicolodi
On 23/01/2019 11:40, Stefan Monnier wrote:
>> problem you were seeing. What I would like to do now is to get rid of
>> the need for beancount-init-accounts
> 
> Yes, please.
> 
>> but I am afraid completion would slow down considerably in very
>> large buffers.
> 
> If needed, judicious use of caching should do the trick.

Do you have any hint on how this would look like? Pointers to code
implementing something similar would be perfect.

Thank you.

Cheers,
Dan

-- 
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/dfa85a8e-946a-7ba5-8740-be58201fb71d%40grinta.net.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-23 Thread Stefan Monnier
> problem you were seeing. What I would like to do now is to get rid of
> the need for beancount-init-accounts

Yes, please.

> but I am afraid completion would slow down considerably in very
> large buffers.

If needed, judicious use of caching should do the trick.


Stefan

-- 
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/jwvy37bmd5z.fsf-monnier%2Bgmane.comp.finance.beancount%40gnu.org.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-20 Thread Daniele Nicolodi
On 20/01/2019 19:36, Daniele Nicolodi wrote:
> I changed the customization variable names to
> 
> beancount-transaction-indent
> beancount-number-alignment-column
> 
> which seem more descriptive (and a bit shorter).

I forgot to mention that to obtain automatic alignment column
determination now beancount-number-alignment-column should be set to 0
instead than nil. This is a bit easier for the customize interface.

Cheers,
Dan

-- 
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/e0e893fa-146f-6de5-bec4-4d4a1e05565e%40grinta.net.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-20 Thread Daniele Nicolodi
Hi Stefano,

I just commit another round of updated.

On 20/01/2019 09:26, Stefano Zacchiroli wrote:
> On Sat, Jan 19, 2019 at 10:59:36PM -0700, Daniele Nicolodi wrote:
> 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.

Now you can use a prefix argument to align everything. I realized that
automatic alignment does not do the right thing if there are posting
metadata. This remains to be fixed.

>> 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.

I changed the customization variable names to

beancount-transaction-indent
beancount-number-alignment-column

which seem more descriptive (and a bit shorter).

I reworked completion-at-point extensively, and I think I fixed the
problem you were seeing. What I would like to do now is to get rid of
the need for beancount-init-accounts but I am afraid completion would
slow down considerably in very large buffers. On the other hand,
completion for tags does not use any caching and I haven't seen
complaints about it.

Please test and let me know.

Cheers,
Dan

-- 
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/cd6c829a-f330-083c-9017-c9dfb50ca1c9%40grinta.net.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-20 Thread Stefano Zacchiroli
On Sun, Jan 20, 2019 at 09:32:24AM -0700, Daniele Nicolodi wrote:
> (setq beancount-posting-alignment-column 4)

Nice :-)

-- 
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/20190120164800.xpqczk2tnirfqhhp%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-20 Thread Daniele Nicolodi
On 20/01/2019 09:26, Stefano Zacchiroli wrote:
> 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.

It is already there:

(setq beancount-posting-alignment-column 4)

Ciao,
Dan

-- 
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/51ff28d4-f2fe-73b9-bacd-ecc0f2296418%40grinta.net.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-20 Thread Stefano Zacchiroli
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.


Re: [emacs] using ledger-mode for beancount

2019-01-19 Thread Daniele Nicolodi
Ciao Stefano,

On 04/01/2019 06:25, Stefano Zacchiroli wrote:
>> Which functionalities do you miss the most in beancount-mode?
> 
> - number alignment: I'm missing ledger-mode's equivalent of C-c C-q.
>   beancount-align-numbers is supposed to do that (well, I guess), but:
> 
>   - it doesn't work on the current transaction by default, you have to
> select it as a region first, which is time consuming; and
> 
>   - is inconsistent across transactions: if you align numbers in
> separate transactions your ledger will "wiggle" horizontally
> 
>   there is bean-format for that, so I can use it and remap C-c C-q to
>   pipe the current transaction to it as an external filter, but it's
>   weird that such a basic function doesn't work out of the box so I
>   think I'm missing something

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.

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.

Please test and let me know.

Cheers,
Dan

-- 
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/f670ecd6-ea28-b8cc-97c7-77cbf524cf87%40grinta.net.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-19 Thread Júlio Maranhão
On Friday, 18 January 2019 21:10:44 UTC-2, Daniele Nicolodi wrote:
> orgstruct-mode has been deprecated and removed from org 9.2. I tried 
> outshine https://github.com/alphapapa/outshine ...

Indeed, the org 9.2 relnotes (https://orgmode.org/Changes.html) tells 
"OrgStruct minor mode and radio lists mechanism (org-list-send-list and 
org-list-radio-lists-templates) are removed from the code base.". They also 
recommend outshine (MELPA) and orgalist (GNU ELPA) as replacements, 
respectively. So thank you for pointing this out.

I use org-plus-contrib package from Org ELPA and I still can use orgstruct. 
I'm very lazy to learn the reason. If orgstruct is dropped from 
org-plus-contrib I will for sure note it and I'll inform here.

Júlio

-- 
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/9ca633ae-d601-4ad2-944e-ae3599588809%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-19 Thread Daniele Nicolodi
Ciao Stefano,

On 19/01/2019 09:09, Stefano Zacchiroli wrote:
> Account completion works perfectly for me now. Ditto for indentation.
> 
> The only glitch I've noticed is in the interaction between the two.
> Consider the case of a badly indented line: you hit TAB on it and it
> gets properly indented, if you hit TAB *again*, it will most often
> triggers account completion (e.g., when you're on a account line),
> generally overwriting the previous account name, which is generally not
> what you want.
> 
> I've compared with the ledger-mode UX, and I think the key difference is
> that in ledger-mode account completion is triggered only when the cursor
> is at the end of the account name, not when it is anywhere else on an
> account line. I haven't checked how that is actually detected in the
> implementation though. I think it would make sense to do the same in
> beancount-mode.

I see the problem. Fixing this requires revisiting the beancount
completion function. It should not be difficult, but I don't know how it
is desirable to preserve the existing behavior.

I adjusted postings amount alignment to work similarly to how it works
in ledger-mode. However, I don't know if there is anyone relaying on the
current behavior, so I don't know if modifying it is a good idea.

Cheers,
Dan

-- 
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/4ac81d47-0216-a366-a0a5-d89db7f5be73%40grinta.net.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-19 Thread Stefano Zacchiroli
Ciao Daniele,

On Thu, Jan 17, 2019 at 04:19:14PM -0700, Daniele Nicolodi wrote:
> I found some time to hack on beancount-mode. You can find the progress
> here
> https://bitbucket.org/daniele/beancount/src/default/editors/emacs/beancount.el

great work! thanks a lot for this, more detailed feedback below.

> On 04/01/2019 06:25, Stefano Zacchiroli wrote:
> > - completion: I'm not sure how that is supposed to work. beancount-tab
> >   as a function works well for accounts and tags (but not metadata
> >   key/values, apparently), but if I bind it to TAB I lose indentation,
> >   whereas in ledger-mode the two seems to work well together. Maybe I'm
> >   not using it right
> > 
> > - indentation: as above, is there a function to auto-indent the first
> >   character of the current line at the right column that I'm not
> >   finding? in ledger-mode that's TAB, similarly to what happens with
> >   most other major modes for programming languages
> 
> Those two points have been fixed following Stefan advice. It works for
> me using fundamental-mode as major mode. I haven't implemented
> completion of metadata yet.

Account completion works perfectly for me now. Ditto for indentation.

The only glitch I've noticed is in the interaction between the two.
Consider the case of a badly indented line: you hit TAB on it and it
gets properly indented, if you hit TAB *again*, it will most often
triggers account completion (e.g., when you're on a account line),
generally overwriting the previous account name, which is generally not
what you want.

I've compared with the ledger-mode UX, and I think the key difference is
that in ledger-mode account completion is triggered only when the cursor
is at the end of the account name, not when it is anywhere else on an
account line. I haven't checked how that is actually detected in the
implementation though. I think it would make sense to do the same in
beancount-mode.

> > - highlighting: there's no highlighting of the current entry (usually a
> >   transaction), arguably a very minor point, but annoying when you're
> >   editing transactions with many postings/tags/metadata
> 
> This was easy to implement. You need something like
> 
> (setq beancount-highlight-transaction-at-point t)

This works perfectly.

Thanks a lot Daniele!,
hope this feedback helps,
Cheers
-- 
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/20190119160905.ghll7axvsdlgjn2k%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-18 Thread Daniele Nicolodi
Hello,

orgstruct-mode has been deprecated and removed from org 9.2.  I tried
outshine https://github.com/alphapapa/outshine and it works fine on a
fundamental-mode + beancount-mode buffer, it just requires headlines to
be written prefixed by four semicolons, as

 * Foo
 ** Bar

I think that can be tweaked. I also found a bug regarding the prmotion
and demotion of headlines. outshine is in active development and I think
those problems can be quickly fixed.

Cheers,
Dan


On 11/01/2019 02:22, Martin Blais wrote:
> That seems like a useful thing to investigate.
> I personally would welcome making Beancount a major mode if that
> interacts well with it and it serves most people.
> It seems to be the most intuitive way for most people.
> I only ever use org-mode major + beancount minor myself.
> If I recall, Stefan once made a case that it ought to be a major mode
> (over a dinner heavy on raclette cheese some years ago, if my memory
> serves).
> 
> What major mode do people use, and would anyone object strongly and if
> so why?
> 
> 
> 
> 
> On Thu, Jan 10, 2019 at 5:49 AM Júlio Maranhão  > wrote:
> 
> On Sunday, 6 January 2019 18:43:46 UTC-2, Martin Blais wrote:
> 
> Is there a way to have basic org functionality (folding) with it
> as a major mode?  If so happy to convert
> 
> 
> Yes. It's called orgstruct-mode or orgstruct++-mode
> (https://orgmode.org/manual/Orgstruct-mode.html). I use it because I
> also don't like to associate a beancount file with org. For
> instance, I don't like my yas snippets mixed with org snippets.
> Indeed this is an old emacs issue about major (only one per buffer)
> vs minor modes (many per buffer). Just see web development with
> emacs: an html file can embbed html, css, javascript, php, etc.
> There are many solutions, no one prevalent. But I would like to see
> a beancount major-mode. I think it deserves.
> 
> P.S.: I'll made another topic about my opinions regarding general
> beancount development, design, etc. Don't want to mix here.
> 
> -- 
> 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/4cb40f6a-6ea0-49aa-92e8-bf5a0801ca6a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> 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/CAK21%2BhO6wR2tmwP%2BpFjytXDx0c9LTv0SjmieQTm8evpoi5Yfww%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.

-- 
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/76170abb-760d-a171-6461-b49186325669%40grinta.net.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-17 Thread Daniele Nicolodi
Hi Stefano,

I found some time to hack on beancount-mode. You can find the progress
here
https://bitbucket.org/daniele/beancount/src/default/editors/emacs/beancount.el
(unfortunately I botched the split of my changes in independent patches,
I'll probably rewrite history at some point)

I significantly reworked fontification and I think I solved some of your
complaints below. Please test the changes and let me know.

On 04/01/2019 06:25, Stefano Zacchiroli wrote:
> - completion: I'm not sure how that is supposed to work. beancount-tab
>   as a function works well for accounts and tags (but not metadata
>   key/values, apparently), but if I bind it to TAB I lose indentation,
>   whereas in ledger-mode the two seems to work well together. Maybe I'm
>   not using it right
> 
> - indentation: as above, is there a function to auto-indent the first
>   character of the current line at the right column that I'm not
>   finding? in ledger-mode that's TAB, similarly to what happens with
>   most other major modes for programming languages

Those two points have been fixed following Stefan advice. It works for
me using fundamental-mode as major mode. I haven't implemented
completion of metadata yet.

> - number alignment: I'm missing ledger-mode's equivalent of C-c C-q.
>   beancount-align-numbers is supposed to do that (well, I guess), but:
> 
>   - it doesn't work on the current transaction by default, you have to
> select it as a region first, which is time consuming; and
> 
>   - is inconsistent across transactions: if you align numbers in
> separate transactions your ledger will "wiggle" horizontally
> 
>   there is bean-format for that, so I can use it and remap C-c C-q to
>   pipe the current transaction to it as an external filter, but it's
>   weird that such a basic function doesn't work out of the box so I
>   think I'm missing something

I haven't worked on this.

> - highlighting: there's no highlighting of the current entry (usually a
>   transaction), arguably a very minor point, but annoying when you're
>   editing transactions with many postings/tags/metadata

This was easy to implement. You need something like

(setq beancount-highlight-transaction-at-point t)

to enable it.

Cheers,
Dan

-- 
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/b8b32542-93ab-b3a1-27bc-1f670f605789%40grinta.net.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-14 Thread Júlio Maranhão
On Friday, 11 January 2019 07:22:51 UTC-2, Martin Blais wrote:
>
> That seems like a useful thing to investigate.
> I personally would welcome making Beancount a major mode if that interacts 
> well with it and it serves most people.
> It seems to be the most intuitive way for most people.
> I only ever use org-mode major + beancount minor myself.
> If I recall, Stefan once made a case that it ought to be a major mode 
> (over a dinner heavy on raclette cheese some years ago, if my memory 
> serves).
>
> What major mode do people use, and would anyone object strongly and if so 
> why?
>

Major-mode = text-mode (just because I don't use it for anything else. It's 
my fake major-beancount.)
Minor-modes = beancount, orgstruct, yasnippet, company.

I also customized alignment rules (emacs built-in) for text-mode. I am 
actually learning some bits. The fact is I have other priorities than 
dealing with elisp code. And actually I would be happier if you (Blais) 
continue to focus on beancount (not for emacs) or fava. I see a lot of work 
for 2019: close issues or shrink/update documentation :-) or make 
enhancements, for instance. I think beancount deserves a major-mode for 
emacs BUT please, don't waste your time. I can survive with notepad if 
needed (it's not) and anyone are free to choose an editor (Sublime, 
Notepad++, VSCode, ...). If you pay attention only to emacs you'll never 
reach 100% "customer satisfaction". So please only do for you. 

Júlio

-- 
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/f83027b1-35b4-4e93-b100-c2dd6980743f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-14 Thread Steve Harmer
I use it the same way you do (org-mode major + bean count minor).   As long 
as the same/similar folding of headlines is available then I wouldn't mind 
(not that I matter, just giving you a data point.)  For me, org-mode + 
beancount works perfectly.

Thanks for the awesome tool.  


On Friday, January 11, 2019 at 4:22:51 AM UTC-5, Martin Blais wrote:
>
> That seems like a useful thing to investigate.
> I personally would welcome making Beancount a major mode if that interacts 
> well with it and it serves most people.
> It seems to be the most intuitive way for most people.
> I only ever use org-mode major + beancount minor myself.
> If I recall, Stefan once made a case that it ought to be a major mode 
> (over a dinner heavy on raclette cheese some years ago, if my memory 
> serves).
>
> What major mode do people use, and would anyone object strongly and if so 
> why?
>
>
>
>
> On Thu, Jan 10, 2019 at 5:49 AM Júlio Maranhão  > wrote:
>
>> On Sunday, 6 January 2019 18:43:46 UTC-2, Martin Blais wrote:
>>>
>>> Is there a way to have basic org functionality (folding) with it as a 
>>> major mode?  If so happy to convert
>>>
>>
>> Yes. It's called orgstruct-mode or orgstruct++-mode (
>> https://orgmode.org/manual/Orgstruct-mode.html). I use it because I also 
>> don't like to associate a beancount file with org. For instance, I don't 
>> like my yas snippets mixed with org snippets. Indeed this is an old emacs 
>> issue about major (only one per buffer) vs minor modes (many per buffer). 
>> Just see web development with emacs: an html file can embbed html, css, 
>> javascript, php, etc. There are many solutions, no one prevalent. But I 
>> would like to see a beancount major-mode. I think it deserves.
>>
>> P.S.: I'll made another topic about my opinions regarding general 
>> beancount development, design, etc. Don't want to mix here.
>>
>> -- 
>> 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 post to this group, send email to bean...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/beancount/4cb40f6a-6ea0-49aa-92e8-bf5a0801ca6a%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/1916946c-693b-4877-a50c-0ed18f6865c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-11 Thread Martin Blais
That seems like a useful thing to investigate.
I personally would welcome making Beancount a major mode if that interacts
well with it and it serves most people.
It seems to be the most intuitive way for most people.
I only ever use org-mode major + beancount minor myself.
If I recall, Stefan once made a case that it ought to be a major mode (over
a dinner heavy on raclette cheese some years ago, if my memory serves).

What major mode do people use, and would anyone object strongly and if so
why?




On Thu, Jan 10, 2019 at 5:49 AM Júlio Maranhão 
wrote:

> On Sunday, 6 January 2019 18:43:46 UTC-2, Martin Blais wrote:
>>
>> Is there a way to have basic org functionality (folding) with it as a
>> major mode?  If so happy to convert
>>
>
> Yes. It's called orgstruct-mode or orgstruct++-mode (
> https://orgmode.org/manual/Orgstruct-mode.html). I use it because I also
> don't like to associate a beancount file with org. For instance, I don't
> like my yas snippets mixed with org snippets. Indeed this is an old emacs
> issue about major (only one per buffer) vs minor modes (many per buffer).
> Just see web development with emacs: an html file can embbed html, css,
> javascript, php, etc. There are many solutions, no one prevalent. But I
> would like to see a beancount major-mode. I think it deserves.
>
> P.S.: I'll made another topic about my opinions regarding general
> beancount development, design, etc. Don't want to mix here.
>
> --
> 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/4cb40f6a-6ea0-49aa-92e8-bf5a0801ca6a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAK21%2BhO6wR2tmwP%2BpFjytXDx0c9LTv0SjmieQTm8evpoi5Yfww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-09 Thread Júlio Maranhão
On Sunday, 6 January 2019 18:43:46 UTC-2, Martin Blais wrote:
>
> Is there a way to have basic org functionality (folding) with it as a 
> major mode?  If so happy to convert
>

Yes. It's called orgstruct-mode or orgstruct++-mode 
(https://orgmode.org/manual/Orgstruct-mode.html). I use it because I also 
don't like to associate a beancount file with org. For instance, I don't 
like my yas snippets mixed with org snippets. Indeed this is an old emacs 
issue about major (only one per buffer) vs minor modes (many per buffer). 
Just see web development with emacs: an html file can embbed html, css, 
javascript, php, etc. There are many solutions, no one prevalent. But I 
would like to see a beancount major-mode. I think it deserves.

P.S.: I'll made another topic about my opinions regarding general beancount 
development, design, etc. Don't want to mix here.

-- 
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/4cb40f6a-6ea0-49aa-92e8-bf5a0801ca6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-07 Thread Stefan Monnier
> Is there a way to have basic org functionality (folding) with it as a major
> mode?  If so happy to convert

You can try and call org-mode's folding command from some other
major mode.  I haven't tried it, so I don't know how well that
would work.  But that puts you right back to the original problem with
TAB, I think (unless you want to use another key-binding).

I think a lot of people would appreciate if someone were to add
org-style "fold cycling" to outline-(minor-)-mode, so that could be
another approach.


Stefan


> On Jan 7, 2019 06:24, "Stefano Zacchiroli"  wrote:
>
> Hi Stefan,
>
>
> On Sun, Jan 06, 2019 at 12:37:14PM -0500, Stefan Monnier wrote:
>> AFAIK, this is because your major mode is org-mode which does its own
>> thing with TAB.
>
> Right.
>
> Do you have any advice (and/or related work examples) on how to make
> beancount-mode works both as a major and minor mode?
>
> I've never seen anything of the sort (and I know well that Martin is
> keen in keeping beancount available as minor mode), but it should be
> easy to do with different top-level entry points (M-x
> beancount-{minor,major}-mode) that reuse most of the common code behind
> the scenes, right?
>
>
> Cheers
> -- 
> 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/20190106192425.rnl2n7y3kaxncb4x%40upsilon.cc
> .
>
> For more options, visit https://groups.google.com/d/optout.

-- 
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/jwv5zv0391p.fsf-monnier%2Bgmane.comp.finance.beancount%40gnu.org.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-06 Thread Martin Blais
Is there a way to have basic org functionality (folding) with it as a major
mode?  If so happy to convert

On Jan 7, 2019 06:24, "Stefano Zacchiroli"  wrote:

Hi Stefan,


On Sun, Jan 06, 2019 at 12:37:14PM -0500, Stefan Monnier wrote:
> AFAIK, this is because your major mode is org-mode which does its own
> thing with TAB.

Right.

Do you have any advice (and/or related work examples) on how to make
beancount-mode works both as a major and minor mode?

I've never seen anything of the sort (and I know well that Martin is
keen in keeping beancount available as minor mode), but it should be
easy to do with different top-level entry points (M-x
beancount-{minor,major}-mode) that reuse most of the common code behind
the scenes, right?


Cheers
-- 
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/20190106192425.rnl2n7y3kaxncb4x%40upsilon.cc
.

For more options, visit https://groups.google.com/d/optout.

-- 
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/CAK21%2BhOfNDCwLByQN0we--UfHissVfSJ6WMRY0hYZGO44SvnNg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-06 Thread Stefano Zacchiroli
Hi Stefan,

On Sun, Jan 06, 2019 at 12:37:14PM -0500, Stefan Monnier wrote:
> AFAIK, this is because your major mode is org-mode which does its own
> thing with TAB.

Right.

Do you have any advice (and/or related work examples) on how to make
beancount-mode works both as a major and minor mode?

I've never seen anything of the sort (and I know well that Martin is
keen in keeping beancount available as minor mode), but it should be
easy to do with different top-level entry points (M-x
beancount-{minor,major}-mode) that reuse most of the common code behind
the scenes, right?

Cheers
-- 
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/20190106192425.rnl2n7y3kaxncb4x%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-06 Thread Stefan Monnier
> - completion: I'm not sure how that is supposed to work. beancount-tab
>   as a function works well for accounts and tags (but not metadata
>   key/values, apparently), but if I bind it to TAB I lose indentation,
>   whereas in ledger-mode the two seems to work well together. Maybe I'm
>   not using it right

AFAIK, this is because your major mode is org-mode which does its own
thing with TAB.

If beancount-mode is made into a major mode, you don't need
beancount-tab at all, `completion-at-point` works for it (and setting
`tab-always-indent` to `complete` will let the normal
indent-for-tab-command do the completion).


Stefan

-- 
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/jwva7kd4roe.fsf-monnier%2Bgmane.comp.finance.beancount%40gnu.org.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-04 Thread Daniele Nicolodi
Hi Stefano,

On 04/01/2019 14:25, Stefano Zacchiroli wrote:
>> Which functionalities do you miss the most in beancount-mode?
> 
> - completion: I'm not sure how that is supposed to work. beancount-tab
>   as a function works well for accounts and tags (but not metadata
>   key/values, apparently), but if I bind it to TAB I lose indentation,
>   whereas in ledger-mode the two seems to work well together. Maybe I'm
>   not using it right
> 
> - indentation: as above, is there a function to auto-indent the first
>   character of the current line at the right column that I'm not
>   finding? in ledger-mode that's TAB, similarly to what happens with
>   most other major modes for programming languages
> 
> - number alignment: I'm missing ledger-mode's equivalent of C-c C-q.
>   beancount-align-numbers is supposed to do that (well, I guess), but:
> 
>   - it doesn't work on the current transaction by default, you have to
> select it as a region first, which is time consuming; and
> 
>   - is inconsistent across transactions: if you align numbers in
> separate transactions your ledger will "wiggle" horizontally
> 
>   there is bean-format for that, so I can use it and remap C-c C-q to
>   pipe the current transaction to it as an external filter, but it's
>   weird that such a basic function doesn't work out of the box so I
>   think I'm missing something
> 
> - highlighting: there's no highlighting of the current entry (usually a
>   transaction), arguably a very minor point, but annoying when you're
>   editing transactions with many postings/tags/metadata
> 
> All in all it's entirely possible this is just me using the mode
> "wrong", or expecting it to do things it's not supposed to do, but it's
> hard to tell.

My wish-list for beancount-mode overlaps pretty much with yours and I
will be working on it but I don't know how much time I will be able to
allocate to it.

Cheers,
Dan

-- 
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/6751e8bb-2c22-a5db-d513-3e659cdd2f89%40grinta.net.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-04 Thread Stefano Zacchiroli
Ciao Daniele, first of all thanks a lot for your feedback.

On Thu, Jan 03, 2019 at 10:30:43AM +0100, Daniele Nicolodi wrote:
> I agree that ledger-mode provides some functionality that would be
> nice to have in beancount-mode and I started to work on some, however
> I'm far from fluent in Elisp and I don't have much free time to work
> on this right now.
[...]
> Time permitting the next thing I will look into is probably
> investigate a way to have beancount-mode work as a major mode in
> addition to a minor mode, but I haven't found another mode that does
> something similar to take inspiration from, and my Elisp knowledge is
> too scattered to know if that is really a possibility.

I'm in a similar situation, but I'll be happy to land a hand if you
start hacking around in that direction.

> Which functionalities do you miss the most in beancount-mode?

- completion: I'm not sure how that is supposed to work. beancount-tab
  as a function works well for accounts and tags (but not metadata
  key/values, apparently), but if I bind it to TAB I lose indentation,
  whereas in ledger-mode the two seems to work well together. Maybe I'm
  not using it right

- indentation: as above, is there a function to auto-indent the first
  character of the current line at the right column that I'm not
  finding? in ledger-mode that's TAB, similarly to what happens with
  most other major modes for programming languages

- number alignment: I'm missing ledger-mode's equivalent of C-c C-q.
  beancount-align-numbers is supposed to do that (well, I guess), but:

  - it doesn't work on the current transaction by default, you have to
select it as a region first, which is time consuming; and

  - is inconsistent across transactions: if you align numbers in
separate transactions your ledger will "wiggle" horizontally

  there is bean-format for that, so I can use it and remap C-c C-q to
  pipe the current transaction to it as an external filter, but it's
  weird that such a basic function doesn't work out of the box so I
  think I'm missing something

- highlighting: there's no highlighting of the current entry (usually a
  transaction), arguably a very minor point, but annoying when you're
  editing transactions with many postings/tags/metadata

All in all it's entirely possible this is just me using the mode
"wrong", or expecting it to do things it's not supposed to do, but it's
hard to tell.

Cheers
-- 
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/20190104132524.5jo6ufp5oglh4pki%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.


Re: [emacs] using ledger-mode for beancount

2019-01-03 Thread Daniele Nicolodi
Ciao Stefano,

On 02/01/2019 13:42, Stefano Zacchiroli wrote:
> Is any of the Emacs & Beancount users on this list using ledger-mode to
> edit Beancount ledgers?
> 
> I've never found my way around beancount-mode and I really wanted a
> major mode dedicated to accounting, so I've started playing with using
> ledger-mode for Beancount.
> 
> The basics (indentation, account completion) work surprisingly well out
> of the box. Plus, one can add beancount-mode on top of it as a minor
> mode and get stuff like bean-context.  There are some glitches, e.g.,
> transaction highlighting is completely broken, but nothing unbearable.
> 
> Is anyone using ledger-mode for Beancount and can point to tips or
> suitable configuration snippets?
> 
> If the ledger-mode-for-Beancount user base is non nil we might have
> chances of adapting it and pushing upstream changes that make it work
> very well for Beancount.

I am an Emacs and Beancount user who migrated from Ledger. I tried
briefly to use ledger-mode for beancount files, but the broken syntax
highlighting was to annoying for me.

Unfortunately fixing ledger-mode regular expressions to work nicely for
beancount files is non-trivial because the Ledger syntax is much less
regualr that Beancount one. On the other hand, because of this enhancing
benacount-mode is way easier. I think that this second option is
preferable. I think that ledger-mode and and beancount-mode have
compatible licenses, thus porting code should not be an issue, if necessary.

I agree that ledger-mode provides some functionality that would be nice
to have in beancount-mode and I started to work on some, however I'm far
from fluent in Elisp and I don't have much free time to work on this
right now.

Which functionalities do you miss the most in beancount-mode? Time
permitting the next thing I will look into is probably investigate a way
to have beancount-mode work as a major mode in addition to a minor mode,
but I haven't found another mode that does something similar to take
inspiration from, and my Elisp knowledge is too scattered to know if
that is really a possibility.

Cheers,
Dan

-- 
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/7f1a7d49-f124-eb76-20da-c1fd33fcab94%40grinta.net.
For more options, visit https://groups.google.com/d/optout.