From d645aaa44253c31fe2b03f593e9cfe64e527dc6e Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 15 Mar 1999 00:11:22 +0000 Subject: [PATCH] (x_list_fonts): Trap X errors so that Emacs doesn't die by them. (x_load_font): Likewise. --- src/xterm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/xterm.c b/src/xterm.c index 2af69ca92a4..d562a3d2b1a 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -6682,6 +6682,7 @@ x_load_font (f, fontname, size) { 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 @@ x_load_font (f, fontname, size) 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; -- 2.39.2