Re: [Orgmode] Re: [Babel] Handling of errors when using Ledger
Dan Davison dandavis...@gmail.com writes: [...] Hi Eric, I've asked on the ledger list and the 3.0 (and perhaps some older) versions of ledger do support -f - to read from stdin. Could you try this version of the patch? I was about to say that I could not because the most up to date version on Debian (testing) is 2.6.2 and this version does not support the -f - option. However, I have just noticed that version 3.0.0 is now in Debian experimental. I will have a look to see what kind of repercussions there may be from installing that version on my systems and I will get back to you (but probably not until after xmas...). -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1 : using Org-mode version 7.4 (release_7.4.79.g9c4b9) ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: [Babel] Handling of errors when using Ledger
Dan dandavis...@gmail.com writes: [...] This patch should make ob-ledger use the common org-babel error mechanism. It is in branch ledger of the main repo. However, I'm not yet a ledger user. Could someone test it? Unfortunately, it doesn't work at all [1] for a very simple reason: you have removed the -f option which specifies the file that ledger should read. Ledger does not interpret a file argument directly but needs the -f option, as in: ledger -f file.ledger rest of command line Note the second line in the concatenated list of strings below: [...] -(with-output-to-string - (shell-command (concat ledger - -f (org-babel-process-file-name in-file) - cmdline - (org-babel-process-file-name out-file I am not sure how you pass this option with the much shorter code you have written: + (org-babel-eval + (concat org-babel-ledger-command (cdr (assoc :cmdline params))) + body)) I hope this makes sense? Footnotes: [1] actually, what does work very nicely indeed is that error messages are reported perfectly!! So thank you very much for this. -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1 : using Org-mode version 7.3 (release_7.3.99.g9db0.dirty) ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: [Babel] Handling of errors when using Ledger
On Tue, 12 Oct 2010 21:58:46 +0200, Sébastien Vauban wxhgmqzgw...@spammotel.com wrote: Hi Dan, Dan Davison wrote: Sébastien Vauban writes: [...] Let's imagine I thought (which was the case at some point) I needed to enclose the parameters between quotes: #+srcname: quoted-params #+begin_src ledger :cmdline reg unknown :noweb yes :session data #+end_src #+results: quoted-params Nothing is returned. In fact, I would expect an error to be thrown [...] I don't know if this is a common problem (to Org-Babel) or only to the Ledger part of it, but I think *we* should somehow improve the handling of errors. Babel has a standard mechanism for evaluating shell commands and displaying errors if any. It is the function `org-babel-eval' in ob-eval.el. The problem is that ob-ledger is not using this mechanism. Would you be interested in fixing this? Basically what is required is to re-implement `org-babel-execute:ledger' using `org-babel-eval'. (There are plenty of examples in the other langauges to follow.) Please don't worry if you are too busy though. I'd be interested to try and fix it. I am busy, yes: I am just recovering 3 [...] So, I'd propose to fight for being the first one to fix that... And let's see who will win... ;-) Please do!! As the original author (basing my code on other babel codes, mind you), I am happy to lose this fight ;-) I really don't know enough babel to make the changes required quickly and I also am struggling with free time at the moment. -- Eric S Fraga GnuPG: 8F5C 279D 3907 E14A 5C29 570D C891 93D8 FFFC F67D ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode