From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: org-babel-execute-src-block deletes its src block. Date: Sat, 03 Mar 2012 04:42:08 -0500 Message-ID: <10911.1330767728@alphaville> References: <87linif3dg.fsf@gmail.com> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3lTi-0007Ol-9p for emacs-orgmode@gnu.org; Sat, 03 Mar 2012 04:42:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3lTg-0003YJ-Ik for emacs-orgmode@gnu.org; Sat, 03 Mar 2012 04:42:13 -0500 Received: from g6t0185.atlanta.hp.com ([15.193.32.62]:30383) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3lTg-0003Y5-DA for emacs-orgmode@gnu.org; Sat, 03 Mar 2012 04:42:12 -0500 In-Reply-To: Message from Daimrod of "Sat, 03 Mar 2012 10:19:39 +0100." <87linif3dg.fsf@gmail.com> 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: Daimrod Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org Daimrod wrote: > > Hi, I've recently switched from Org 7.4 to the master branch on the git > repository, and I've encountered this weird situation. > > #+name: foo > #+begin_src emacs-lisp > (defun foo () > 42) > (foo) > #+end_src emacs-lisp > > If I evaluate this block I get: > > #+name: foo > =42 > =emacs-lisp > > Though it works as expected if I remove the name: > > #+begin_src emacs-lisp > (defun foo () > 42) > (foo) > #+end_src emacs-lisp > => > #+begin_src emacs-lisp > (defun foo () > 42) > (foo) > #+end_src emacs-lisp > > #+RESULTS: > : 42 > > I've tried to figure out what was the problem and it lies in the regexp > org-babel-src-name-w-name-regexp. > > So far I've found those workarounds: > > No spaces after the ':' > > #+name:foo > #+begin_src emacs-lisp > (defun foo () > 42) > (foo) > #+end_src emacs-lisp > => > #+name:foo > #+begin_src emacs-lisp > (defun foo () > 42) > (foo) > #+end_src emacs-lisp > #+RESULTS: foo > : 42 > > Add parentheses after the name. > > #+name: foo() > #+begin_src emacs-lisp > (defun foo () > 42) > (foo) > #+end_src emacs-lisp > => > #+name: foo() > #+begin_src emacs-lisp > (defun foo () > 42) > (foo) > #+end_src emacs-lisp > > #+RESULTS: foo > : 42 > > No spaces before the src block > > #+name: foo > #+begin_src emacs-lisp > (defun foo () > 42) > (foo) > #+end_src emacs-lisp > => > #+name: foo > #+begin_src emacs-lisp > (defun foo () > 42) > (foo) > #+end_src emacs-lisp > > #+RESULTS: foo > : 42 Bug confirmed (but I didn't try all your workarounds, just the no spaces before the #+begin_src and no space after the colon in the #+name). I take it it was working on 7.4? Nick PS. One side note: the syntax of code blocks is #+NAME: #+BEGIN_SRC
#+END_SRC so no emacs-lisp on the #+end_src line.