From: "Sébastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: [babel] Re: org-babel-R and windows ?
Date: Thu, 14 Jan 2010 20:39:31 +0100 [thread overview]
Message-ID: <87y6k0328c.fsf@mundaneum.com> (raw)
In-Reply-To: 87tyuomvra.fsf_-_@stats.ox.ac.uk
Hi Dan,
Dan Davison wrote:
> Sébastien Vauban <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:
>> Dan Davison wrote:
>>> "d.tchin" <d.tchin-7V4A5QgKqXk@public.gmane.org> writes:
>>>> Dan Davison <davison <at> 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
>>>>> case.
>>>>
>>>> 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
>> common `.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'
>> (generally 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.
You're (more than) welcome. My goal is the same as yours: making this whole
stuff more open, more easy, more powerful, and more reliable. Do I miss
something? ;-))
> 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?
I have to be honest. I will give more impressions than facts, for the simple
reason that Cygwin is well implanted in my Windows, and that for more than 10
years now: I began using Emacs in 1999, and have Cygwin bundled with it since
then (as Windows is pretty useless without a better shell than `cmd.exe').
So, trying to answer your question, I would split it in two parts:
- calling scripts,
- calling applications with some data or description.
First case: script written for the shell. Without cygwin, your interpreter is
`cmd.exe', so pretty limited. And, here, we come back to one question I had
some weeks ago about which interpreter is chosen when executing the snippet:
bash, Zsh, etc. Same problem here, with a third possible command interpreter.
Second case: "applications" like R, ditaa, etc. There, I don't see any problem
for calling them with some data to feed them. The only real condition is that
the program must be found in the PATH (or the full path to the executable has
to be given).
Am I answering you in the intended way? Do you want me to make some tests?
Don't hesitate...
Best regards,
Seb
--
Sébastien Vauban
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
next prev parent reply other threads:[~2010-01-14 19:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-12 13:24 org-babel-R and windows ? d.tchin
2010-01-12 14:56 ` [babel] " Giovanni Ridolfi
2010-01-12 17:05 ` Manish
2010-01-12 17:43 ` Dan Davison
2010-01-12 18:05 ` Eric Schulte
2010-01-13 4:16 ` Manish
2010-01-13 9:20 ` d.tchin
2010-01-13 19:39 ` Dan Davison
2010-01-14 8:37 ` Sébastien Vauban
2010-01-14 17:39 ` [babel] " Dan Davison
2010-01-14 19:39 ` Sébastien Vauban [this message]
2010-01-15 9:32 ` Stefan Vollmar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y6k0328c.fsf@mundaneum.com \
--to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
--cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.