emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sébastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: [babel] ledger tutorial on Worg
Date: Wed, 08 Sep 2010 23:40:24 +0200	[thread overview]
Message-ID: <87bp87kj7b.fsf@mundaneum.com> (raw)
In-Reply-To: 87r5h4xgt3.fsf@gmail.com

Hi Eric,

"Eric Schulte" wrote:
> Sébastien Vauban <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:
>> "Eric Schulte" wrote:
>>> Sébastien Vauban <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:
>>>> "Eric Schulte" wrote:
>>>>> Sébastien Vauban <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:
>>>>>>
>>>>>> 2. When the evaluation produces no output, but had well produced output
>>>>>>    before, shouldn't Babel have to delete the previously written
>>>>>>    results in the Org buffer?
>>>>>
>>>>> This is a good point. Currently Babel just quits if it receives a nil
>>>>> result, but I think you're right that we should replace existing results
>>>>> when a nil result has been returned. I'll add this as PROPOSED to the
>>>>> babel task list.
>>>>
>>>> I consider this kind of mandatory, for the sake of coherency, and to
>>>> really make use of Org-babel every time I want to run some shell commands
>>>> (and change them, eventually getting no results then).
>>>
>>> I've just pushed up a change that implements this behavior.
>>
>> From my point of view, it does not work yet. Take this example:
>>
>> With `:cmdline reg unknown', it produced the line with -21.91 EUR. Correct.
>>
>> Now, if I write `:cmdline "reg" unknown', I expect no output from Ledger,
>> and thus the results block to be removed. That's not the case.
>
> If ledger throws an exception then the result probably will not be replaced,
> however if ledger does return an empty result, then the existing result will
> be removed.

What do you mean by ledger throwing an exception?  Having a return code
different from 0?

For me, the result block should be removed in both cases:
- "exception" of ledger
- empty result of ledger

Or, if not, then (even better): instead of simply removing the result block,
replace it with a sort of error message, saying that ledger's execution failed
and returned XXX as exit code.

Whatever the solution, we have to clearly be aware that the previous results
are now wrong, and that the new result is a failure or empty.


>> Other peculiarity, if I write `:cmdline reeg unknown', I get an
>> exception:
>
> Ah, thanks for pointing this out, it seems I introduced an error with my
> previous change. I've just pushed up a fix for this issue.

Thanks. But right now, I don't get anything back from the following (same as
for thread about isodoc letters):

--8<---------------cut here---------------start------------->8---
#+srcname: ledger-journal
#+begin_src ledger
2008/01/03 * (SCORPIOS ) SEB VAUBAN
	Assets:Bank:Checking:799997400530	                        550.00 EUR
	Assets:Bank:Transferred

2008/01/01 * ( ) UNKNOWN-PAYEE
	Assets:Bank:Checking:799997400530	                         21.91 EUR
	Expenses:Unknown
#+end_src

#+srcname: ledger-registry
#+begin_src ledger :cmdline reg unknown :noweb yes :session
<<ledger-journal>>
#+end_src
--8<---------------cut here---------------end--------------->8---

In the *Messages* buffer, I get:

--8<---------------cut here---------------start------------->8---
Checking for library `filladapt'... Found
Fontifying scorpios.org... (regexps.............................................)
Checking for library `filladapt'... Found
Fontifying scorpios.org... (regexps..............................................)
Checking for library `filladapt'... Found
Fontifying scorpios.org... (regexps...............................................)
Checking for library `filladapt'... Found
Checking for library `filladapt'... Found
Org-mode restarted
Local setup has been refreshed
--8<---------------cut here---------------end--------------->8---

... but no result block is added in my Org buffer.

I'll carefully test all of this, as soon as I can re-execute Babel under
normal conditions.

Thanks for your help.

Best regards,
  Seb

-- 
Sébastien Vauban


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2010-09-08 21:40 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-26 23:06 [babel] ledger tutorial on Worg Eric S Fraga
2010-08-27 14:53 ` Carsten Dominik
2010-08-27 15:27   ` Eric Schulte
2010-08-27 19:33     ` Eric S Fraga
2010-09-01 11:25     ` Sébastien Vauban
2010-09-01 18:33       ` Eric S Fraga
2010-09-02  0:19         ` Eric Schulte
2010-09-02 12:43         ` Sébastien Vauban
2010-09-02 14:56           ` Eric Schulte
2010-09-03 20:53             ` Sébastien Vauban
2010-09-03 21:35               ` Eric Schulte
2010-09-05 20:49                 ` Sébastien Vauban
2010-09-07 23:03                   ` Eric Schulte
2010-09-08  8:21                     ` Sébastien Vauban
2010-09-08 17:53                       ` Eric Schulte
2010-09-08 21:40                         ` Sébastien Vauban [this message]
2010-09-08 22:46                           ` Eric Schulte
2010-09-09 12:14                           ` Sébastien Vauban
2010-09-09 15:29                             ` Eric Schulte
2010-09-09 19:59                               ` Sébastien Vauban
2010-09-09 21:15                                 ` Sébastien Vauban
2010-09-09 21:42                                   ` Dan Davison
2010-09-03  8:33           ` Eric S Fraga

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=87bp87kj7b.fsf@mundaneum.com \
    --to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.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).