From dcaeecc78507eb5b9ea22b60b3a84f541d7ba543 Mon Sep 17 00:00:00 2001 From: Konrad Hinsen Date: Thu, 23 Aug 2018 09:32:13 +0200 Subject: [PATCH] New default setting for the Python executable under Windows --- module2/ressources/rr_org/init.el | 23 +++++++++++++++----- module2/ressources/rr_org/init.org | 34 ++++++++++++++++++------------ 2 files changed, 38 insertions(+), 19 deletions(-) diff --git a/module2/ressources/rr_org/init.el b/module2/ressources/rr_org/init.el index 02fb613..a2eca42 100644 --- a/module2/ressources/rr_org/init.el +++ b/module2/ressources/rr_org/init.el @@ -1,13 +1,26 @@ ;; Machine-dependent configuration - adapt as required for your computer! -;; If a full path to the interpreter is used, be careful it if contains spaces -;; (which seems to be typical for Windows and not rare for macOS). The path +;; Executables for Python and R + +;; Default setting: Use "python3" under Linux and macOS, but "Python" under Windows. +;; The default for R is "R" for all platforms (predefined by Emacs). +(setq org-babel-python-command + (if (memq system-type '(windows-nt ms-dos)) + "Python" + "python3")) + +;; If the Python and R executables are on your system's search path, +;; you should not have to modify anything here. If Emacs does not find +;; Python or R, or if it uses a different version of Python or R than you +;; expect, you can uncomment these two lines (one for Python, one for R) +;; and modify them to point to the executables. + +;; Python +;; Be careful if the path to your Python installation contains spaces. The path ;; must then be surrounded by backslash-escaped quotation marks, as in ;; (setq org-babel-python-command "\"C:/Program Files/Python/Python37/python.exe\"") -(setq org-babel-python-command "python3") -;; For Unix-like systems, this can be normally left commented out. Under Windows, -;; insert the path to your R interpreter. +;; R ;; (setq inferior-R-program-name "C:/Program Files/R/R-3.5.1/bin/x64/Rterm.exe") (require 'org) diff --git a/module2/ressources/rr_org/init.org b/module2/ressources/rr_org/init.org index 9a19c03..46e7838 100644 --- a/module2/ressources/rr_org/init.org +++ b/module2/ressources/rr_org/init.org @@ -20,27 +20,33 @@ of this file]]. If you ever want to regenerate if from this org document, simply =M-x org-babel-tangle=. * Machine-dependent configuration -For Linux, macOS, and other Unix-like systems, the following settings will probably work fine. If you use Windows, or if running Python and/or R code from OrgMode fails with an error message, please replace "python3" by the full path to your Python interpreter. - #+begin_src emacs-lisp :tangle init.el ;; Machine-dependent configuration - adapt as required for your computer! -#+end_src -** Python -*** We use python3 -#+begin_src emacs-lisp :tangle init.el -;; If a full path to the interpreter is used, be careful it if contains spaces -;; (which seems to be typical for Windows and not rare for macOS). The path +;; Executables for Python and R + +;; Default setting: Use "python3" under Linux and macOS, but "Python" under Windows. +;; The default for R is "R" for all platforms (predefined by Emacs). +(setq org-babel-python-command + (if (memq system-type '(windows-nt ms-dos)) + "Python" + "python3")) + +;; If the Python and R executables are on your system's search path, +;; you should not have to modify anything here. If Emacs does not find +;; Python or R, or if it uses a different version of Python or R than you +;; expect, you can uncomment these two lines (one for Python, one for R) +;; and modify them to point to the executables. + +;; Python +;; Be careful if the path to your Python installation contains spaces. The path ;; must then be surrounded by backslash-escaped quotation marks, as in ;; (setq org-babel-python-command "\"C:/Program Files/Python/Python37/python.exe\"") -(setq org-babel-python-command "python3") -#+end_src -** R -#+begin_src emacs-lisp :tangle init.el -;; For Unix-like systems, this can be normally left commented out. Under Windows, -;; insert the path to your R interpreter. + +;; R ;; (setq inferior-R-program-name "C:/Program Files/R/R-3.5.1/bin/x64/Rterm.exe") #+end_src + * Loading files: ** Loading babel: :ARNAUD: #+begin_src emacs-lisp :tangle init.el -- 2.18.1