From: "Sebastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: [babel] Multiple results blocks for the same source code
Date: Fri, 23 Sep 2011 14:11:02 +0200 [thread overview]
Message-ID: <8062kjxxux.fsf@somewhere.org> (raw)
#+TITLE: Multiple results blocks for the same source code
#+AUTHOR: Seb Vauban
#+DATE: 2011-09-23
#+LANGUAGE: en
* Bug
When evaluating multiple times the following code, we get multiple =results=
blocks.
#+begin_src sh
echo Hello
#+end_src
#+results:
: Hello
#+results:
: Hello
* ERT Test Case
#+begin_src emacs-lisp
(ert-deftest test-org-babel/just-one-results-block ()
"Test that evaluating two times the same code block does not result in a
duplicate results block."
(org-test-with-temp-text "#+begin_src sh\necho Hello\n#+end_src\n"
(org-babel-execute-src-block)
(org-babel-execute-src-block) ;; second code block execution
;; where is point (supposed to be)?
(goto-char (point-min))
(should (search-forward "Hello")) ;; the string inside the source code block
(should (search-forward "Hello")) ;; the same string in the (first?) results block
(should-error (search-forward "Hello"))))
#+end_src
* Extra context
This problem appeared after having executed sh code blocks (calling Ledger)
which failed -- for some reason still to be studied.
After an Emacs restart, I can't reproduce this anymore. So, not really fixed,
but not there systematically either...
Status is unreproducible right now, but I guess the above test case can
already be added. Please comment on it, for me to progress...
Best regards,
Seb
--
Sebastien Vauban
next reply other threads:[~2011-09-23 12:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-23 12:11 Sebastien Vauban [this message]
2011-09-23 15:53 ` [babel] Multiple results blocks for the same source code Eric Schulte
2011-09-23 21:44 ` Sebastien Vauban
2011-09-23 21:51 ` Eric Schulte
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=8062kjxxux.fsf@somewhere.org \
--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).