diff lisp/gnuserv.el @ 1700:0a85daf64258

[xemacs-hg @ 2003-09-19 17:07:05 by youngs] 2002-09-20 James LewisMoss <dres@lewismoss.org> * gnuserv.el (gnuserv-edit-files): fallback to gtk if x device fails. Fixes problem where gnuclient fails for gtk instances when gnuclient was built with X configure.
author youngs
date Fri, 19 Sep 2003 17:07:07 +0000
parents a00780ef853d
children 807b51903ed4
line wrap: on
line diff
--- a/lisp/gnuserv.el	Fri Sep 19 16:39:43 2003 +0000
+++ b/lisp/gnuserv.el	Fri Sep 19 17:07:07 2003 +0000
@@ -408,6 +408,13 @@
   (eval form))
 
 
+
+(defun make-x-device-with-gtk-fallback (device)
+  (or (condition-case ()
+          (make-x-device device)
+        (error nil))
+      (make-gtk-device)))
+
 ;; "Execute" a client connection, called by gnuclient.  This is the
 ;; backbone of gnuserv.el.
 (defun gnuserv-edit-files (type list &rest flags)
@@ -440,7 +447,7 @@
 			  (case (car type)
 			    (tty (apply 'make-tty-device (cdr type)))
 			    (gtk (make-gtk-device))
-			    (x   (make-x-device (cadr type)))
+			    (x   (make-x-device-with-gtk-fallback (cadr type)))
 			    (mswindows   (make-mswindows-device))
 			    (t   (error "Invalid device type"))))
 			 (t