GNU bug report logs - #14423
24.3; Gnus gratuitously loads image libraries in w32 text-mode Emacs

Previous Next

Packages: emacs, gnus;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Sun, 19 May 2013 19:50:02 UTC

Severity: minor

Found in version 24.3

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ted Zlatanov <tzz <at> lifelogs.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 14423 <at> debbugs.gnu.org
Subject: bug#14423: 24.3; Gnus gratuitously loads image libraries in w32 text-mode Emacs
Date: Wed, 05 Jun 2013 11:18:21 -0400
On Sun, 19 May 2013 22:46:44 +0300 Eli Zaretskii <eliz <at> gnu.org> wrote: 

EZ> Many Gnus features use the function gnus-image-type-available-p, which
EZ> does this:

EZ>    (defun gnus-image-type-available-p (type)
EZ>      (and (fboundp 'image-type-available-p)
EZ> 	  (image-type-available-p type)
EZ> 	  (if (fboundp 'display-images-p)
EZ> 	      (display-images-p)
EZ> 	    t)))

EZ> Because this calls image-type-available-p before testing the display
EZ> for image support (by calling display-images-p), a text-mode session
EZ> on MS-Windows will load image libraries that cannot be possibly useful
EZ> in a non-GUI session.  (The MS-Windows build of Emacs loads image DLL
EZ> shared libraries on demand, and that happens inside the call to
EZ> image-type-available-p.)  This useless library load both slows down
EZ> loading certain Gnus packages, and unnecessarily bloats the memory
EZ> footprint of the Emacs process.

EZ> To avoid this adverse effect, gnus-image-type-available-p should test
EZ> the result of calling display-images-p _before_ it checks whether the
EZ> specific image type can be supported.

That seems like a very trivial fix.  Does the patch below do it?  Or
should I make this check the very first thing?

Thanks
Ted

diff --git a/lisp/gnus-ems.el b/lisp/gnus-ems.el
index 4d9b579..f9ef70f 100644
--- a/lisp/gnus-ems.el
+++ b/lisp/gnus-ems.el
@@ -165,10 +165,10 @@
 
 (defun gnus-image-type-available-p (type)
   (and (fboundp 'image-type-available-p)
-       (image-type-available-p type)
        (if (fboundp 'display-images-p)
           (display-images-p)
-        t)))
+        t)
+       (image-type-available-p type)))
 
 (defun gnus-create-image (file &optional type data-p &rest props)
   (let ((face (plist-get props :face)))




This bug report was last modified 12 years and 43 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.