Mercurial > emacs
comparison src/xterm.c @ 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 | 4001ff593a99 |
children | abf5b4802f9b |
comparison
equal
deleted
inserted
replaced
24483:0dc19350498f | 24484:d4ee4399e999 |
---|---|
6680 register char *fontname; | 6680 register char *fontname; |
6681 int size; | 6681 int 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 |
6688 we already have by comparing names. */ | 6689 we already have by comparing names. */ |
6689 font_names = x_list_fonts (f, build_string (fontname), size, 1); | 6690 font_names = x_list_fonts (f, build_string (fontname), size, 1); |
6716 is loadable by XLoadQueryFont. */ | 6717 is loadable by XLoadQueryFont. */ |
6717 if (size > 0 && !NILP (font_names)) | 6718 if (size > 0 && !NILP (font_names)) |
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; |
6725 | 6735 |
6726 /* Do we need to create the table? */ | 6736 /* Do we need to create the table? */ |