comparison src/xfns.c @ 25955:3daaee890b1e

(prepare_image_for_display): Don't try to load image if loading it failed before. (lookup_image, prepare_image_for_display): Remember if loading the image failed. (xpm_load): Add missing UNBLOCK_INPUT.
author Gerd Moellmann <gerd@gnu.org>
date Sat, 09 Oct 1999 19:47:16 +0000
parents 190a99688b53
children 6a349a18b1ad
comparison
equal deleted inserted replaced
25954:ab0d41b6f746 25955:3daaee890b1e
5817 EMACS_GET_TIME (t); 5817 EMACS_GET_TIME (t);
5818 img->timestamp = EMACS_SECS (t); 5818 img->timestamp = EMACS_SECS (t);
5819 5819
5820 /* If IMG doesn't have a pixmap yet, load it now, using the image 5820 /* If IMG doesn't have a pixmap yet, load it now, using the image
5821 type dependent loader function. */ 5821 type dependent loader function. */
5822 if (img->pixmap == 0) 5822 if (img->pixmap == 0 && !img->load_failed_p)
5823 img->type->load (f, img); 5823 img->load_failed_p = img->type->load (f, img) == 0;
5824 } 5824 }
5825 5825
5826 5826
5827 5827
5828 /*********************************************************************** 5828 /***********************************************************************
6064 break; 6064 break;
6065 6065
6066 /* If not found, create a new image and cache it. */ 6066 /* If not found, create a new image and cache it. */
6067 if (img == NULL) 6067 if (img == NULL)
6068 { 6068 {
6069 int loading_failed_p;
6070
6071 img = make_image (spec, hash); 6069 img = make_image (spec, hash);
6072 cache_image (f, img); 6070 cache_image (f, img);
6073 loading_failed_p = img->type->load (f, img) == 0; 6071 img->load_failed_p = img->type->load (f, img) == 0;
6072 xassert (!interrupt_input_blocked);
6074 6073
6075 /* If we can't load the image, and we don't have a width and 6074 /* If we can't load the image, and we don't have a width and
6076 height, use some arbitrary width and height so that we can 6075 height, use some arbitrary width and height so that we can
6077 draw a rectangle for it. */ 6076 draw a rectangle for it. */
6078 if (loading_failed_p) 6077 if (img->load_failed_p)
6079 { 6078 {
6080 Lisp_Object value; 6079 Lisp_Object value;
6081 6080
6082 value = image_spec_value (spec, QCwidth, NULL); 6081 value = image_spec_value (spec, QCwidth, NULL);
6083 img->width = (INTEGERP (value) 6082 img->width = (INTEGERP (value)
7086 { 7085 {
7087 Lisp_Object file = x_find_image_file (specified_file); 7086 Lisp_Object file = x_find_image_file (specified_file);
7088 if (!STRINGP (file)) 7087 if (!STRINGP (file))
7089 { 7088 {
7090 image_error ("Cannot find image file %s", specified_file, Qnil); 7089 image_error ("Cannot find image file %s", specified_file, Qnil);
7090 UNBLOCK_INPUT;
7091 return 0; 7091 return 0;
7092 } 7092 }
7093 7093
7094 rc = XpmReadFileToPixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 7094 rc = XpmReadFileToPixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
7095 XSTRING (file)->data, &img->pixmap, &img->mask, 7095 XSTRING (file)->data, &img->pixmap, &img->mask,