🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #100037

Can't determine current DISPLAY under X

#100037
From: Rob Pettengill
Date: Tue, 13 Mar 1990 22:07
44 lines
2311 bytes
Emacs Version:
"GNU Emacs 18.55.6 of Tue Feb 13 1990 on sw.mcc.com (berkeley-unix)"
Machine:
Sun SPARCstation 1 runing SunOS4.0?

Problem:  Determine what host the emacs is displaying on under X so
that embedded speech in mail messages can be heard using the Sun
SPARC's audio output capability.

You can find out if your are running under x with:
   (and (boundp 'window-system) (eq window-system 'x)) 

(getenv "HOST") will return the host emacs is running on not the
display host that you are looking at and listening too.
The host your are displaying on can be determined from the x display.
Finding what display you are using is much more difficult.

(getenv "DISPLAY") only works if emacs was started from a shell and
you didn't override with the -d or -display switches.

The variable command-line-args should give you the -d or -display arg
passed but this information is stripped off!  This happens in
init_cmdargs in emacs.c which ignores the args before skip_args

The process-environment variable only repeats information available from
(getenv "DISPLAY")

Workaround:

Don't use the -d/-display switch to set the display.  Set the DISPLAY
environment variable in a shell first...

Suggested fix:
main in emacs.c should set the DISPLAY environment variable according
to the -d/-display flag.  x-change-display in xfns.c should do the
same as well as make sure that the process process-environment variable
gets correctly updated.

;rob

  Robert C. Pettengill, MCC Software Technology Program
  P. O. Box 200195, Austin, Texas  78720
  ARPA:  rcp@mcc.com            PHONE:  (512) 338-3533
  UUCP:  ..!cs.utexas.edu!milano!rcp
Technical Details
Message-ID: <9003132207.AA05557@moth.sw.mcc.com>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!bu.edu!lll-winken!uwm.edu!cs.utexas.edu!tut.cis.ohio-state.edu!MCC.COM!rcp%SW.MCC.COM

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,6cb526064d800087,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1990-03-13 14:07:24 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!bu.edu!lll-winken!uwm.edu!cs.utexas.edu!tut.cis.ohio-state.edu!MCC.COM!rcp%SW.MCC.COM
From: rcp%SW.MCC.COM@MCC.COM (Rob Pettengill)
Newsgroups: gnu.emacs.bug
Subject: Can't determine current DISPLAY under X
Message-ID: <9003132207.AA05557@moth.sw.mcc.com>
Date: 13 Mar 90 22:07:24 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 44
Posted: Tue Mar 13 23:07:24 1990