emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug in babel eating my text
@ 2011-01-19 22:52 Andreas Leha
  2011-01-19 23:54 ` Nick Dokos
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Leha @ 2011-01-19 22:52 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 707 bytes --]

Hi all,

I found a severe bug that actually eats my text, i.e. *destroys* my
org-mode file.

Or am I missing something here?

Just try that:

--8<---------------cut here---------------start------------->8---
* Test

  Execute this once:
  #+BEGIN_src R :session test :results output silent :exports none
    devnull <- library("tikzDevice")
  #+END_src
 
  Execute this twice or more... but be careful
  #+BEGIN_src R :session test :results output latex :exports results
    tikz(console=TRUE, width=4, height=4)
    plot(1:2,1:2)
    devnull <- dev.off()
  #+END_src

* Watch me die :-(
--8<---------------cut here---------------start------------->8---

Greetings,
Andreas



[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 6432 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug in babel eating my text
  2011-01-19 22:52 Bug in babel eating my text Andreas Leha
@ 2011-01-19 23:54 ` Nick Dokos
  2011-01-20 16:32   ` Eric Schulte
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Dokos @ 2011-01-19 23:54 UTC (permalink / raw)
  To: Andreas Leha; +Cc: nicholas.dokos, emacs-orgmode

Andreas Leha <andreas.leha@med.uni-goettingen.de> wrote:

> I found a severe bug that actually eats my text, i.e. *destroys* my
> org-mode file.
> 
> Or am I missing something here?
> 
> Just try that:
> 
> * Test
> 
>   Execute this once:
>   #+BEGIN_src R :session test :results output silent :exports none
>     devnull <- library("tikzDevice")
>   #+END_src
>  
>   Execute this twice or more... but be careful
>   #+BEGIN_src R :session test :results output latex :exports results
>     tikz(console=TRUE, width=4, height=4)
>     plot(1:2,1:2)
>     devnull <- dev.off()
>   #+END_src
> 
> * Watch me die :-(
> 

I can reproduce this: it seems to be eating one character each time it is
executed at the end of the #+END_LaTeX. Here's a patch that seems to fix
this problem - however, it is not based on any real understanding of the code,
so take it with a grain of salt. Also, if this fix works, then it is likely
that the other "wrap" cases will also need similar treatment:

diff --git a/lisp/ob.el b/lisp/ob.el
index 82625c0..2ce57ca 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -1500,7 +1500,7 @@ code ---- the results are extracted in the syntax of the source
 	   ((member "html" result-params)
 	    (wrap "#+BEGIN_HTML\n" "#+END_HTML"))
 	   ((member "latex" result-params)
-	    (wrap "#+BEGIN_LaTeX\n" "#+END_LaTeX"))
+	    (wrap "#+BEGIN_LaTeX\n" "#+END_LaTeX\n"))
 	   ((member "code" result-params)
 	    (wrap (format "#+BEGIN_SRC %s%s\n" (or lang "none") results-switches)
 		  "#+END_SRC"))

HTH,
Nick

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: Bug in babel eating my text
  2011-01-19 23:54 ` Nick Dokos
@ 2011-01-20 16:32   ` Eric Schulte
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Schulte @ 2011-01-20 16:32 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Andreas Leha, emacs-orgmode

Nick Dokos <nicholas.dokos@hp.com> writes:

> Andreas Leha <andreas.leha@med.uni-goettingen.de> wrote:
>
>> I found a severe bug that actually eats my text, i.e. *destroys* my
>> org-mode file.
>> 
>> Or am I missing something here?
>> 
>> Just try that:
>> 
>> * Test
>> 
>>   Execute this once:
>>   #+BEGIN_src R :session test :results output silent :exports none
>>     devnull <- library("tikzDevice")
>>   #+END_src
>>  
>>   Execute this twice or more... but be careful
>>   #+BEGIN_src R :session test :results output latex :exports results
>>     tikz(console=TRUE, width=4, height=4)
>>     plot(1:2,1:2)
>>     devnull <- dev.off()
>>   #+END_src
>> 
>> * Watch me die :-(
>> 
>
> I can reproduce this: it seems to be eating one character each time it is
> executed at the end of the #+END_LaTeX. Here's a patch that seems to fix
> this problem - however, it is not based on any real understanding of the code,
> so take it with a grain of salt. Also, if this fix works, then it is likely
> that the other "wrap" cases will also need similar treatment:
>

Hi Nick,

I've just applied I generalization of your solution below, thanks for
sharing.  This is a bug that has resurfaced every time we make a change
to the insertion of results.  Hopefully this fix will be last for a
while.

Best -- Eric

>
> diff --git a/lisp/ob.el b/lisp/ob.el
> index 82625c0..2ce57ca 100644
> --- a/lisp/ob.el
> +++ b/lisp/ob.el
> @@ -1500,7 +1500,7 @@ code ---- the results are extracted in the syntax of the source
>  	   ((member "html" result-params)
>  	    (wrap "#+BEGIN_HTML\n" "#+END_HTML"))
>  	   ((member "latex" result-params)
> -	    (wrap "#+BEGIN_LaTeX\n" "#+END_LaTeX"))
> +	    (wrap "#+BEGIN_LaTeX\n" "#+END_LaTeX\n"))
>  	   ((member "code" result-params)
>  	    (wrap (format "#+BEGIN_SRC %s%s\n" (or lang "none") results-switches)
>  		  "#+END_SRC"))
>
> HTH,
> Nick

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-20 16:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-19 22:52 Bug in babel eating my text Andreas Leha
2011-01-19 23:54 ` Nick Dokos
2011-01-20 16:32   ` Eric Schulte

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).