[macemacsjp-english 589] Re: graphical windows using ESS and R

Back to archive index

Kasper Daniel Hansen khans****@stat*****
Wed Jun 14 08:19:55 JST 2006


On Jun 13, 2006, at 2:36 PM, Peter Dyballa wrote:

>
> Am 13.06.2006 um 16:53 schrieb Nick Reich:
>
>> Are there other modifications I need to make for the X11 server to be
>> recognized by CarbonEmacs?
>
> It seems DISPLAY must be set in the process environment of Carbon
> Emacs. So it would be needed set in ~/.MacOSX/environment.plist ...

I must have forgotten how I solved the problem, it was some time ago.

I am sure Peter's suggestion below makes sense. It seems to have the  
advantage that X11 will work with all Emacs stuff, not just R.  
However, I am certain this is not how I did it.

After going through my configuration files I think the following id  
the solution: create (or modify) the file ~/.Rprofile, to contain  
something like

if(Sys.getenv("DISPLAY") == "")
   Sys.putenv("DISPLAY" = ":0.0")

The reason why you do not get an X11 window after modifying your  
DISPLAY setting is probably because the default plotting device was  
set up as you started R, but after ~/.Rprofile has been read. I would  
assume that the following would work from an R session

R> Sys.putenv(DISPLAY = ":0.0")
R> x11()

since it specifically asks for an X11 device. What you get out of  
the .Rprofile is just that your default plot device gets altered.

If this still does not work, I must look through my configuration  
again ... :)

/Kasper

>
> You can modify ~/.xinitrc to write DISPLAY into ~/.MacOSX/
> environment.plist when X11 is launched, and delete it when X11 quits:
>
> 	defaults write ${HOME}/.MacOSX/environment "DISPLAY" $DISPLAY		#
> near the beginning
> 	...
> 	( quartz-wm ; defaults delete ${HOME}/.MacOSX/environment
> "DISPLAY" )	# last line best
>
> You would need to launch Carbon Emacs after X11 was launched. In case
> you're the only user on the Mac you can invoke the line
>
> 	defaults write ${HOME}/.MacOSX/environment "DISPLAY" :0
>
> once and for the time following DISPLAY will be set in all Quartz
> applications launched afterwards.
>
> --
> Greetings
>
>    Pete
>
> »¿ʇı̣ əsnqɐ ʇ,uɐɔ noʎ ɟı̣
> ɓuı̣ɥʇʎuɐ sı̣ pooɓ ʇɐɥʍ«
>
>
> _______________________________________________
> macemacsjp-english mailing list
> macem****@lists*****
> http://lists.sourceforge.jp/mailman/listinfo/macemacsjp-english




More information about the macemacsjp-english mailing list
Back to archive index