Path: utzoo!attcan!uunet!lll-winken!ames!mailrus!tut.cis.ohio-state.edu!bloom-beacon!CHIPS.BBN.COM!jr From: jr@CHIPS.BBN.COM (John Robinson) Newsgroups: comp.windows.x Subject: Re: GNU Emacs shell mode and DISPLAY env variable Message-ID: <10771.602363770@chips> Date: 1 Feb 89 19:16:10 GMT References: <8902011634.AA18559@fafnir.think.com> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: jr@bbn.com Organization: The Internet Lines: 44 > say (to csh): > > setenv DISPLAY unix:0 ; emacs > > This can be done, but in the local environment it's a pain. Having to > bootstrap the display into emacs lisp by means of the underlying shell > isn't a very effective solution. Agreed, I didn't like it much either. > If the X11 code is splicing out the X command line arguments, then > it's doing something wrong. It seems to be. Arguments like -geometry and -fn stay in command-line-args just fine. -d and its argument, however, are stripped by the skip_args mechanism for some reason; they are among the class that have to be "first" in the arg list (actually there is an order), like -t and -batch. Excerpts from emacs.c:main(): #ifdef HAVE_X_WINDOWS /* Handle the -d switch, which means use a different display for X */ if (skip_args + 2 < argc && (!strcmp (argv[skip_args + 1], "-d") || !strcmp (argv[skip_args + 1], "-display"))) { skip_args += 2; alternate_display = argv[skip_args]; } else alternate_display = 0; #endif /* HAVE_X_WINDOWS */ ... and later on ... init_cmdargs (argc, argv, skip_args); /* Create list Vcommand_line_args */ init_cmdargs only puts arguments whose index is 0 (i.e., "emacs") or greater than skip_args into the Vcommand_line_args. So I have to conclude that this is a bug, and I think you agree. Any xpert want to hazard a fix? /jr jr@bbn.com or bbn!jr