emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Delayed loading of image libraries


From: Juanma Barranquero
Subject: Re: [PATCH] Delayed loading of image libraries
Date: Thu, 01 Jul 2004 11:30:49 +0200

On Wed, 30 Jun 2004 11:42:34 -0400
Miles Bader <address@hidden> wrote:

> The result of `create-image' can be saved in a lisp file, and later loaded,
> in which case the image will be displayed without `init-image-library' being
> called from `image-type-available-p'y

It can be loaded, sure, but can it be *displayed* without
`image-type-available-p' being called?  I'd say that's a bug.

> I added a the call to make sure it
> always gets called one way or another.

The current situation is Not Good.  Andreas has fixed your patch by
passing it Qnil, which "works" in the sense that init-image-library
doesn't fail.  But:

  - It is now effectively a noop, because init-image-library'ing any
    image type from inside lookup_image_type will not load it.

  - Emacs on Windows crashes on certain kinds of image files (notably
    TIFFs).  I think that's related to something I asked yesterday:
    lookup_image_type can return NULL, but at places its return value is
    just checked with xassert, which could be a noop, so it is posible
    to end creating image types with image->type == NULL.  Why it is
    allowed?

  - We could make image-library-alist available from C and pass it to
    the call to init-image-library on lookup_image_type, but then, why
    make LIBRARIES an optional argument *at all*?  At first,
    init-image-library didn't accept a second argument, it just used
    image-library-alist, but Kim suggested passing it as an argument so
    the user could manipulate it or supply an alternative loading list.

So, IMHO:

  - We should make sure that image-type-available-p is called at the
    right places, so lookup_image_type does not need to call
    init-image-library.

  - We should guarantee that lookup_image_type is not going to return
    NULL (which doesn't make a lot of sense, as it is an internal
    function and we control whether it gets a valid image type or not).

                                                                Juanma






reply via email to

[Prev in Thread] Current Thread [Next in Thread]