emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* suppress leading ":" in org-babel output
@ 2019-05-27  7:13 Jeremie Juste
  2019-05-28  2:17 ` Nick Dokos
  0 siblings, 1 reply; 6+ messages in thread
From: Jeremie Juste @ 2019-05-27  7:13 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I recall seeing this thread on the mailing list but I cannot find it
back.

I would like to suppress the first line leading ":" in the following output


#+NAME:mean_purchase_per_shopping_trip
#+BEGIN_SRC R :var x=6 :results output :session *R*
a <-sprintf("%.2f",12.234324)
cat(a,sep="\n")
#+END_SRC

#+RESULTS: mean_purchase_per_shopping_trip
: 
: 12.23


Best regards,
Jeremie

Org mode version 9.2.1 (9.2.1-8-g1b1797-elpaplus @
/home/djj/.emacs.d/elpa/org-plus-contrib-20190211/)
GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2019-05-16

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

* Re: suppress leading ":" in org-babel output
  2019-05-27  7:13 suppress leading ":" in org-babel output Jeremie Juste
@ 2019-05-28  2:17 ` Nick Dokos
  2019-05-28 16:57   ` Berry, Charles
  2019-05-31  7:05   ` Jeremie Juste
  0 siblings, 2 replies; 6+ messages in thread
From: Nick Dokos @ 2019-05-28  2:17 UTC (permalink / raw)
  To: emacs-orgmode

Jeremie Juste <jeremiejuste@gmail.com> writes:

> Hello,
>
> I recall seeing this thread on the mailing list but I cannot find it
> back.
>
> I would like to suppress the first line leading ":" in the following output
>
>
> #+NAME:mean_purchase_per_shopping_trip
>
> #+BEGIN_SRC R :var x=6 :results output :session *R*
> a <-sprintf("%.2f",12.234324)
> cat(a,sep="\n")
> #+END_SRC
>
> #+RESULTS: mean_purchase_per_shopping_trip
> : 
>
> : 12.23
>

FWIW, I just get the last line:

#+NAME:mean_purchase_per_shopping_trip

#+BEGIN_SRC R :var x=6 :results output :session *R*
a <-sprintf("%.2f",12.234324)
cat(a,sep="\n")
#+END_SRC

#+RESULTS:
: 12.23

This is with 

   GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32) of 2019-05-01
   Org mode version 9.2.3 (release_9.2.3-367-gd79e80 @ /home/nick/elisp/org-mode/lisp/)
   R version 3.5.3 (2019-03-11) -- "Great Truth"

on Fedora 29.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler

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

* Re: suppress leading ":" in org-babel output
  2019-05-28  2:17 ` Nick Dokos
@ 2019-05-28 16:57   ` Berry, Charles
  2019-05-29 22:00     ` Nick Dokos
  2019-05-31  7:05   ` Jeremie Juste
  1 sibling, 1 reply; 6+ messages in thread
From: Berry, Charles @ 2019-05-28 16:57 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode@gnu.org



> On May 27, 2019, at 7:17 PM, Nick Dokos <ndokos@gmail.com> wrote:
> 
> Jeremie Juste <jeremiejuste@gmail.com> writes:
> 
>> Hello,
>> 
>> I recall seeing this thread on the mailing list but I cannot find it
>> back.
>> 
>> I would like to suppress the first line leading ":" in the following output
>> 
>> 
>> #+NAME:mean_purchase_per_shopping_trip
>> 
>> #+BEGIN_SRC R :var x=6 :results output :session *R*
>> a <-sprintf("%.2f",12.234324)
>> cat(a,sep="\n")
>> #+END_SRC
>> 
>> #+RESULTS: mean_purchase_per_shopping_trip
>> : 
>> 
>> : 12.23
>> 
> 
> FWIW, I just get the last line:
> 
> #+NAME:mean_purchase_per_shopping_trip
> 
> #+BEGIN_SRC R :var x=6 :results output :session *R*
> a <-sprintf("%.2f",12.234324)
> cat(a,sep="\n")
> #+END_SRC
> 
> #+RESULTS:
> : 12.23
> 
> This is with 
> 
>   GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32) of 2019-05-01
>   Org mode version 9.2.3 (release_9.2.3-367-gd79e80 @ /home/nick/elisp/org-mode/lisp/)
>   R version 3.5.3 (2019-03-11) -- "Great Truth"
> 
> on Fedora 29.
> 

I get what Jeremie reports (but he has a blank line inserted after the first line, IIUC)

This is with:

GNU Emacs 26.1 
Org 9.2.3
ess-version: 18.10.3
R version 3.6.0 (2019-04-26)

I believe this is new-ish behavior. I see some older files without the extra line. Also, I think there are recent changes in ESS that pertain to comint sessions.

FWIW, here is a clip from my session:

--8<---------------cut here---------------start------------->8---
> x <- 6L
a <-sprintf("%.2f",12.234324)
cat(a,sep="\n")
'org_babel_R_eoe'
> > 
12.23
> 
[1] "org_babel_R_eoe"
--8<---------------cut here---------------end--------------->8---


If Nick sees something different maybe a change in ESS is the culprit.

Not sure what the right path forward is ob-R.el, but as a workaround the OP can use a :post header arg to strip the offending line.

HTH,

Chuck

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

* Re: suppress leading ":" in org-babel output
  2019-05-28 16:57   ` Berry, Charles
@ 2019-05-29 22:00     ` Nick Dokos
  0 siblings, 0 replies; 6+ messages in thread
From: Nick Dokos @ 2019-05-29 22:00 UTC (permalink / raw)
  To: emacs-orgmode

"Berry, Charles" <ccberry@ucsd.edu> writes:

>> On May 27, 2019, at 7:17 PM, Nick Dokos <ndokos@gmail.com> wrote:
>> 
>> Jeremie Juste <jeremiejuste@gmail.com> writes:
>> 
>>> Hello,
>>> 
>>> I recall seeing this thread on the mailing list but I cannot find it
>>> back.
>>> 
>>> I would like to suppress the first line leading ":" in the following output
>>> 
>>> 
>>> #+NAME:mean_purchase_per_shopping_trip
>>> 
>>> #+BEGIN_SRC R :var x=6 :results output :session *R*
>>> a <-sprintf("%.2f",12.234324)
>>> cat(a,sep="\n")
>>> #+END_SRC
>>> 
>>> #+RESULTS: mean_purchase_per_shopping_trip
>>> : 
>>> 
>>> : 12.23
>>> 
>> 
>> FWIW, I just get the last line:
>> 
>> #+NAME:mean_purchase_per_shopping_trip
>> 
>> #+BEGIN_SRC R :var x=6 :results output :session *R*
>> a <-sprintf("%.2f",12.234324)
>> cat(a,sep="\n")
>> #+END_SRC
>> 
>> #+RESULTS:
>> : 12.23
>> 
>> This is with 
>> 
>>   GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32) of 2019-05-01
>>   Org mode version 9.2.3 (release_9.2.3-367-gd79e80 @ /home/nick/elisp/org-mode/lisp/)
>>   R version 3.5.3 (2019-03-11) -- "Great Truth"
>> 
>> on Fedora 29.
>> 
>
> I get what Jeremie reports (but he has a blank line inserted after the first line, IIUC)
>
> This is with:
>
> GNU Emacs 26.1 
> Org 9.2.3
> ess-version: 18.10.3
> R version 3.6.0 (2019-04-26)
>
> I believe this is new-ish behavior. I see some older files without the
> extra line. Also, I think there are recent changes in ESS that pertain
> to comint sessions.
>
> FWIW, here is a clip from my session:
>
>> x <- 6L
> a <-sprintf("%.2f",12.234324)
> cat(a,sep="\n")
> 'org_babel_R_eoe'
>> > 
> 12.23
>> 
> [1] "org_babel_R_eoe"
>
>
> If Nick sees something different maybe a change in ESS is the culprit.
>

Here's what I see in the session buffer:

,----
| > > if (identical(getOption('pager'), file.path(R.home('bin'), 'pager'))) options(pager='cat') # rather take the ESS one 
| > options(STERM='iESS', str.dendrogram.last="'", editor='emacsclient', show.error.locations=TRUE)
| > x <- 6L
| a <-sprintf("%.2f",12.234324)
| cat(a,sep="\n")
| 'org_babel_R_eoe'
| x <- 6L
| > a <-sprintf("%.2f",12.234324)
| > cat(a,sep="\n")
| 12.23
| > 'org_babel_R_eoe'
| [1] "org_babel_R_eoe"
| > 
`----

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler

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

* Re: suppress leading ":" in org-babel output
  2019-05-28  2:17 ` Nick Dokos
  2019-05-28 16:57   ` Berry, Charles
@ 2019-05-31  7:05   ` Jeremie Juste
  2019-05-31 16:46     ` suppress leading ":" in org-babel outputariBLE Berry, Charles
  1 sibling, 1 reply; 6+ messages in thread
From: Jeremie Juste @ 2019-05-31  7:05 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Hello,

Many thanks updating org-mode resolved the issue

Best regards,
Jeremie
> FWIW, I just get the last line:
>
> #+NAME:mean_purchase_per_shopping_trip
>
> #+BEGIN_SRC R :var x=6 :results output :session *R*
> a <-sprintf("%.2f",12.234324)
> cat(a,sep="\n")
> #+END_SRC
>
> #+RESULTS:
> : 12.23
>
> This is with 
>
>    GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32) of 2019-05-01
>    Org mode version 9.2.3 (release_9.2.3-367-gd79e80 @ /home/nick/elisp/org-mode/lisp/)
>    R version 3.5.3 (2019-03-11) -- "Great Truth"
>
> on Fedora 29.

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

* Re: suppress leading ":" in org-babel outputariBLE
  2019-05-31  7:05   ` Jeremie Juste
@ 2019-05-31 16:46     ` Berry, Charles
  0 siblings, 0 replies; 6+ messages in thread
From: Berry, Charles @ 2019-05-31 16:46 UTC (permalink / raw)
  To: Jeremie Juste; +Cc: Nick Dokos, emacs-orgmode@gnu.org

AFAICS, the latest update (99aa984) did NOT fix the issue.

There are complications in this story that I explain here.

If I start a fresh *R* session by eval'ing the src block, I get

#+RESULTS:
: 
: 12.23

and the *R* buffer ends with

--8<---------------cut here---------------start------------->8---
> x <- 6L
a <-sprintf("%.2f",12.234324)
cat(a,sep="\n")
'org_babel_R_eoe'
> > 
12.23
> 
[1] "org_babel_R_eoe"
> 
--8<---------------cut here---------------end--------------->8---


If I then open a buffer in ESS[R] mode and run ess-eval-line-visibly-and-step (e.g. by typing C-c C-n)

and then eval the src block again, I get 

#+RESULTS:
: 12.23

and the *R* buffer ends with

--8<---------------cut here---------------start------------->8---
> x <- 6L
a <-sprintf("%.2f",12.234324)
cat(a,sep="\n")
'org_babel_R_eoe'
> > 12.23
> [1] "org_babel_R_eoe"
> 
--8<---------------cut here---------------end--------------->8---


Presumably, a comint or ess variable has changed to effect these differences.

I am unable to discern what variable that is. 

I suspect that the changed behavior Jeremie sees now was do to something similar and that a fresh start will result in the extraneous line in the results.

:-(

Chuck


> On May 31, 2019, at 12:05 AM, Jeremie Juste <jeremiejuste@gmail.com> wrote:
> 
> Hello,
> 
> Many thanks updating org-mode resolved the issue
> 
> Best regards,
> Jeremie
>> FWIW, I just get the last line:
>> 
>> #+NAME:mean_purchase_per_shopping_trip
>> 
>> #+BEGIN_SRC R :var x=6 :results output :session *R*
>> a <-sprintf("%.2f",12.234324)
>> cat(a,sep="\n")
>> #+END_SRC
>> 
>> #+RESULTS:
>> : 12.23
>> 
>> This is with 
>> 
>>   GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32) of 2019-05-01
>>   Org mode version 9.2.3 (release_9.2.3-367-gd79e80 @ /home/nick/elisp/org-mode/lisp/)
>>   R version 3.5.3 (2019-03-11) -- "Great Truth"
>> 
>> on Fedora 29.
> 
> 

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

end of thread, other threads:[~2019-05-31 16:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-27  7:13 suppress leading ":" in org-babel output Jeremie Juste
2019-05-28  2:17 ` Nick Dokos
2019-05-28 16:57   ` Berry, Charles
2019-05-29 22:00     ` Nick Dokos
2019-05-31  7:05   ` Jeremie Juste
2019-05-31 16:46     ` suppress leading ":" in org-babel outputariBLE Berry, Charles

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).