From ec86b2c737af7ba48e9a515670329cca2a106974 Mon Sep 17 00:00:00 2001
From: pw <pw>
Date: Wed, 21 Jan 1998 13:19:05 +0000
Subject: [PATCH] Let open-display work with host name args "" and "unix". From
 Ray Toy.

---
 clx/display.lisp | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/clx/display.lisp b/clx/display.lisp
index 011df06bd..58901cb6e 100644
--- a/clx/display.lisp
+++ b/clx/display.lisp
@@ -49,8 +49,11 @@
 	    (let* ((host-family (ecase protocol
 				  ((:tcp :internet nil) 0)
 				  ((:dna :DECnet) 1)
-				  ((:chaos) 2)))
-		   (host-address (rest (host-address host host-family)))
+				  ((:chaos) 2)
+				  ((:unix) 256)))
+		   (host-address (if (eq protocol :unix)
+				     (map 'list #'char-int (machine-instance))
+				     (rest (host-address host host-family))))
 		   (best-name nil)
 		   (best-data nil))
 	      (loop
@@ -290,10 +293,16 @@
   ;; if any, is assumed to come from the environment somehow.
   (declare (type integer display))
   (declare (clx-values display))
-  ;; Get the authorization mechanism from the environment.
+  ;; Get the authorization mechanism from the environment.  Handle the
+  ;; special case of a host name of "" and "unix" which means the
+  ;; protocol is :unix
   (when (null authorization-name)
     (multiple-value-setq (authorization-name authorization-data)
-      (get-best-authorization host display protocol)))
+      (get-best-authorization host
+			      display
+			      (if (member host '("" "unix") :test #'equal)
+				  :unix
+				  protocol))))
   ;; PROTOCOL is the network protocol (something like :TCP :DNA or :CHAOS). See OPEN-X-STREAM.
   (let* ((stream (open-x-stream host display protocol))
 	 (disp (make-buffer *output-buffer-size* #'make-display-internal
-- 
GitLab