From 209061be860f6752bef99b4e7e24055f4114eb56 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Sat, 9 Oct 1999 19:47:16 +0000 Subject: [PATCH] (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. --- src/xfns.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/xfns.c b/src/xfns.c index e044810f816..4afa9d2dee8 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -5819,8 +5819,8 @@ prepare_image_for_display (f, img) /* If IMG doesn't have a pixmap yet, load it now, using the image type dependent loader function. */ - if (img->pixmap == 0) - img->type->load (f, img); + if (img->pixmap == 0 && !img->load_failed_p) + img->load_failed_p = img->type->load (f, img) == 0; } @@ -6066,16 +6066,15 @@ lookup_image (f, spec) /* If not found, create a new image and cache it. */ if (img == NULL) { - int loading_failed_p; - img = make_image (spec, hash); cache_image (f, img); - loading_failed_p = img->type->load (f, img) == 0; + img->load_failed_p = img->type->load (f, img) == 0; + xassert (!interrupt_input_blocked); /* If we can't load the image, and we don't have a width and height, use some arbitrary width and height so that we can draw a rectangle for it. */ - if (loading_failed_p) + if (img->load_failed_p) { Lisp_Object value; @@ -7088,6 +7087,7 @@ xpm_load (f, img) if (!STRINGP (file)) { image_error ("Cannot find image file %s", specified_file, Qnil); + UNBLOCK_INPUT; return 0; } -- 2.39.5