From mboxrd@z Thu Jan 1 00:00:00 1970 From: Erik Iverson Subject: [babel] possible bug in org-babel-execute-buffer? Date: Wed, 26 May 2010 18:59:10 -0500 Message-ID: <4BFDB5CE.3010600@ccbr.umn.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=39575 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHQVG-0004tT-4e for emacs-orgmode@gnu.org; Wed, 26 May 2010 19:59:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OHQVE-0002Zt-Uc for emacs-orgmode@gnu.org; Wed, 26 May 2010 19:59:14 -0400 Received: from pegasus.biostat.wisc.edu ([144.92.73.35]:53451) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OHQVE-0002Ze-QA for emacs-orgmode@gnu.org; Wed, 26 May 2010 19:59:12 -0400 Received: from [192.168.1.117] (c-24-118-198-210.hsd1.mn.comcast.net [24.118.198.210]) (authenticated bits=0) by pegasus.biostat.wisc.edu (8.13.6/8.13.6) with ESMTP id o4QNx32X011376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Wed, 26 May 2010 18:59:04 -0500 (CDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode Hello, I am using Emacs 23.1, orgmode pulled from git just an hour ago, but I noticed the following issue on a version pulled about a week ago, too. I don't know if it ever worked as I expect. These development versions have C-c C-v as the babel prefix keys, so if you are using a stable version, the following may be different. Also, all my examples use R. I'm trying to use C-c C-v C-b to call org-babel-execute-buffer, which is documented as: Call `org-babel-execute-src-block' on every source block in the current buffer. However, what happens when this is called seems to depend on which trees are visible in the buffer when it's called! Paste the following orgmode file into an org buffer, and make sure all trees are fully collapsed, i.e., you just see the headlines "Big Block 1" and "Big Block 2", and try C-c C-v C-b. After it's done executing, notice that only the *last* source blocks of each tree were run. Now collapse everything again, and call org-babel-execute-buffer again. The same thing happens, except now there are *two* results present for those last code blocks. Now start all over again with the below code, so no results are present. Expand all subtrees so everything is visible. Do C-c C-v C-b, and all results are inserted as expected. Run the blocks a second time with everything open, and every block still only has 1 results section, as expected. This is how I would expect/hope the function to work regardless of the hide/show states of the trees. So I think there are two possibly related problems when trees aren't fully expanded: 1) Only the last source code block per hidden tree is getting run 2) That last block will insert results multiple times if org-babel-execute-buffer is called multiple times Thanks! Erik =================== orgmode code follows below ====================== * Big Block 1 ** my first bit of code! #+begin_src R "from the first nested code block in Big Block 1" #+end_src ** and some more code! #+begin_src R "from the middle nested code block in Big Block 1" #+end_src ** and final code! #+begin_src R "from the final nested code block in Big Block 1" #+end_src * Big Block 2 #+begin_src R "from the only code block in Big Block 2" #+end_src