changeset 14979:fc1c21bc2e05

(Fx_list_fonts): Handle X protocol errors.
author Richard M. Stallman <rms@gnu.org>
date Wed, 10 Apr 1996 17:23:18 +0000
parents c92fad046dd3
children 1659a0ea3c0c
files src/xfns.c
diffstat 1 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfns.c	Wed Apr 10 10:09:16 1996 +0000
+++ b/src/xfns.c	Wed Apr 10 17:23:18 1996 +0000
@@ -3386,10 +3386,15 @@
 	{
 	  XFontStruct *thisinfo;
 
-          thisinfo = XLoadQueryFont (FRAME_X_DISPLAY (f),
+	  x_catch_errors (FRAME_X_DISPLAY (f));
+
+	  thisinfo = XLoadQueryFont (FRAME_X_DISPLAY (f),
 				     XSTRING (XCONS (tem)->car)->data);
 
-          if (thisinfo && same_size_fonts (thisinfo, size_ref))
+	  x_check_errors (FRAME_X_DISPLAY (f), "XLoadQueryFont failure: %s");
+	  x_uncatch_errors (FRAME_X_DISPLAY (f));
+
+	  if (thisinfo && same_size_fonts (thisinfo, size_ref))
 	    newlist = Fcons (XCONS (tem)->car, newlist);
 
 	  if (thisinfo != 0)
@@ -3403,6 +3408,8 @@
 
   BLOCK_INPUT;
 
+  x_catch_errors (FRAME_X_DISPLAY (f));
+
   /* Solaris 2.3 has a bug in XListFontsWithInfo.  */
 #ifndef BROKEN_XLISTFONTSWITHINFO
   if (size_ref)
@@ -3418,6 +3425,9 @@
 			2000, /* maxnames */
 			&num_fonts); /* count_return */
 
+  x_check_errors (FRAME_X_DISPLAY (f), "XListFonts failure: %s");
+  x_uncatch_errors (FRAME_X_DISPLAY (f));
+
   UNBLOCK_INPUT;
 
   list = Qnil;
@@ -3450,7 +3460,13 @@
 	      XFontStruct *thisinfo;
 
 	      BLOCK_INPUT;
+
+	      x_catch_errors (FRAME_X_DISPLAY (f));
 	      thisinfo = XLoadQueryFont (FRAME_X_DISPLAY (f), names[i]);
+	      x_check_errors (FRAME_X_DISPLAY (f),
+			      "XLoadQueryFont failure: %s");
+	      x_uncatch_errors (FRAME_X_DISPLAY (f));
+
 	      UNBLOCK_INPUT;
 
 	      keeper = thisinfo && same_size_fonts (thisinfo, size_ref);