emacs-orgmode
[Top][All Lists]
Advanced

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

Re: Seeing all the steps when I run an R code block


From: Jeremie Juste
Subject: Re: Seeing all the steps when I run an R code block
Date: Sun, 27 Nov 2022 12:38:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)

Hello William,

Many thanks for reporting.

>
> I think this specific issue might be solved on Org side.
> We can let-bind `ess-startup-directory' to 'default-directory while
> running R source blocks.
>
> CCing the maintainer.
Ihor, many thanks for the suggestion. However I'm not sure it will work
here. The issue is that sometimes ESS has many ways of doing the same
thing so finding a middle ground is more challenging.

A possible configuration related to the point above for ESS is to do the
following

(setq ess-startup-directory nil)

(describe-variable  'ess-startup-directory)


which regardless of the value in the 'default-directory, will start the
R process in the current project directory

With the configuration above org-mode does not have any issues finding
the current directory. For instance

If I move following file test.org in the directory
/home/djj/Documents/projects/R. And run the code chunk I get.

#+begin_src R
  getwd()
#+end_src

#+RESULTS:
: /home/djj/Documents/projects/R


Moving it to /tmp/test/, I get
#+begin_src R
  getwd()
#+end_src

#+RESULTS:
: /tmp/test


Note also that you can force the R process to start in a particular
directory with the dir parameter.

#+begin_src R :dir ~/
  getwd()
#+end_src

#+RESULTS:
: /home/djj


Now on the org-mode side. This is becomes tricky because I don't know
what users expects. For now this issue is delegated to the ESS configuration.
Is the present state a satisfactory one? Please voice out your opinion.

Hope this help, 
Jeremie



reply via email to

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