changeset 24484:d4ee4399e999

(x_list_fonts): Trap X errors so that Emacs doesn't die by them. (x_load_font): Likewise.
author Kenichi Handa <handa@m17n.org>
date Mon, 15 Mar 1999 00:11:22 +0000
parents 0dc19350498f
children ab39ea2168e7
files src/xterm.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Sun Mar 14 19:41:37 1999 +0000
+++ b/src/xterm.c	Mon Mar 15 00:11:22 1999 +0000
@@ -6682,6 +6682,7 @@
 {
   struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
   Lisp_Object font_names;
+  int count;
 
   /* Get a list of all the fonts that match this name.  Once we
      have a list of matching fonts, we compare them against the fonts
@@ -6718,7 +6719,16 @@
       fontname = (char *) XSTRING (XCONS (font_names)->car)->data;
 
     BLOCK_INPUT;
+    count = x_catch_errors (FRAME_X_DISPLAY (f));
     font = (XFontStruct *) XLoadQueryFont (FRAME_X_DISPLAY (f), fontname);
+    if (x_had_errors_p (FRAME_X_DISPLAY (f)))
+      {
+	/* This error is perhaps due to insufficient memory on X
+	   server.  Let's just ignore it.  */
+	font = NULL;
+	x_clear_errors (FRAME_X_DISPLAY (f));
+      }
+    x_uncatch_errors (FRAME_X_DISPLAY (f), count);
     UNBLOCK_INPUT;
     if (!font)
       return NULL;