Re: IDL 6.3 Intel in Mac + IDLWAVE + graphics = CRASH [message #50288 is a reply to message #50107] |
Tue, 19 September 2006 10:26  |
JD Smith
Messages: 850 Registered: December 1999
|
Senior Member |
|
|
On Wed, 13 Sep 2006 12:08:24 -0700, jgc wrote:
>
>> Your solution is to do whatever it is you need to do to get the DISPLAY
>> variable set in the shell environment in which IDLWAVE is running. My
>> wild guess is that you are starting emacs/IDLWAVE from either a Terminal
>> app or some desktop shortcut and you're not getting the DISPLAY variable
>> set.
>>
>> Karl
>
> That makes sense and it was so simple!
>
> It works beautifully now
> alias Emacs='/Applications/Emacs.app/Contents/MacOS/Emacs &'
> and calling it from the xterminal.
>
> Many, many thanks and apologies for being so thick.
The other option for setting global system-wide environment variables,
is to use environment.plist, which would also fix this. This is a
"plist" XML type file, but a simple way to set DISPLAY there is like
this:
% mkdir ~/.MacOSX
% defaults write ~/.MacOSX/environment DISPLAY :0
Now *all* processes will have this in their environment, no matter how
they were opened.
As a side note, if you use fast user switching, :0 may not always be
correct here (since each X11 process increments it, e.g. :1 for the second
user to run X11 simultaneously). The following trick should work in that
case, especially if you have X11 start up automatically on login:
http://lists.sourceforge.jp/mailman/archives/macemacsjp-engl ish/2006-June/000586.html
In IDL, you should check what environment variables are set with:
IDL> print,getenv('DISPLAY')
rather than $env, since that first starts a shell (which may define
environment through configuration files which the IDL process itself does
not share).
Another simple fix (for IDL only) would be to put:
setenv,'DISPLAY=:0'
in your IDL startup file.
BTW, this issue only applies to "Emacs.app" carbon app on OSX, which is
run directly by the OS. In that case, IDLWAVE and the IDL process
are run in an environment which does not know about X11, which of
course IDL needs. Those of you who (like me) still use Emacs under X11
should be fine.
JD
|
|
|