emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Different behavior of exported results in org-babel
@ 2014-01-17 16:36 Ahmadou Dicko
  2014-01-17 19:04 ` Nick Dokos
  0 siblings, 1 reply; 7+ messages in thread
From: Ahmadou Dicko @ 2014-01-17 16:36 UTC (permalink / raw)
  To: emacs-orgmode


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

Hi everyone,

I use the latest version of org-mode (from github) and I update it daily.
I noticed some changes recently in org-babel (ob-R).

Here's a sample code to explain the problem :

#+TITLE: Test export
#+AUTHOR: Ahmadou H. DICKO
#+PROPERTY: session *R*
#+PROPERTY: cache yes
#+PROPERTY: exports both
#+PROPERTY: tangle yes
#+OPTIONS: toc:nil

* Minimal example
 This works quite well
#+begin_src R :exports both :results output
mtcars[1:2, 1:2]
#+end_src

I just want the output without code but I have this
 'bf7c7b2c131fcf88c89639d10326a972f0ff25' before the code
#+begin_src R :exports results :results output
mtcars[1:2, 1:2]
#+end_src

I use emacs 24.3.1, org-version 8.2.5f (updated this morning) and R 3.0.2
You can find attached the sample code and output, if you have something
different please let me know.

Thanks for your help.


-- 
Ahmadou H. DICKO
statistician economist (Ingénieur Statisticien Économiste)
PhD candidate in Climate change economics
Faculty of economics and managment - Cheikh Anta Diop University
West African Science Service Center on Climate Change and Adaptated Land
Use (WASCAL)
Center for Development Research (ZEF) - University of Bonn
email : ahmadou.dicko@ucad.edu.sn
twitter : @dickoah
github : github/dickoa <https://github.com/dickoa>
tel : +221 33 827 55 16
portable: +221 77 123 81 69

[-- Attachment #1.2: Type: text/html, Size: 1906 bytes --]

[-- Attachment #2: example.html --]
[-- Type: text/html, Size: 6088 bytes --]

[-- Attachment #3: example.org --]
[-- Type: application/octet-stream, Size: 397 bytes --]

#+TITLE: Test export
#+AUTHOR: Ahmadou H. DICKO
#+PROPERTY: session *R*
#+PROPERTY: cache yes 
#+PROPERTY: exports both
#+PROPERTY: tangle yes
#+OPTIONS: toc:nil


* Minimal example
 
** with exports both
#+begin_src R :exports both :results output
mtcars[1:2, 1:2]
#+end_src
  

** with exports results only
#+begin_src R :exports results :results output 
mtcars[1:2, 1:2]
#+end_src
   

   
   

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

* Re: Different behavior of exported results in org-babel
  2014-01-17 16:36 Different behavior of exported results in org-babel Ahmadou Dicko
@ 2014-01-17 19:04 ` Nick Dokos
  2014-01-17 19:19   ` Ahmadou Dicko
  0 siblings, 1 reply; 7+ messages in thread
From: Nick Dokos @ 2014-01-17 19:04 UTC (permalink / raw)
  To: emacs-orgmode

Ahmadou Dicko <dicko.ahmadou@gmail.com> writes:

> Hi everyone,
>
> I use the latest version of org-mode (from github) and I update it daily.
> I noticed some changes recently in org-babel (ob-R).
>
> Here's a sample code to explain the problem :
>
> #+TITLE: Test export
> #+AUTHOR: Ahmadou H. DICKO
> #+PROPERTY: session *R*
> #+PROPERTY: cache yes 
> #+PROPERTY: exports both
> #+PROPERTY: tangle yes
> #+OPTIONS: toc:nil
>
> * Minimal example
>  This works quite well
> #+begin_src R :exports both :results output
> mtcars[1:2, 1:2]
> #+end_src
> 
> I just want the output without code but I have this
> 'bf7c7b2c131fcf88c89639d10326a972f0ff25' before the code

> #+begin_src R :exports results :results output 
> mtcars[1:2, 1:2]
> #+end_src
>

I used your reproducer (thanks for providing it!) and was able to
duplicate your results (more or less - I get this

   7c7b2c131fcf88c89639d10326a972f0ff25]:

before the second set of results).

If I evaluate both code blocks by hand in the org buffer and
*then* export, I don't get the extra junk.

> I use emacs 24.3.1, org-version 8.2.5f (updated this morning) and R
> 3.0.2 You can find attached the sample code and output, if you have
> something different please let me know.
>

Nick

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

* Re: Different behavior of exported results in org-babel
  2014-01-17 19:04 ` Nick Dokos
@ 2014-01-17 19:19   ` Ahmadou Dicko
  2014-01-17 19:59     ` Nick Dokos
  2014-01-18  0:32     ` Nick Dokos
  0 siblings, 2 replies; 7+ messages in thread
From: Ahmadou Dicko @ 2014-01-17 19:19 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2103 bytes --]

Thanks for testing.
As a workaround I will use your trick (in buffer evaluation before
exporting) but I was thinking of writing a filter.


On Fri, Jan 17, 2014 at 7:04 PM, Nick Dokos <ndokos@gmail.com> wrote:

> Ahmadou Dicko <dicko.ahmadou@gmail.com> writes:
>
> > Hi everyone,
> >
> > I use the latest version of org-mode (from github) and I update it daily.
> > I noticed some changes recently in org-babel (ob-R).
> >
> > Here's a sample code to explain the problem :
> >
> > #+TITLE: Test export
> > #+AUTHOR: Ahmadou H. DICKO
> > #+PROPERTY: session *R*
> > #+PROPERTY: cache yes
> > #+PROPERTY: exports both
> > #+PROPERTY: tangle yes
> > #+OPTIONS: toc:nil
> >
> > * Minimal example
> >  This works quite well
> > #+begin_src R :exports both :results output
> > mtcars[1:2, 1:2]
> > #+end_src
> >
> > I just want the output without code but I have this
> > 'bf7c7b2c131fcf88c89639d10326a972f0ff25' before the code
>
> > #+begin_src R :exports results :results output
> > mtcars[1:2, 1:2]
> > #+end_src
> >
>
> I used your reproducer (thanks for providing it!) and was able to
> duplicate your results (more or less - I get this
>
>    7c7b2c131fcf88c89639d10326a972f0ff25]:
>
> before the second set of results).
>
> If I evaluate both code blocks by hand in the org buffer and
> *then* export, I don't get the extra junk.
>
> > I use emacs 24.3.1, org-version 8.2.5f (updated this morning) and R
> > 3.0.2 You can find attached the sample code and output, if you have
> > something different please let me know.
> >
>
> Nick
>
>
>


-- 
Ahmadou H. DICKO
statistician economist (Ingénieur Statisticien Économiste)
PhD candidate in Climate change economics
Faculty of economics and managment - Cheikh Anta Diop University
West African Science Service Center on Climate Change and Adaptated Land
Use (WASCAL)
Center for Development Research (ZEF) - University of Bonn
email : ahmadou.dicko@ucad.edu.sn
twitter : @dickoah
github : github/dickoa <https://github.com/dickoa>
tel : +221 33 827 55 16
portable: +221 77 123 81 69

[-- Attachment #2: Type: text/html, Size: 2967 bytes --]

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

* Re: Different behavior of exported results in org-babel
  2014-01-17 19:19   ` Ahmadou Dicko
@ 2014-01-17 19:59     ` Nick Dokos
  2014-01-18  0:32     ` Nick Dokos
  1 sibling, 0 replies; 7+ messages in thread
From: Nick Dokos @ 2014-01-17 19:59 UTC (permalink / raw)
  To: emacs-orgmode

Ahmadou Dicko <dicko.ahmadou@gmail.com> writes:

> Thanks for testing.
> As a workaround I will use your trick (in buffer evaluation before exporting) but I was thinking of writing a filter.
>

I think this is a bug, so wait a bit before writing the filter.
Eric Schulte will probably know what's wrong immediately, but if
he is busy, somebody should be able to figure it out quickly.

Nick

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

* Re: Different behavior of exported results in org-babel
  2014-01-17 19:19   ` Ahmadou Dicko
  2014-01-17 19:59     ` Nick Dokos
@ 2014-01-18  0:32     ` Nick Dokos
  2014-01-18 14:43       ` Nicolas Goaziou
  1 sibling, 1 reply; 7+ messages in thread
From: Nick Dokos @ 2014-01-18  0:32 UTC (permalink / raw)
  To: emacs-orgmode

Ahmadou Dicko <dicko.ahmadou@gmail.com> writes:

> As a workaround I will use your trick (in buffer evaluation before
> exporting) but I was thinking of writing a filter.

A better workaround is to delete the white space (spaces, tabs and
newlines) at the end of the file: without that, the problem goes away.
If white space is added to the end of the file, the problem might
reappear, with different amounts of junk added depending on the amount
of added white space.

I have traced it down to org-babel-exp-process-buffer: it does the
deletions of the source code blocks (possibly putting them back again
if the header args tell it to) but it does not always delete the right
region. More details later.

Nick

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

* Re: Different behavior of exported results in org-babel
  2014-01-18  0:32     ` Nick Dokos
@ 2014-01-18 14:43       ` Nicolas Goaziou
  2014-01-18 21:07         ` Ahmadou Dicko
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Goaziou @ 2014-01-18 14:43 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Hello,

Nick Dokos <ndokos@gmail.com> writes:

> I have traced it down to org-babel-exp-process-buffer: it does the
> deletions of the source code blocks (possibly putting them back again
> if the header args tell it to) but it does not always delete the right
> region. More details later.

Indeed. I pushed a fix that should, hopefully, solve the issue.

Thanks to Ahmadou Dicko for reporting the problem, and to you for
tracking it.


Regards,

-- 
Nicolas Goaziou

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

* Re: Different behavior of exported results in org-babel
  2014-01-18 14:43       ` Nicolas Goaziou
@ 2014-01-18 21:07         ` Ahmadou Dicko
  0 siblings, 0 replies; 7+ messages in thread
From: Ahmadou Dicko @ 2014-01-18 21:07 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Nick Dokos, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1219 bytes --]

Thanks a lot Nicolas and Nick.
I just tried it and everything works as expected.
Thank you very much.



On Sat, Jan 18, 2014 at 2:43 PM, Nicolas Goaziou <n.goaziou@gmail.com>wrote:

> Hello,
>
> Nick Dokos <ndokos@gmail.com> writes:
>
> > I have traced it down to org-babel-exp-process-buffer: it does the
> > deletions of the source code blocks (possibly putting them back again
> > if the header args tell it to) but it does not always delete the right
> > region. More details later.
>
> Indeed. I pushed a fix that should, hopefully, solve the issue.
>
> Thanks to Ahmadou Dicko for reporting the problem, and to you for
> tracking it.
>
>
> Regards,
>
> --
> Nicolas Goaziou
>
>


-- 
Ahmadou H. DICKO
statistician economist (Ingénieur Statisticien Économiste)
PhD candidate in Climate change economics
Faculty of economics and managment - Cheikh Anta Diop University
West African Science Service Center on Climate Change and Adaptated Land
Use (WASCAL)
Center for Development Research (ZEF) - University of Bonn
email : ahmadou.dicko@ucad.edu.sn
twitter : @dickoah
github : github/dickoa <https://github.com/dickoa>
tel : +221 33 827 55 16
portable: +221 77 123 81 69

[-- Attachment #2: Type: text/html, Size: 1895 bytes --]

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

end of thread, other threads:[~2014-01-18 21:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-17 16:36 Different behavior of exported results in org-babel Ahmadou Dicko
2014-01-17 19:04 ` Nick Dokos
2014-01-17 19:19   ` Ahmadou Dicko
2014-01-17 19:59     ` Nick Dokos
2014-01-18  0:32     ` Nick Dokos
2014-01-18 14:43       ` Nicolas Goaziou
2014-01-18 21:07         ` Ahmadou Dicko

Code repositories for project(s) associated with this 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).