From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: org-babel: Bugs with inline src_* blocks Date: Tue, 15 Feb 2011 11:42:56 -0700 Message-ID: <87lj1h5dzi.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=34165 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PpPys-0006d6-83 for emacs-orgmode@gnu.org; Tue, 15 Feb 2011 13:50:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PpPyp-0005Dj-O1 for emacs-orgmode@gnu.org; Tue, 15 Feb 2011 13:50:33 -0500 Received: from mail-pz0-f41.google.com ([209.85.210.41]:47019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PpPyp-0005D3-IO for emacs-orgmode@gnu.org; Tue, 15 Feb 2011 13:50:31 -0500 Received: by pzk27 with SMTP id 27so84494pzk.0 for ; Tue, 15 Feb 2011 10:50:30 -0800 (PST) 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: Paul Sexton Cc: emacs-orgmode@gnu.org Paul Sexton writes: > I am experiencing a couple of significant bugs with inline src blocks in > org-babel -- ie blocks of the form src_LANG{EXPRESSION}. I am using the > development version of org, checked out a few days ago. > > Pressing C-c C-c with the cursor on such a block is supposed to evaluate it and > echo the result to the minibuffer. However in recent versions of org (the last > 3 months or so) this behaviour has become broken, at least for me. > > The following is an example file. > > ------start------- > #+BABEL: :session s1 :exports value latex :results raw > > #+BEGIN_SRC R :results none :exports none > 1+2+3 > #+END_SRC > > > src_R{1+1} > ------end-------- > > Pressing C-c C-c with the cursor on the inline block produces the error: > > 'R' is not recognized as an internal or external command, > operable program or batch file. > > This happens even if the session named s1 is already running. However, if I > first evaluate the BEGIN_SRC ... END_SRC block, using > org-babel-execute-src-block, and then reattempt to evaluate the inline block, it > will work. If I then press C-c C-c on the '#+BABEL:' line at the start of the > file, the inline block goes back to producing the error. > I just tried your example from above, and I can not reproduce this error. Maybe as Suvayu suggested you should try grabbing the latest version of Org-mode and see if that fixes this issue. > > The second, and more aggravating, error is do with the consequences of > evaluating inline blocks. Formerly the result would be echoed in the > minibuffer, and the document itself would not be altered. Now org has taken to > inserting the result after the block, the same behaviour as a non-inline block. > The header arguments used for this insertion seem to carry over either from the > previous non-inline block, or possibly the global settings (BABEL: line). > > So for example, if I press C-c C-c on the src_R{1+1} above, I get: > > ------- > src_R{1+1} #+BEGIN_LaTeX > 2#+END_LaTeX > > ------- > > I want inline code blocks to replace themselves with their result when > exporting the document to latex etc. I *never* want them to paste their results > into the document while editing - that is what non-inline blocks are for. > Hi, I agree with your intuition here, but I changed the default inline header argument so that others would be able to use inline code blocks and have the results inserted. To regain the behavior you describe, simply adjust the value of `org-babel-default-inline-header-args' as follows in your .emacs file. #+begin_src emacs-lisp (setf org-babel-default-inline-header-args '((:session . "none") (:results . "silent") (:exports . "results"))) #+end_src Best -- Eric > > Is this change in behaviour intentional? If so is there a setting that will > revert to the old behaviour? > > Paul > > > > > > _______________________________________________ > 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