From 2e288d54f05ba6e72a227ed3857a8098ca585b50 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 13 Oct 2010 16:50:06 +0200 Subject: [PATCH] Rename `image-library-alist' to `dynamic-library-alist'. * etc/NEWS: Mention `dynamic-library-alist'. * lisp/image.el (image-library-alist): Declare as obsolete alias. (image-type-available-p): Use `dynamic-library-alist'. * lisp/term/w32-win.el (dynamic-library-alist): Use instead of `image-library-alist'. * nt/INSTALL: Refer to `dynamic-library-alist'. * src/image.c (Vimage_library_alist) (syms_of_image) : Move to src/emacs.c and rename. (lookup_image_type): Use Vdynamic_library_alist. (Finit_image_library): Doc fix. * src/emacs.c (Vdynamic_library_alist) (syms_of_emacs) : Move from src/image.c and rename. Doc fix. * src/lisp.h (Vdynamic_library_alist): Declare extern. --- etc/ChangeLog | 4 ++++ etc/NEWS | 5 +++++ lisp/ChangeLog | 8 ++++++++ lisp/image.el | 6 ++++-- lisp/term/w32-win.el | 6 +++--- nt/ChangeLog | 4 ++++ nt/INSTALL | 2 +- src/ChangeLog | 13 +++++++++++++ src/emacs.c | 21 +++++++++++++++++++++ src/image.c | 29 ++++++----------------------- src/lisp.h | 1 + 11 files changed, 70 insertions(+), 29 deletions(-) diff --git a/etc/ChangeLog b/etc/ChangeLog index 766929b42b5..037c9eab266 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2010-10-13 Juanma Barranquero + + * NEWS: Mention `dynamic-library-alist'. + 2010-10-13 Glenn Morris * NEXTSTEP: New file, extracted from ../nextstep/{AUTHORS,README}. diff --git a/etc/NEWS b/etc/NEWS index 7ee81f9b81d..d9d84b9ce19 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -578,6 +578,11 @@ sc.el, x-menu.el, rnews.el, rnewspost.el * Lisp changes in Emacs 24.1 +** `image-library-alist' is renamed to `dynamic-library-alist'. +The variable is now used to load all kind of supported dynamic libraries, +not just image libraries. The previous name is still available as an +obsolete alias. + ** New variable syntax-propertize-function to set syntax-table properties. Replaces font-lock-syntactic-keywords which are now obsolete. This allows syntax-table properties to be set independently from font-lock: diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 39b5f3c0137..190feab75bf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2010-10-13 Juanma Barranquero + + * image.el (image-library-alist): Declare as obsolete alias. + (image-type-available-p): Use `dynamic-library-alist'. + + * term/w32-win.el (dynamic-library-alist): + Use instead of `image-library-alist'. + 2010-10-13 IRIE Shinsuke (tiny change) * subr.el (last): Make it faster. (Bug#7174) diff --git a/lisp/image.el b/lisp/image.el index 8dd88f627a1..0afdc71cb9e 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -330,14 +330,16 @@ Optional DATA-P non-nil means SOURCE is a string containing image data." type) -(defvar image-library-alist) +(define-obsolete-variable-alias + 'image-library-alist + 'dynamic-library-alist "24.1") ;;;###autoload (defun image-type-available-p (type) "Return non-nil if image type TYPE is available. Image types are symbols like `xbm' or `jpeg'." (and (fboundp 'init-image-library) - (init-image-library type image-library-alist))) + (init-image-library type dynamic-library-alist))) ;;;###autoload diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index 1779d1025e0..54bb5a5027b 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el @@ -196,10 +196,10 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") "Report an error when a suspend is attempted." (error "Suspending an Emacs running under W32 makes no sense")) -(defvar image-library-alist) +(defvar dynamic-library-alist) -;;; Set default known names for image libraries -(setq image-library-alist +;;; Set default known names for external libraries +(setq dynamic-library-alist '((xpm "libxpm.dll" "xpm4.dll" "libXpm-nox4.dll") (png "libpng12d.dll" "libpng12.dll" "libpng.dll" ;; these are libpng 1.2.8 from GTK+ diff --git a/nt/ChangeLog b/nt/ChangeLog index 5f92bedd8c1..44d937e4db9 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,7 @@ +2010-10-13 Juanma Barranquero + + * INSTALL: Refer to `dynamic-library-alist'. + 2010-10-06 Juanma Barranquero * INSTALL: Add note about problematic characters passed to configure. diff --git a/nt/INSTALL b/nt/INSTALL index c26ab196bd2..357cc8d0a8e 100644 --- a/nt/INSTALL +++ b/nt/INSTALL @@ -266,7 +266,7 @@ library is not an error; the associated image format will simply be unavailable. Note that once Emacs has determined that a library can not be found, there's no way to force it to try again, other than - restarting. See the variable `image-library-alist' to configure the + restarting. See the variable `dynamic-library-alist' to configure the expected names of the libraries. Some image libraries have dependencies on one another, or on zlib. diff --git a/src/ChangeLog b/src/ChangeLog index c44cd507693..9100259c978 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2010-10-13 Juanma Barranquero + + * emacs.c (Vdynamic_library_alist) + (syms_of_emacs) : Move from image.c and rename. + Doc fix. + + * lisp.h (Vdynamic_library_alist): Declare extern. + + * image.c (Vimage_library_alist) + (syms_of_image) : Move to emacs.c and rename. + (lookup_image_type): Use Vdynamic_library_alist. + (Finit_image_library): Doc fix. + 2010-10-12 Dan Nicolaescu * Makefile.in (lispsource, libsrc, etc, oldxmenudir, lwlibdir) diff --git a/src/emacs.c b/src/emacs.c index 95e2f0c0d37..70a0fae4ebf 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -187,6 +187,9 @@ Lisp_Object Vprevious_system_time_locale; Lisp code. */ Lisp_Object Vemacs_copyright, Vemacs_version; +/* Alist of external libraries and files implementing them. */ +Lisp_Object Vdynamic_library_alist; + /* If non-zero, emacs should not attempt to use a window-specific code, but instead should use the virtual terminal under which it was started. */ int inhibit_window_system; @@ -2507,6 +2510,24 @@ This is nil during initialization. */); doc: /* Version numbers of this version of Emacs. */); Vemacs_version = build_string (emacs_version); + DEFVAR_LISP ("dynamic-library-alist", &Vdynamic_library_alist, + doc: /* Alist of dynamic libraries vs external files implementing them. +Each element is a list (LIBRARY FILE...), where the car is a symbol +representing a supported external library, and the rest are strings giving +alternate filenames for that library. + +Emacs tries to load the library from the files in the order they appear on +the list; if none is loaded, the running session of Emacs won't have access +to that library. + +Note that image types `pbm' and `xbm' do not need entries in this variable +because they do not depend on external libraries and are always available. + +Also note that this is not a generic facility for accessing external +libraries; only those already known by Emacs will be loaded. */); + Vdynamic_library_alist = Qnil; + Fput (intern_c_string ("dynamic-library-alist"), Qrisky_local_variable, Qt); + /* Make sure IS_DAEMON starts up as false. */ daemon_pipe[1] = 0; } diff --git a/src/image.c b/src/image.c index 72cbad987f6..4b816ce5f9f 100644 --- a/src/image.c +++ b/src/image.c @@ -567,10 +567,6 @@ static struct image_type *image_types; Lisp_Object Vimage_types; -/* An alist of image types and libraries that implement the type. */ - -Lisp_Object Vimage_library_alist; - /* Cache for delayed-loading image types. */ static Lisp_Object Vimage_type_cache; @@ -645,7 +641,7 @@ lookup_image_type (Lisp_Object symbol) struct image_type *type; /* We must initialize the image-type if it hasn't been already. */ - if (NILP (Finit_image_library (symbol, Vimage_library_alist))) + if (NILP (Finit_image_library (symbol, Vdynamic_library_alist))) return 0; /* unimplemented */ for (type = image_types; type; type = type->next) @@ -1923,10 +1919,11 @@ mark_image_cache (struct image_cache *c) } /* Load a DLL implementing an image type. - The `image-library-alist' variable associates a symbol, - identifying an image type, to a list of possible filenames. + The argument LIBRARIES is usually the variable + `dynamic-library-alist', which associates a symbol, identifying + an external DLL library, to a list of possible filenames. The function returns NULL if no library could be loaded for - the given image type, or if the library was previously loaded; + the given symbol, or if the library was previously loaded; else the handle of the DLL. */ static HMODULE w32_delayed_load (Lisp_Object libraries, Lisp_Object type) @@ -8583,7 +8580,7 @@ Return non-nil if TYPE is a supported image type. Image types pbm and xbm are prebuilt; other types are loaded here. Libraries to load are specified in alist LIBRARIES (usually, the value -of `image-library-alist', which see). */) +of `dynamic-library-alist', which see). */) (Lisp_Object type, Lisp_Object libraries) { Lisp_Object tested; @@ -8659,20 +8656,6 @@ Each element of the list is a symbol for an image type, like 'jpeg or 'png. To check whether it is really supported, use `image-type-available-p'. */); Vimage_types = Qnil; - DEFVAR_LISP ("image-library-alist", &Vimage_library_alist, - doc: /* Alist of image types vs external libraries needed to display them. - -Each element is a list (IMAGE-TYPE LIBRARY...), where the car is a symbol -representing a supported image type, and the rest are strings giving -alternate filenames for the corresponding external libraries. - -Emacs tries to load the libraries in the order they appear on the -list; if none is loaded, the running session of Emacs won't -support the image type. Types 'pbm and 'xbm don't need to be -listed; they are always supported. */); - Vimage_library_alist = Qnil; - Fput (intern_c_string ("image-library-alist"), Qrisky_local_variable, Qt); - DEFVAR_LISP ("max-image-size", &Vmax_image_size, doc: /* Maximum size of images. Emacs will not load an image into memory if its pixel width or diff --git a/src/lisp.h b/src/lisp.h index a630eeec1f3..c9104f88954 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3300,6 +3300,7 @@ extern Lisp_Object Vbefore_init_time, Vafter_init_time; extern Lisp_Object Vinstallation_directory; extern Lisp_Object empty_unibyte_string, empty_multibyte_string; extern Lisp_Object Qfile_name_handler_alist; +extern Lisp_Object Vdynamic_library_alist; extern void (*fatal_error_signal_hook) (void); EXFUN (Fkill_emacs, 1) NO_RETURN; #if HAVE_SETLOCALE -- 2.39.2