emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-babel-execute-src-block deletes its src block.


From: Daimrod
Subject: Re: [O] org-babel-execute-src-block deletes its src block.
Date: Sat, 03 Mar 2012 16:11:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux)

Eric Schulte <address@hidden> writes:

> Nick Dokos <address@hidden> writes:
>
>> Daimrod <address@hidden> 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).
>>
>
> This was caused by a commit of mine yesterday, I've just pushed up a fix
> and a protecting test case.
>
> Thanks for catching,

Works nicely.

By the way, org-babel is awesome, thanks for your efforts!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]