From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.bugs Subject: bug#14423: 24.3; Gnus gratuitously loads image libraries in w32 text-mode Emacs Date: Wed, 05 Jun 2013 11:18:21 -0400 Organization: =?UTF-8?Q?=D0=A2=D0=B5=D0=BE=D0=B4=D0=BE=D1=80_?= =?UTF-8?Q?=D0=97=D0=BB=D0=B0=D1=82=D0=B0=D0=BD=D0=BE=D0=B2?= @ Cienfuegos Message-ID: <87txlcziv6.fsf@lifelogs.com> References: <83ehd2wy57.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1370445600 11388 80.91.229.3 (5 Jun 2013 15:20:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Jun 2013 15:20:00 +0000 (UTC) Cc: 14423@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 05 17:19:59 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UkFVG-0003l5-RT for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Jun 2013 17:19:59 +0200 Original-Received: from localhost ([::1]:41135 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkFVG-00085o-DM for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Jun 2013 11:19:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkFUN-0006jj-1V for bug-gnu-emacs@gnu.org; Wed, 05 Jun 2013 11:19:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkFUI-0003HR-9P for bug-gnu-emacs@gnu.org; Wed, 05 Jun 2013 11:19:02 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36123) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkFUI-0003HJ-3Q for bug-gnu-emacs@gnu.org; Wed, 05 Jun 2013 11:18:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UkFWH-0001S1-Sq; Wed, 05 Jun 2013 11:21:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ted Zlatanov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Wed, 05 Jun 2013 15:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14423 X-GNU-PR-Package: emacs,gnus X-GNU-PR-Keywords: Original-Received: via spool by 14423-submit@debbugs.gnu.org id=B14423.13704456375517 (code B ref 14423); Wed, 05 Jun 2013 15:21:01 +0000 Original-Received: (at 14423) by debbugs.gnu.org; 5 Jun 2013 15:20:37 +0000 Original-Received: from localhost ([127.0.0.1]:52713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UkFVs-0001Qs-QD for submit@debbugs.gnu.org; Wed, 05 Jun 2013 11:20:37 -0400 Original-Received: from mail-qa0-f52.google.com ([209.85.216.52]:56764) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UkFVp-0001QM-Sm for 14423@debbugs.gnu.org; Wed, 05 Jun 2013 11:20:34 -0400 Original-Received: by mail-qa0-f52.google.com with SMTP id bv4so237284qab.18 for <14423@debbugs.gnu.org>; Wed, 05 Jun 2013 08:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lifelogs.com; s=google; h=from:to:cc:subject:organization:references:x-face:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:user-agent :mime-version:content-type; bh=gniie9D2w6qKz1gLweFR7E9vG3kilI4FQj/kDmzTm9Q=; b=gpFcFtHqgM3ghHcBjvC0dfgR/k8BibwUITlAdI22NE6kfDe84/A3cUsI+6UNOPLcUQ tDJt9RN03bOKT+be6vUgASH1XK6sv7zn2e0njVuP2FRmj9Esqln1y8khda5ntghvUu/f tmWhqIJb1vTezPTPpedPuDylm724mU3AJlVrk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:organization:references:x-face:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:user-agent :mime-version:content-type:x-gm-message-state; bh=gniie9D2w6qKz1gLweFR7E9vG3kilI4FQj/kDmzTm9Q=; b=betwmZpqtt8TVT5j7S1HKn2DFNtnl3QMVpPhMPx13pyq/cx8+GNReZ5Q1yZVs7ILi6 x9oy5iEIorhXKr49a/dhFiDo6t+JDRHKCVvtEq/B9T1qMYh20ngIWaDXr42HypYePoW4 L+lOnYqCV/sXpvs3AQ9fUAEKhwYHmrcOxsDNv5GNMn6L40RCiIVCGgLhrKnZrkdgW9F/ 3vSajCqqRKio8iNldHwUXp8NZoTSeQ/3nSQIMt4QtdmZITwvnMaH0LKEeCETNjH0j6XF lro8YYcCcB5IvWGbnemvjZsp40PjCCvxt8Nj4dK32EhOHEA1NuvvKNmOcpkyM77nGv0I n59w== X-Received: by 10.49.71.141 with SMTP id v13mr1991607qeu.36.1370445504198; Wed, 05 Jun 2013 08:18:24 -0700 (PDT) Original-Received: from heechee (pool-72-93-26-80.bstnma.east.verizon.net. [72.93.26.80]) by mx.google.com with ESMTPSA id c7sm72923750qel.2.2013.06.05.08.18.22 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 05 Jun 2013 08:18:23 -0700 (PDT) X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Copies-To: never Gmane-Reply-To-List: yes In-Reply-To: <83ehd2wy57.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 19 May 2013 22:46:44 +0300") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) X-Gm-Message-State: ALoCoQnXRpM/ZWq5f1hPHbfOoseLUl3QXc7CVJc96zoZL98h3fvCiS1zYZDAfBxvptpgv9keeEYe X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:74820 Archived-At: On Sun, 19 May 2013 22:46:44 +0300 Eli Zaretskii 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)))