Re: [BUG] ob-R: session evaluation returns empty ouputs with Org 9.6 [9.6 ( @ /home/fsantos/.emacs.d/elpa/org-9.6/)]

2022-12-07 Thread Jeremie Juste


Hello Malcolm,

On Wednesday,  7 Dec 2022 at 17:50, Cook, Malcolm wrote:
>
> Byte-compiling and reloading ob-R.el worked.

Glad that you could solve it. From 08433d9b0, I added a test to make sure we 
are not
surprised again. 

Best regards,
Jeremie





RE: [BUG] ob-R: session evaluation returns empty ouputs with Org 9.6 [9.6 ( @ /home/fsantos/.emacs.d/elpa/org-9.6/)]

2022-12-07 Thread Cook, Malcolm
>"Cook, Malcolm"  writes:
>
>> I tried applying just the change in 
>> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=456462741 to 
>> released Org 9.6 and find that when using `:session *R*` the #+RESULTS are 
>> still empty, but when running without :session the results are provided.
>
>Could you please elaborate what you mean by "just the change"? This
>change is a fix on top of another change we included in Org 9.6.

Of course

I manually edited ob-comint.el and inserted the lines marked with a '+' from 
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=456462741 
(removing the '+') in the right place, and re-evaluated the now modified 
function definition (went to end of defun and hit C-x C-e)

Doh!  

It is a macro not a defun, so simply redefining it will not effect where it was 
used.  

My bad.

Byte-compiling and reloading ob-R.el worked.

So, answering your question revealed my error.

Thanks.

I look forward to the fix finding elpa.

Cheers,

Malcolm




RE: [BUG] ob-R: session evaluation returns empty ouputs with Org 9.6 [9.6 ( @ /home/fsantos/.emacs.d/elpa/org-9.6/)]

2022-12-07 Thread Ihor Radchenko
"Cook, Malcolm"  writes:

> I tried applying just the change in 
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=456462741 to 
> released Org 9.6 and find that when using `:session *R*` the #+RESULTS are 
> still empty, but when running without :session the results are provided.

Could you please elaborate what you mean by "just the change"? This
change is a fix on top of another change we included in Org 9.6.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



RE: [BUG] ob-R: session evaluation returns empty ouputs with Org 9.6 [9.6 ( @ /home/fsantos/.emacs.d/elpa/org-9.6/)]

2022-12-06 Thread Cook, Malcolm
Hi,

I tried applying just the change in 
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=456462741 to 
released Org 9.6 and find that when using `:session *R*` the #+RESULTS are 
still empty, but when running without :session the results are provided.

Is there any diagnostic or reprex I can provide to demonstrate that it persists?

~ malcolm_c...@stowers.org
From: emacs-orgmode-bounces+mec=stowers@gnu.org 
 On Behalf Of Ihor Radchenko
Sent: Friday, December 2, 2022 12:03 AM
To: William Denton 
Cc: Frédéric Santos ; emacs-orgmode@gnu.org
Subject: Re: [BUG] ob-R: session evaluation returns empty ouputs with Org 9.6 
[9.6 ( @ /home/fsantos/.emacs.d/elpa/org-9.6/)]

Ihor Radchenko mailto:yanta...@posteo.net>> writes:

> It looks like there is something wrong with comint-prompt-regexp in R
> buffers. It somehow does not match the prompt.
>
> I will need to look further.

Fixed on bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=456462741<https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=456462741>

--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/<https://orgmode.org>>.
Support Org development at 
<https://liberapay.com/org-mode<https://liberapay.com/org-mode>>,
or support my work at 
<https://liberapay.com/yantar92<https://liberapay.com/yantar92>>


Re: [BUG] ob-R: session evaluation returns empty ouputs with Org 9.6 [9.6 ( @ /home/fsantos/.emacs.d/elpa/org-9.6/)]

2022-12-03 Thread Jeremie Juste


Hello Ihor,

On Friday,  2 Dec 2022 at 06:02, Ihor Radchenko wrote:>
> Fixed on bugfix.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=456462741


Many thanks to you all for helping solve this issue.
I apologise for the delayed response. From ffb30cd7373, I added two
tests to make sure this issue does not happen again in ob-R.


Best regards,
Jeremie




Re: [BUG] ob-R: session evaluation returns empty ouputs with Org 9.6 [9.6 ( @ /home/fsantos/.emacs.d/elpa/org-9.6/)]

2022-12-02 Thread Ihor Radchenko
Ihor Radchenko  writes:

> It looks like there is something wrong with comint-prompt-regexp in R
> buffers. It somehow does not match the prompt.
>
> I will need to look further.

Fixed on bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=456462741

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] ob-R: session evaluation returns empty ouputs with Org 9.6 [9.6 ( @ /home/fsantos/.emacs.d/elpa/org-9.6/)]

2022-12-01 Thread Ihor Radchenko
Greg Minshall  writes:

> Ihor will know, but i *think* that without :session, there is no R
> "shell" running, so the ...-prompt-regexp isn't used.  rather (do i know
> this?  assume this?), an R script is prepared and executed.

You are right.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] ob-R: session evaluation returns empty ouputs with Org 9.6 [9.6 ( @ /home/fsantos/.emacs.d/elpa/org-9.6/)]

2022-12-01 Thread Berry, Charles



> On Nov 30, 2022, at 5:48 PM, Ihor Radchenko  wrote:
> 
> William Denton  writes:
> 
>> I tried that, but it didn't fix it. :(
> 
> Ok. I was able to reproduce on my side.
> 
>> With a minimal setup, running the R block with a :session makes it ask where 
>> the 
>> working directory should be (the default in the prompt is the directory the 
>> test 
>> Org file is in).  Setting ess-startup-directory to 'default-directory 
>> doesn't 
>> change that, or the output problem.
> 
> It looks like there is something wrong with comint-prompt-regexp in R
> buffers. It somehow does not match the prompt.
> 
> I will need to look further.
> 

The older (commit bed47b437d8cde7a98bafdb07996e248b40f70e6e) version of 
org-babel-comint-with-output used comint-prompt-regexp and works fine.

I don't really follow how `org-babel-comint-prompt-separator` gets set to 
something useful in the current version. 

Reverting org-babel-comint-with-output to that older commit (and eval-ing the 
defun for org-babel-R-evaluate-session) seems to fix this case for those who 
need `:results output` in R src blocks till this gets sorted out.

HTH,

Chuck



Re: [BUG] ob-R: session evaluation returns empty ouputs with Org 9.6 [9.6 ( @ /home/fsantos/.emacs.d/elpa/org-9.6/)]

2022-12-01 Thread Greg Minshall
Frederic,

> > It looks like there is something wrong with comint-prompt-regexp in
> > R buffers. It somehow does not match the prompt.
> 
> I'm not sure it's the explanation either, since external (i.e.,
> non-session) evaluation works as expected. (Just remove the ":session
> *R*" part of the header, and you'll see everything is okay.)

Ihor will know, but i *think* that without :session, there is no R
"shell" running, so the ...-prompt-regexp isn't used.  rather (do i know
this?  assume this?), an R script is prepared and executed.

cheers, Greg



Re: [BUG] ob-R: session evaluation returns empty ouputs with Org 9.6 [9.6 ( @ /home/fsantos/.emacs.d/elpa/org-9.6/)]

2022-11-30 Thread Frederic Santos
- Mail original -
> De: "Ihor Radchenko" 
> À: "William Denton" 
> Cc: "Frederic Santos" , "emacs-orgmode" 
> 
> Envoyé: Jeudi 1 Décembre 2022 02:48:22
> Objet: Re: [BUG] ob-R: session evaluation returns empty ouputs with Org 9.6 
> [9.6 ( @
> /home/fsantos/.emacs.d/elpa/org-9.6/)]

> It looks like there is something wrong with comint-prompt-regexp in R
> buffers. It somehow does not match the prompt.

I'm not sure it's the explanation either, since external (i.e., non-session) 
evaluation works as expected. (Just remove the ":session *R*" part of the 
header, and you'll see everything is okay.) Thus, I guess this implies that R 
prompts are correctly recognized (?).
Also, an important difference between external and session eval is that session 
eval uses ESS, and external eval does not. So it *might* be an ESS-related 
issue, but since everything works fine with Org 9.5.5 and the latest ESS 
version, I wouldn't bet on that.



Re: [BUG] ob-R: session evaluation returns empty ouputs with Org 9.6 [9.6 ( @ /home/fsantos/.emacs.d/elpa/org-9.6/)]

2022-11-30 Thread Ihor Radchenko
William Denton  writes:

> I tried that, but it didn't fix it. :(

Ok. I was able to reproduce on my side.

> With a minimal setup, running the R block with a :session makes it ask where 
> the 
> working directory should be (the default in the prompt is the directory the 
> test 
> Org file is in).  Setting ess-startup-directory to 'default-directory doesn't 
> change that, or the output problem.

It looks like there is something wrong with comint-prompt-regexp in R
buffers. It somehow does not match the prompt.

I will need to look further.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] ob-R: session evaluation returns empty ouputs with Org 9.6 [9.6 ( @ /home/fsantos/.emacs.d/elpa/org-9.6/)]

2022-11-30 Thread William Denton

On 1 December 2022, Ihor Radchenko wrote:


With Org 9.6 released yesterday, I noticed a bug with ob-R: all R code
blocks with ":results output :session *R*" in the header will return no
output at all (although the code is correctly processed in the inferior
ESS buffer).


May it be a duplicate of
https://orgmode.org/list/87bkoxj50h.fsf@localhost?

I did not test this report itself, but if my guess is correct, setting
`ess-startup-directory' to 'default-directory might be a temporary
workaround until we find the fix to this breaking change in ESS.


I tried that, but it didn't fix it. :(

With a minimal setup, running the R block with a :session makes it ask where the 
working directory should be (the default in the prompt is the directory the test 
Org file is in).  Setting ess-startup-directory to 'default-directory doesn't 
change that, or the output problem.


Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada



Re: [BUG] ob-R: session evaluation returns empty ouputs with Org 9.6 [9.6 ( @ /home/fsantos/.emacs.d/elpa/org-9.6/)]

2022-11-30 Thread Ihor Radchenko
Frédéric Santos  writes:

> Hi everyone,
>
> With Org 9.6 released yesterday, I noticed a bug with ob-R: all R code
> blocks with ":results output :session *R*" in the header will return no
> output at all (although the code is correctly processed in the inferior
> ESS buffer).

May it be a duplicate of
https://orgmode.org/list/87bkoxj50h.fsf@localhost?

I did not test this report itself, but if my guess is correct, setting
`ess-startup-directory' to 'default-directory might be a temporary
workaround until we find the fix to this breaking change in ESS.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



RE: [BUG] ob-R: session evaluation returns empty ouputs with Org 9.6 [9.6 ( @ /home/fsantos/.emacs.d/elpa/org-9.6/)]

2022-11-30 Thread Cook, Malcolm


>Bug confirmed by other ESS users on the mailing list:
>https://stat.ethz.ch/pipermail/ess-help/2022-November/013162.html

FWIW: confirmed here too with

GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 
1.15.12, Xaw3d scroll bars) of 2022-01-19
Org mode version 9.6-pre (release_9.5.5-1136-gf78dfe @ 
/home/mec/.emacs.d/org-mode/lisp/)
ess-version: 18.10.3snapshot [elpa: 20221124.756] (loaded from 
/home/mec/.emacs.d/elpa/ess-20221124.756/)

~ malcolm_c...@stowers.org




[BUG] ob-R: session evaluation returns empty ouputs with Org 9.6 [9.6 ( @ /home/fsantos/.emacs.d/elpa/org-9.6/)]

2022-11-30 Thread Frédéric Santos
Hi everyone,

With Org 9.6 released yesterday, I noticed a bug with ob-R: all R code
blocks with ":results output :session *R*" in the header will return no
output at all (although the code is correctly processed in the inferior
ESS buffer).

Steps to follow to reproduce the issue:

1. Create a minimal init.el file with this content (adapting paths if needed):

(add-to-list 'load-path "~/.emacs.d/elpa/org-9.6/")
(require 'org)
(add-to-list 'load-path "~/.emacs.d/elpa/ess-20221124.756/")
(require 'ess-site)
(org-babel-do-load-languages
 'org-babel-load-languages
 '((org . t)
   (R . t)))

2. Open emacs -Q -l init.el

3. Create an Org document with this content:

#+begin_src R :results output :session *R*
x <- 2:4
print(x)
#+end_src

4. Try to evaluate the R code block: you'll only get an empty output.

Note that external eval (i.e., without the :session arg) still works as
expected, and that other results types (e.g., :results value) still work
as well.

Bug confirmed by other ESS users on the mailing list:
https://stat.ethz.ch/pipermail/ess-help/2022-November/013162.html

Version info:

Emacs  : GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, 
cairo version 1.17.6) of 2022-09-12
Org: Org mode version 9.6 ( @ /home/fsantos/.emacs.d/elpa/org-9.6/)
ESS: ess-version: 18.10.3snapshot [elpa: 20221124.756]