From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [babel] Multiple results blocks for the same source code Date: Fri, 23 Sep 2011 09:53:53 -0600 Message-ID: <87wrczi6zr.fsf@gmail.com> References: <8062kjxxux.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:50687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R78BB-0008N0-7s for emacs-orgmode@gnu.org; Fri, 23 Sep 2011 12:00:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R78B3-000292-Qa for emacs-orgmode@gnu.org; Fri, 23 Sep 2011 12:00:45 -0400 Received: from mail-yi0-f41.google.com ([209.85.218.41]:60601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R78B3-00028c-9A for emacs-orgmode@gnu.org; Fri, 23 Sep 2011 12:00:37 -0400 Received: by yia25 with SMTP id 25so3308124yia.0 for ; Fri, 23 Sep 2011 09:00:35 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sebastien Vauban Cc: emacs-orgmode@gnu.org Hi Seb, I could not reproduce the error you describe, and your test case passes for me. I have added your test case to testing/test-ob.el however so it should protect from this error in the future. You could try running the test suite in batch mode (which will not load your configuration) and see if the test still fails for you. If not then the problem is probably due to either something in your config. Thanks for the test case! -- Eric ps. the only comments I have on the test itself are 1. The initial placement of the point is described in the documentation string for the `org-test-with-temp-text' function 2. In the future if you could share new test cases as patches to the relevant test file (i.e., using git format-patch) that would be ideal "Sebastien Vauban" writes: > #+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 -- Eric Schulte http://cs.unm.edu/~eschulte/