From: Marcin Tustin
Subject: CMUCL gui - cannot connect to motif server
Date: 
Message-ID: <9mdmhm$es3$1@newsg3.svr.pol.co.uk>
    Subject says it all - installed the cmucl extras with the clm, clx, etc.
.x86f's, and the motifd motif server, but all lisp does is complain that it
can't connect to the server, whether or not a server process exists. Any
ideas? (I've not checked my packet filtering...I'm using suse 7.0 out of the
box)

From: Richard Krush
Subject: Re: CMUCL gui - cannot connect to motif server
Date: 
Message-ID: <slrn9ol6n5.2kp2.richard_k@localhost.localnet>
On Mon, 27 Aug 2001 15:48:47 +0100, Marcin Tustin wrote:
>       Subject says it all - installed the cmucl extras with the clm, clx, etc.
>   .x86f's, and the motifd motif server, but all lisp does is complain that it
>   can't connect to the server, whether or not a server process exists. Any
>   ideas? (I've not checked my packet filtering...I'm using suse 7.0 out of the
>   box)
>   

Try adding your host (localhost probably) to the list of hosts authorized
to connect to your X-Server. It is probably done by doing "xhost +localhost"
command envoced from the X-Windows.

Good luck with motif (and you might need it),
 rk
From: Ingvar Mattsson
Subject: Re: CMUCL gui - cannot connect to motif server
Date: 
Message-ID: <87heur2cl6.fsf@gruk.tech.ensign.ftech.net>
·········@gmx.net (Richard Krush) writes:

> On Mon, 27 Aug 2001 15:48:47 +0100, Marcin Tustin wrote:
> >       Subject says it all - installed the cmucl extras with the clm, clx, etc.
> >   .x86f's, and the motifd motif server, but all lisp does is complain that it
> >   can't connect to the server, whether or not a server process exists. Any
> >   ideas? (I've not checked my packet filtering...I'm using suse 7.0 out of the
> >   box)
> >   
> 
> Try adding your host (localhost probably) to the list of hosts authorized
> to connect to your X-Server. It is probably done by doing "xhost +localhost"
> command envoced from the X-Windows.

Or check for a way to send off correct MIT-MAGIC-COOKIE cookies to the
display-opening call. Alas, I don't have that code handy just right
here, but...

//Ingvar
-- 
"Validate me!  Give me eternal digital life!  Quote me in your .sigs!"
	djc, in the Monastery
From: Daniel Barlow
Subject: Re: CMUCL gui - cannot connect to motif server
Date: 
Message-ID: <877kvm7v9g.fsf@noetbook.telent.net>
Ingvar Mattsson <······@bofh.se> writes:

> Or check for a way to send off correct MIT-MAGIC-COOKIE cookies to the
> display-opening call. Alas, I don't have that code handy just right
> here, but...

According to some anonymous contributer to CLiki, the answer - if
you're using CMUCL, anyway, might be to use EXT:OPEN-CLX-DISPLAY
instead of XLIB:OPEN-DISPLAY

http://ww.telent.net/cliki/CMUCL%20Hints

This is reported to parse $DISPLAY correctly and also to know about
cookie-based authorization.  I haven't tried it myself


-dan

-- 

  http://ww.telent.net/cliki/ - Link farm for free CL-on-Unix resources 
From: Nirved
Subject: Re: CMUCL gui - cannot connect to motif server
Date: 
Message-ID: <15fb2d5b.0108302135.7c7deaf3@posting.google.com>
"Marcin Tustin" <·······@GUeswhatthisbitisfor.mindless.com> wrote in message news:<············@newsg3.svr.pol.co.uk>...
> Subject says it all - installed the cmucl extras with the clm, clx, etc.
> .x86f's, and the motifd motif server, but all lisp does is complain that it
> can't connect to the server, whether or not a server process exists. Any
> ideas? (I've not checked my packet filtering...I'm using suse 7.0 out of the
> box)

I had the same problem, and found that (open-clx-display) uses :tcp
instead of :unix to get the mit-magic-cookie. Here is an updated
function that works for me (Mandrake 8.0), you could put it in
.cmucl-init

(in-package "EXTENSIONS")
(defun open-clx-display (&optional (string (cdr (assoc :display
						       *environment-list*
						       :test #'eq))))
  "Parses a display specification including display and screen numbers.
   This returns nil when there is no DISPLAY environment variable.  If string
   is non-nil, and any fields are missing in the specification, this signals an
   error.  If you specify a screen, then this sets XLIB:DISPLAY-DEFAULT-SCREEN
   to that screen since CLX initializes this form to the first of
   XLIB:SCREEN-ROOTS.  This returns the display and screen objects."
  (when string
    (let* ((string (coerce string 'simple-string))
	   (length (length string))
	   ;;pw-- "unix" is a signal to the connect_to_inet C code
	   ;;     to open an AF_UNIX socket instead of an AF_INET one.
	   ;;     This is supposed to be faster on a local server.
	   (host-name "unix")
	   (auth-name nil)
	   (auth-data nil)
	   (display-num nil)
	   (screen-num nil))
      (declare (simple-string string))
      (let ((colon (position #\: string :test #'char=)))
	(cond ((null colon)
	       (error "Missing display number in DISPLAY environment variable."))
	      (t
	       (unless (zerop colon) (setf host-name (subseq string 0 colon)))
	       (let* ((start (1+ colon))
		      (first-dot (position #\. string
					   :test #'char= :start start)))
		 (cond ((= start (or first-dot length))
			(error "Badly formed display number in DISPLAY ~
				environment variable."))
		       ((null first-dot)
			(setf display-num (parse-integer string :start start)))
		       (t
			(setf display-num (parse-integer string :start start
							 :end first-dot))
			(let* ((start (1+ first-dot))
			       (second-dot (position #\. string :test #'char=
						     :start start)))
			  (cond ((= start (or second-dot length))
				 (error "Badly formed screen number in ~
					 DISPLAY environment variable."))
				(t
				 (setf screen-num
				       (parse-integer string :start start
						      :end second-dot)))))))))))
      (if (equal host-name "unix")
        (multiple-value-setq (auth-name auth-data)
                                                                       ;!!!!
          (xlib::get-best-authorization (machine-instance) display-num :unix)))
      (let ((display (xlib:open-display host-name
                                      :display display-num
                                      :authorization-name auth-name
                                      :authorization-data auth-data)))
	(when screen-num
	  (let* ((screens (xlib:display-roots display))
		 (num-screens (length screens)))
	    (when (>= screen-num num-screens)
	      (xlib:close-display display)
	      (error "No such screen number (~D)." screen-num))
	    (setf (xlib:display-default-screen display)
		  (elt screens screen-num))))
	(values display (xlib:display-default-screen display))))))


The change is just under "!!!!" mark.

--
Nirved