From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: [babel] Re: org-babel-R and windows ? Date: Thu, 14 Jan 2010 12:39:05 -0500 Message-ID: <87tyuomvra.fsf_-_@stats.ox.ac.uk> References: <878wc3kyli.fsf@stats.ox.ac.uk> <874ompiyk2.fsf@stats.ox.ac.uk> <87hbqpkroz.fsf@mundaneum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NVTf8-0000nz-Mr for emacs-orgmode@gnu.org; Thu, 14 Jan 2010 12:39:14 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NVTf4-0000jf-PN for emacs-orgmode@gnu.org; Thu, 14 Jan 2010 12:39:14 -0500 Received: from [199.232.76.173] (port=52009 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NVTf4-0000jO-Es for emacs-orgmode@gnu.org; Thu, 14 Jan 2010 12:39:10 -0500 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:48799) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NVTf3-0000e8-Uy for emacs-orgmode@gnu.org; Thu, 14 Jan 2010 12:39:10 -0500 In-Reply-To: <87hbqpkroz.fsf@mundaneum.com> (=?utf-8?Q?=22S=C3=A9bastien?= Vauban"'s message of "Thu, 14 Jan 2010 09:37:32 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?utf-8?Q?S=C3=A9bastien?= Vauban Cc: emacs-orgmode@gnu.org S=C3=A9bastien Vauban writes: > Hi Dan, > > Dan Davison wrote: >> "d.tchin" writes: >>> Dan Davison stats.ox.ac.uk> writes: >>>> The org-babel default is to invoke R as an external shell command, and= I >>>> think this is what is causing the problem. It requires that the emacs >>>> function shell-command can use the string "R" to invoke an R process, = i.e. >>>> the R installation and the shell path must be such that this is the ca= se. >>> >>> Thank you for the information and explanation. It seems that the problem >>> comes from the windows shell. >>> >>> I try the following : I explicitely told emacs to use bash >>> with the following instructions : >>> (setq explicit-shell-file-name "C:/msys/1.0/bin/bash.exe") >>> (setq shell-file-name explicit-shell-file-name) >>> >>> It works with bash. >> >> Thanks for that, I've stored your solution in the org-babel development = repo >> with a view to modifying our code so that these probloems are minimised = in >> the future, and we'll also make sure the documentation addresses this. > > I'm a Windows user *and* an Ubuntu user for years, now, with one single c= ommon > `.emacs' file for both OS. > > Therefore, I'll show you what I have in my `.emacs': > > ;;*** ----[ 41.1 Single Shell > > ;; for single shell commands > (setq shell-file-name "bash") ;; must be in the `PATH' (Windows users) > > > ;;*** ----[ 41.2 Interactive Shell > > ;; for the interactive (sub)shell > (setq explicit-shell-file-name shell-file-name) > > Almost the same, except the order (not important) and the fact that bash = is > written in its simplest form: no hard-coded path, and no `.exe' suffix, so > that it works for both Win32 and Linux. > > The only thing to do, for Windows users, is ensure that `bash.exe' (gener= ally > located in `C:\cygwin\bin') is in the Windows PATH environment variable. > > I would advice keeping such a construct, instead of full paths. Thanks Seb, That's really helpful. I'm really ignorant about this Windows stuff. So let me get the basics straight: is it the case that, if a user does *not* have a UNIX emulation environment installed under Windows (e.g. cygwin, msys, mingw?) then there is no way that org-babel external shell evaluation is going to work? Or does that statement need to be qualified according to language (R, shell, ruby, ...)? I.e., when a Windows user just has emacs and the native windows/dos shell, are these things just not going to work? Dan > > Best regards, > Seb