From: Richard M. Stallman Date: Wed, 10 Apr 1996 17:23:18 +0000 (+0000) Subject: (Fx_list_fonts): Handle X protocol errors. X-Git-Tag: emacs-19.34~881 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=25c26e74715a15d8f01c3791538be25430946080;p=emacs.git (Fx_list_fonts): Handle X protocol errors. --- diff --git a/src/xfns.c b/src/xfns.c index e3ad7cdad58..344fb921a5b 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -3386,10 +3386,15 @@ even if they match PATTERN and FACE.") { 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 @@ even if they match PATTERN and FACE.") 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 @@ even if they match PATTERN and FACE.") 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 @@ even if they match PATTERN and FACE.") 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);