From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: valid_image_p doesn't load image libraries Date: Thu, 26 May 2005 13:22:50 +0200 Message-ID: Reply-To: Juanma Barranquero NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1117106834 16502 80.91.229.2 (26 May 2005 11:27:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 26 May 2005 11:27:14 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 26 13:27:12 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DbGSR-0005M8-N4 for ged-emacs-devel@m.gmane.org; Thu, 26 May 2005 13:23:23 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DbGWU-0005VT-UT for ged-emacs-devel@m.gmane.org; Thu, 26 May 2005 07:27:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DbGV7-0005Tq-Hi for emacs-devel@gnu.org; Thu, 26 May 2005 07:26:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DbGV4-0005SC-In for emacs-devel@gnu.org; Thu, 26 May 2005 07:26:06 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DbGV4-0005Rk-7Z for emacs-devel@gnu.org; Thu, 26 May 2005 07:26:06 -0400 Original-Received: from [64.233.184.193] (helo=wproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DbGSW-0005as-Cp for emacs-devel@gnu.org; Thu, 26 May 2005 07:23:28 -0400 Original-Received: by wproxy.gmail.com with SMTP id 57so850262wri for ; Thu, 26 May 2005 04:22:50 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=Mg+YAj4lXJLZwsioBwKp0dHtfcC1DUayUThEOLGQhX2gsxTPk9N9BAYV7JjtPtGgRGHmSn+tljB97qexvwaMJb6Pd6WOYzO8MjbDJgOwS5Vv/NVH3hN7OP8Q24TZZgGSefkA5l2DMyyXpV35Av2BZ/tMLTGi77wbGHH0X2TUVnI= Original-Received: by 10.54.51.17 with SMTP id y17mr899129wry; Thu, 26 May 2005 04:22:50 -0700 (PDT) Original-Received: by 10.54.82.6 with HTTP; Thu, 26 May 2005 04:22:50 -0700 (PDT) Original-To: emacs-devel@gnu.org Content-Disposition: inline X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:37691 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37691 On image dynamic-loading environments (AKA Windows), when the first function to try to use an image type is a C primitive and not Lisp code (for example, image-size), the corresponding image library is not loaded. The reason is that these functions call valid_image_p(), which in turn calls lookup_image_type(), which does: if (NILP (Finit_image_library (symbol, Qnil))) return 0; Now, init-image-library's second argument nil does not mean "use the default library alist" (the variable `image-library-alist'), but "use a null library alist", so the above call will always return nil unless the library corresponding to the given image type is already loaded. Now, assuming that lookup_image_type is the right place to load the library, there's two possible answers: - passing `image-library-alist' to the call in lookup_image_type() - changing the spec of init-image-library so second arg nil means "load from the default library alist". Both of them require `image-library-alist', which is currently defined on image.el, to be moved to C code. Objections? Suggestions? Comments? --=20 /L/e/k/t/u