From: alan.schmitt@polytechnique.org
To: emacs-orgmode@gnu.org
Subject: org-sbe recent changes?
Date: Sun, 30 Oct 2022 19:07:21 +0100 [thread overview]
Message-ID: <87h6zldw2u.fsf@m4x.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1730 bytes --]
Hello,
I’ve been using ledger and an org-mode table to track my finances for a
long time, and today it broke: when I evaluate a table macro, I get an
#ERROR instead of the computed value.
The code I’m using is still the one from here:
https://alan.petitepomme.net/tips/ledger_and_org.html
Basically I define a function like this (I added the message part for debugging):
#+name: call_ledger
#+begin_src emacs-lisp :var lcmd="bal" :var bucket="Quotidien" :var prefix="Expenses:" :var period=()
(let* ((name (org-trim bucket))
(bname (concat "'^" prefix name "'"))
(ledger "ledger -f ~/Documents/Org/mescomptes.ledger")
(parg (when period (concat " -p '" period "'")))
(cutcmd "tail -1 | cut -d ' ' -f 2")
(cmd
(concat ledger " -J " parg " " lcmd " " bname " | " cutcmd))
(res (org-trim (shell-command-to-string cmd))))
(message res)
(if (equal res "") 0 res))
#+end_src
Then I call it in a table that looks like this (removing a lot of stuff
for privacy reasons):
| Bucket | Planned | Remaining |
|--------------------------------+---------+-----------+
| Achat Maison | 1000 | #ERROR |
|--------------------------------+---------+-----------+
| Total | 1000 | #ERROR |
#+TBLFM: @2$3..@>>$3='(org-sbe call_ledger (bucket $$1) (prefix "\"Bucket:Expenses:\""))
It used to work, but now I get an #ERROR. The strange thing is that the
correct value is printed with the message call. Did something change
recently regarding org-sbe and table? How can I find out what the
value is causing the #ERROR to be printed?
Thanks,
Alan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 528 bytes --]
next reply other threads:[~2022-10-30 18:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-30 18:07 alan.schmitt [this message]
2022-10-30 19:26 ` org-sbe recent changes? Alan Schmitt
2022-10-31 1:24 ` Ihor Radchenko
2022-10-31 8:07 ` Alan Schmitt
2022-11-01 2:16 ` Ihor Radchenko
2022-11-01 8:40 ` Alan Schmitt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h6zldw2u.fsf@m4x.org \
--to=alan.schmitt@polytechnique.org \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).