--meta not working from `ledger-mode`?

36 views
Skip to first unread message

Joost Kremers

unread,
Jun 10, 2020, 6:21:34 PM6/10/20
to Ledger
Hi all,

I use a metadata value "Desc" in some of my transactions to give a
bit more info to particular postings. Now, if I run something like
the following on a command line:

$ ledger -f MyLedger.ledger reg Some:Account --meta Desc
--meta-width 40

I get a report in which each line starts with the value of the
Desc tag.

However, I have not been able to do the same from within Emacs'
`ledger-mode`. If I run a report with `C-c C-o C-r`, select
`account`, then type "Some:Account" at the prompt, I get a report
which I can then edit with `e`. If I do this and add "--meta
Desc", the report doesn't change: there is no column for the value
of "Desc".

I can copy the `*Ledger Report*` buffer and paste it in a terminal
window and then I get the correct output. i.e., *with* a column
for "Desc". But the `*Ledger Report*` buffer doesn't show it.

Is this a bug or am I doing something wrong? Adding other options
to the ledger command this way works fine, so I'm not sure why
this one seems to be ignored.

TIA

Joost


--
Joost Kremers
Life has its moments

federico lopez

unread,
Jun 11, 2020, 6:53:50 PM6/11/20
to ledge...@googlegroups.com
On Wed, Jun 10, 2020 at 5:21 PM Joost Kremers <joostk...@fastmail.fm> wrote:


However, I have not been able to do the same from within Emacs'
`ledger-mode`. If I run a report with `C-c C-o C-r`, select
`account`, then type "Some:Account" at the prompt, I get a report
which I can then edit with `e`. If I do this and add "--meta
Desc", the report doesn't change: there is no column for the value
of "Desc".



Here (spacemacs) I can see the --meta column in ledger-mode if I edit the report with `e` and remove the [[ledger-mode-flags]] , but the colors are lost.

Alex Branham

unread,
Jun 15, 2020, 7:42:20 PM6/15/20
to Ledger
This is a bug. For now, you can set ledger-report-links-in-register to
nil and it should fix the issue I believe.

This seems to be due to the fact that ledger-mode relies on
--prepend-format to prepend output to the report but output from --meta
seems to come before --prepend-format.

Whether it's a bug in ledger or ledger-mode I'm not sure.
 

Joost Kremers

unread,
Jun 16, 2020, 3:12:21 AM6/16/20
to ledge...@googlegroups.com

On Tue, Jun 16 2020, Alex Branham wrote:
>> On Wed, Jun 10, 2020 at 5:21 PM Joost Kremers
>> <joostk...@fastmail.fm
>> <javascript:>> wrote:
>>> However, I have not been able to do the same from within
>>> Emacs'
>>> `ledger-mode`. If I run a report with `C-c C-o C-r`, select
>>> `account`, then type "Some:Account" at the prompt, I get a
>>> report
>>> which I can then edit with `e`. If I do this and add "--meta
>>> Desc", the report doesn't change: there is no column for the
>>> value
>>> of "Desc".
[...]
> This is a bug. For now, you can set
> ledger-report-links-in-register to
> nil and it should fix the issue I believe.

Yes, it does. Which is a bit unfortunate, because it's a practical
feature...

> This seems to be due to the fact that ledger-mode relies on
> --prepend-format to prepend output to the report but output from
> --meta
> seems to come before --prepend-format.
>
> Whether it's a bug in ledger or ledger-mode I'm not sure.

Well, if I combine `--prepend-format` and `--meta` on the command
line, the `--meta` option seems to be ignored: only the
`--prepend-format` string is added to each line. So I guess
`--prepend-format` and `--meta` aren't compatible in `ledger`,
which could be a bug or a feature, I don't know. I couldn't find
anything in the documentation about it, but that might just be a
documentation bug, of course.

It would be nice to have this fixed, but for the time being, I can
always unset `ledger-report-links-in-register` temporarily if I
want to see a metadata value.

Thanks,
Reply all
Reply to author
Forward
0 new messages