aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/image.c b/src/image.c
index b61b07876d3..15e835fef3b 100644
--- a/src/image.c
+++ b/src/image.c
@@ -616,6 +616,10 @@ static struct image_type *image_types;
616 616
617Lisp_Object Vimage_types; 617Lisp_Object Vimage_types;
618 618
619/* An alist of image types and libraries that implement the type. */
620
621Lisp_Object Vimage_library_alist;
622
619/* Cache for delayed-loading image types. */ 623/* Cache for delayed-loading image types. */
620 624
621static Lisp_Object Vimage_type_cache; 625static Lisp_Object Vimage_type_cache;
@@ -696,7 +700,7 @@ lookup_image_type (symbol)
696 struct image_type *type; 700 struct image_type *type;
697 701
698 /* We must initialize the image-type if it hasn't been already. */ 702 /* We must initialize the image-type if it hasn't been already. */
699 if (NILP (Finit_image_library (symbol, Qnil))) 703 if (NILP (Finit_image_library (symbol, Vimage_library_alist)))
700 return 0; /* unimplemented */ 704 return 0; /* unimplemented */
701 705
702 for (type = image_types; type; type = type->next) 706 for (type = image_types; type; type = type->next)
@@ -7985,6 +7989,8 @@ of `image-library-alist', which see). */)
7985void 7989void
7986syms_of_image () 7990syms_of_image ()
7987{ 7991{
7992 extern Lisp_Object Qrisky_local_variable; /* Syms_of_xdisp has already run. */
7993
7988 /* Must be defined now becase we're going to update it below, while 7994 /* Must be defined now becase we're going to update it below, while
7989 defining the supported image types. */ 7995 defining the supported image types. */
7990 DEFVAR_LISP ("image-types", &Vimage_types, 7996 DEFVAR_LISP ("image-types", &Vimage_types,
@@ -7993,6 +7999,20 @@ Each element of the list is a symbol for a image type, like 'jpeg or 'png.
7993To check whether it is really supported, use `image-type-available-p'. */); 7999To check whether it is really supported, use `image-type-available-p'. */);
7994 Vimage_types = Qnil; 8000 Vimage_types = Qnil;
7995 8001
8002 DEFVAR_LISP ("image-library-alist", &Vimage_library_alist,
8003 doc: /* Alist of image types vs external libraries needed to display them.
8004
8005Each element is a list (IMAGE-TYPE LIBRARY...), where the car is a symbol
8006representing a supported image type, and the rest are strings giving
8007alternate filenames for the corresponding external libraries.
8008
8009Emacs tries to load the libraries in the order they appear on the
8010list; if none is loaded, the running session of Emacs won't
8011support the image type. Types 'pbm and 'xbm don't need to be
8012listed; they're always supported. */);
8013 Vimage_library_alist = Qnil;
8014 Fput (intern ("image-library-alist"), Qrisky_local_variable, Qt);
8015
7996 Vimage_type_cache = Qnil; 8016 Vimage_type_cache = Qnil;
7997 staticpro (&Vimage_type_cache); 8017 staticpro (&Vimage_type_cache);
7998 8018