If I make a new org file:
#+begin_src R getwd() #+end_src #+begin_src R :session getwd() #+end_src When I execute the first block, I do not get asked for the "R starting project directory" but I do in the second block.
I am confused to where the value I enter for the R starting project directory is stored and how to reset it?
If I set the value for this org file then if I close the file and close emacs and reopen it still does not ask me for it again it just remembers what I entered last time. I want to change this value for an existing org file I do not know how to do this other then making a new org file and answering the question differntly.
info:
GNU Emacs 29.3 (build 1, aarch64-apple-darwin21.6.0, NS appkit-2113.60 Version 12.6.6 (Build 21G646)) of 2024-03-24
On Mac os
It might be something to do with Git and ESS?
I tried to trace (following chatgpt instrucions):
org-babel-execute-src-block:
Run M-x debug-on-entry RET org-babel-execute-src-block RET.
I then saw:
* ess--project-root((vc Git "~/Documents/sc_pd_ras_dop/")) Which is the dir that it is defaulting to, by inserting :
setwd('~/Documents/sc_pd_ras_dop') In the R buffer.
I think these variables might also be relevant?
If I open my org file which does not ask for the dir and try and describe the vars I get:
ess-ask-for-ess-directory nil
ess-startup-directory t
UPDATE
I think I was mistaken above. The issue I am having with sessions seems to do with setting a dir in the src code block.
if I have:
#+begin_src R :session new getwd() #+end_src I get prompted for my R starting project directory
if I have:
#+begin_src R :session new :dir "~" getwd() #+end_src #+RESULTS: : /Users/myusername Which is my home dir
but if I have:
#+begin_src R :session new :dir "." getwd() #+end_src #+RESULTS: : /Users/myusername/Documents/myproject Which is maybe the project dir that ess is getting because of git? my org file is located in
/Users/myusername/Documents/myproject/scripts/org so I think it is defaulting to the project-dir from ess.
if I have
#+begin_src R :session new :dir "./scripts" getwd() #+end_src #+RESULTS: : /Users/myusername/Documents/myproject and if i have
#+begin_src R :session new :dir "scripts" getwd() #+end_src #+RESULTS: : /Users/myusername/Documents/myproject But If i have
#+begin_src R :dir . getwd() #+end_src #+RESULTS: : /Users/myusername/Documents/myproject/scripts/org That is without a session it seems to do what I expect
/tmp, I can run them both and they both produce/tmpwithout asking me anything. IOW, the only thing that matters AFAICS is the directory where the Org mode file is located.