aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa1999-03-15 00:11:22 +0000
committerKenichi Handa1999-03-15 00:11:22 +0000
commitd645aaa44253c31fe2b03f593e9cfe64e527dc6e (patch)
tree38fe756447e19c8ae19171ba723639975f7225e3 /src
parente186b06917b60c8d716901d4963b9ffd7f8d8c7b (diff)
downloademacs-d645aaa44253c31fe2b03f593e9cfe64e527dc6e.tar.gz
emacs-d645aaa44253c31fe2b03f593e9cfe64e527dc6e.zip
(x_list_fonts): Trap X errors so that Emacs doesn't die
by them. (x_load_font): Likewise.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c10
1 files changed, 10 insertions, 0 deletions
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)
6682{ 6682{
6683 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 6683 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
6684 Lisp_Object font_names; 6684 Lisp_Object font_names;
6685 int count;
6685 6686
6686 /* Get a list of all the fonts that match this name. Once we 6687 /* Get a list of all the fonts that match this name. Once we
6687 have a list of matching fonts, we compare them against the fonts 6688 have a list of matching fonts, we compare them against the fonts
@@ -6718,7 +6719,16 @@ x_load_font (f, fontname, size)
6718 fontname = (char *) XSTRING (XCONS (font_names)->car)->data; 6719 fontname = (char *) XSTRING (XCONS (font_names)->car)->data;
6719 6720
6720 BLOCK_INPUT; 6721 BLOCK_INPUT;
6722 count = x_catch_errors (FRAME_X_DISPLAY (f));
6721 font = (XFontStruct *) XLoadQueryFont (FRAME_X_DISPLAY (f), fontname); 6723 font = (XFontStruct *) XLoadQueryFont (FRAME_X_DISPLAY (f), fontname);
6724 if (x_had_errors_p (FRAME_X_DISPLAY (f)))
6725 {
6726 /* This error is perhaps due to insufficient memory on X
6727 server. Let's just ignore it. */
6728 font = NULL;
6729 x_clear_errors (FRAME_X_DISPLAY (f));
6730 }
6731 x_uncatch_errors (FRAME_X_DISPLAY (f), count);
6722 UNBLOCK_INPUT; 6732 UNBLOCK_INPUT;
6723 if (!font) 6733 if (!font)
6724 return NULL; 6734 return NULL;