🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.help
Article #188748

Checking for windowing system.

#188748
From: James Cameron
Date: Mon, 01 Jul 1991 16:13
58 lines
2251 bytes
System:  SunOS 4.1.1 GnuEmacs 18.57

Problem: I was requested to write a sitecode file for local users
	 here and I am having a problem with loading the mouse
	 bindings if it is in a windowed environment.

	 I was using conditions to test the term type, but it fails
	 to load at all when the term type is 'xterm' and the display
	 is not set.  Current scheme is:

;; get term prefix
   (defun term-name-prefix (name prefix)
     (and (>= (length name) (length prefix))
          (string= (substring name 0 (length prefix)) prefix)))

;; set terminal and host type
   (setq TERM (getenv "TERM"))
   (setq DISPLAY (getenv "DISPLAY"))

;; load appropriate emacs definition file
(cond ((term-name-prefix TERM "vt")   (load ".vt220.el"))
      ((term-name-prefix TERM "sun")  (load ".sun.elc"))
      (t (load ".visual.el")))
(cond ((term-name-prefix TERM "sun")
       (load "x-mouse")
       ))

(cond ((term-name-prefix TERM "xterm")
       (load "x-mouse")
       ))

(cond ((term-name-prefix DISPLAY "unix:0.0")
       (load "x-mouse")
       ))


	This fails when the display is not set.  I then thought 
	that I could test for window-system by doing:

(if (equal window-system 'x)
    (load "x-mouse"
)

	but this fails as well.  

	Anyone have ideas???

james

--
					-- James Cameron  (jc@raven.bu.edu)

Signal Processing and Interpretation Lab.  Boston, Mass  (617) 353-2879
------------------------------------------------------------------------------
"But to risk we must, for the greatest hazard in life is to risk nothing.  For
the man or woman who risks nothing, has nothing, does nothing, is nothing."
	(Quote from the eulogy for the late Christa McAuliffe.)
Technical Details
Message-ID: <JC.91Jul1121345@raven.bu.edu>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!bu.edu!nntp-read!jc

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 103b8b,99ba0478d180ef3b,start
X-Google-Attributes: gid103b8b,public
X-Google-ArrivalTime: 1991-07-01 10:31:22 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!bu.edu!nntp-read!jc
From: jc@raven.bu.edu (James Cameron)
Newsgroups: gnu.emacs.help
Subject: Checking for windowing system.
Message-ID: <JC.91Jul1121345@raven.bu.edu>
Date: 1 Jul 91 16:13:45 GMT
Sender: news@bu.edu
Distribution: gnu
Organization: What do you mean 'That *can't* be done????'
Lines: 58