[R-SIG-Mac] Cocoa GUI feature request (with patch!)

Simon Urbanek simon.urbanek at math.uni-augsburg.de
Fri Oct 22 00:22:11 CEST 2004


On Oct 21, 2004, at 10:40 PM, Tamas K Papp wrote:

> On Thu, Oct 21, 2004 at 12:11:16PM -0700, Byron Ellis wrote:
>
>> Of course---I had just placed ESS into the category of First (and Most
>> Venerable) of the Unbundled GUIs as opposed to "command-line R." The
>> rest of us will be playing catch-up with ESS for long time :-)
>
> It would be really nice if ESS users on OS X could make full use of
> the new quartz() device of R.

Just to complete this with the distilled version of our previous 
communication with Tamas for those interested in such project:

The main problem is that Quartz needs a regular Apple CF event loop to 
be run in the same process that Quartz runs in (on the primary thread). 
The regular R binary as executed in Terminal or by Emacs doesn't do 
that, that's why Quartz' events are not handled and thus the Quartz 
window is basically dead. The R binary cannot run the CF loop by 
default, because then you couldn't run R in a shell like ssh.

There are many possible approaches to fix this - link R into Emacs (I'm 
talking Carbon version of course) and use the API similar to what R.app 
does (I don't know Emacs well enough from developer's point of view, 
but I assume it allows loading of shared libraries as modules). 
Alternatively it may be possible to write an R package that runs a CF 
loop, but I'm not sure how well this could cooperate with the existing 
R loop. Finally one could use a very stripped version of R.app that 
would actually not show any window, but communicate via stdin/out 
instead.

Personally I think it's not a good use of resources, because the 
Emacs+ESS combo is just too clumsy and antagonistic for a modern 
environment like OS X [flame away], but that's a matter of taste I 
guess ;) [yes, I was a happy Emacs user, but that was on Linux where 
you really have no choice :P]

Cheers,
Simon



More information about the R-SIG-Mac mailing list