[OS X Emacs] NeXT emacs sets $DISPLAY

xah lee xah at xahlee.org
Sun Jan 20 07:55:17 EST 2008


i don't have the file “~/.MacOSX/environment.plist”.

just to be more complete and clear, here's the symptom:

1. start NeXT emacs by clicking its icon in Finder.
2. Type “M-! echo $DISPLAY”
3. it shows xah5.local

The verison i'm using is
GNU Emacs 23.0.60.1 (powerpc-apple-darwin7.9.0, *Step 9.0rc3) of  
2007-11-24 on applecore.inf.ed.ac.uk

---------
Now, start it from Terminal with:

/Applications/Emacs2.app/Contents/MacOS/Emacs -q &

(i named it Emacs2.app since i already have Carbon emacs as Emacs.app)

same thing happens.

------------

This doesn't happen with Carbon emacs, either starting from icon or  
from Terminal with -q.

----------------------------

here's the complete env var from “M-! env” when starting from  
terminal
/Applications/Emacs2.app/Contents/MacOS/Emacs -q &

MANPATH=/sw/share/man:/usr/share/man:/usr/X11R6/man:/sw/lib/ 
perl5/5.8.6/man:/usr/local/man/
TERM_PROGRAM=Apple_Terminal
XDG_DATA_HOME=/Users/xah/.local/share
TERM=dumb
SHELL=/bin/bash
PERL5LIB=/sw/lib/perl5:/sw/lib/perl5/darwin
EMACSDATA=/Applications/Emacs2.app/Contents/Resources/etc
CVSROOT=/Users/xah/genja
TERM_PROGRAM_VERSION=133
EMACSPATH=/Applications/Emacs2.app/Contents/MacOS/bin
SGML_CATALOG_FILES=/sw/etc/sgml/catalog
USER=xah
GDK_USE_XFT=1
__CF_USER_TEXT_ENCODING=0x1F6:0:0
GNOME_DISABLE_CRASH_DIALOG=1
XDG_CONFIG_DIRS=/sw/etc/xdg
PATH=/usr/local/bin:/sw/bin:/sw/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/ 
usr/X11R6/bin:/opt/local/bin:/Developer/Tools
XML_CATALOG_FILES=/sw/etc/xml/catalog
_=/usr/bin/env
PWD=/Users/xah
LANG=en_US.UTF-8
EMACSLOADPATH=/Applications/Emacs2.app/Contents/Resources/site-lisp:/ 
Applications/Emacs2.app/Contents/Resources/lisp:/Applications/ 
Emacs2.app/Contents/Resources/leim
SHLVL=2
HOME=/Users/xah
XDG_CONFIG_HOME=/Users/xah/.config
XDG_CACHE_HOME=/Users/xah/.cache
LOGNAME=xah
XDG_DATA_DIRS=/sw/share
INFOPATH=/sw/share/info:/sw/info:/usr/share/info
DISPLAY=xahg5.local
SECURITYSESSIONID=919a20
EMACSDOC=/Applications/Emacs2.app/Contents/Resources/etc

---------------------

   Xah
   xah at xahlee.orghttp://xahlee.org/


On Jan 19, 2008, at 2:14 AM, Adrian Robert wrote:

On Jan 19, 2008 9:54 AM, xah lee <xah at xahlee.org> wrote:
> the NeXT Emacs seems to have quite a few problems that's frustrating.
>
> The problem is that when i run a shell comman for povray file, e.g.
> /usr/local/bin/povray mypov.pov
>
> it runs fine in Carbon emacs but in NeXT emacs it says
> "File Init Error:  The display 'xahg5.local' is not a valid display,
> or you do
>   not have permission to open a window there.
> "
>
> after 20 minutes of puzzling on this (among hours of elisping and
> trying to learn/fix/debug/test etc), it turns out it sets my shell
> $DISPLAY to "xahg5.local".
>
> Why is it setting my display?

Hi,

Could be a stale "~/.MacOSX/environment.plist".  Do a search on this
list for discussions.  You can either run
/path/to/Emacs.app/Contents/MacOS/bin/mac-fix-env , or run M-x
ns-grabenv (or run that in your .emacs) to fix this problem.  This is
covered in the manual (first entry under Help menu).

I'm not sure why you don't experience the problem under Carbon emacs.
Aquamacs does the equivalent of ns-grabenv on startup, maybe plain
Carbon does now too?
_____________________________________________________________
MacOSX-Emacs mailing list
MacOSX-Emacs at email.esm.psu.edu
http://email.esm.psu.edu/mailman/listinfo/macosx-emacs
List Archives: http://dir.gmane.org/gmane.emacs.macintosh.osx


More information about the MacOSX-Emacs mailing list