From: Ted Zlatanov <tzz@lifelogs.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 14423@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 [thread overview]
Message-ID: <87txlcziv6.fsf@lifelogs.com> (raw)
In-Reply-To: <83ehd2wy57.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 19 May 2013 22:46:44 +0300")
On Sun, 19 May 2013 22:46:44 +0300 Eli Zaretskii <eliz@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)))
next prev parent reply other threads:[~2013-06-05 15:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-19 19:46 bug#14423: 24.3; Gnus gratuitously loads image libraries in w32 text-mode Emacs Eli Zaretskii
2013-06-05 15:18 ` Ted Zlatanov [this message]
2013-06-06 15:35 ` Eli Zaretskii
2013-06-06 16:32 ` Ted Zlatanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87txlcziv6.fsf@lifelogs.com \
--to=tzz@lifelogs.com \
--cc=14423@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).