* bug#14423: 24.3; Gnus gratuitously loads image libraries in w32 text-mode Emacs
@ 2013-05-19 19:46 Eli Zaretskii
2013-06-05 15:18 ` Ted Zlatanov
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2013-05-19 19:46 UTC (permalink / raw)
To: 14423
Many Gnus features use the function gnus-image-type-available-p, which
does this:
(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)))
Because this calls image-type-available-p before testing the display
for image support (by calling display-images-p), a text-mode session
on MS-Windows will load image libraries that cannot be possibly useful
in a non-GUI session. (The MS-Windows build of Emacs loads image DLL
shared libraries on demand, and that happens inside the call to
image-type-available-p.) This useless library load both slows down
loading certain Gnus packages, and unnecessarily bloats the memory
footprint of the Emacs process.
To avoid this adverse effect, gnus-image-type-available-p should test
the result of calling display-images-p _before_ it checks whether the
specific image type can be supported.
Thanks.
In GNU Emacs 24.3.1 (i386-mingw-nt5.1.2600)
of 2013-03-11 on HOME-C4E4A596F7
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
`configure --with-gcc (3.4) --cflags -Id:/usr/include/libxml2'
Important settings:
value of $LANG: ENU
locale-coding-system: cp1255
default enable-multibyte-characters: t
Major mode: Mail
Minor modes in effect:
shell-dirtrack-mode: t
diff-auto-refine-mode: t
flyspell-mode: t
desktop-save-mode: t
show-paren-mode: t
display-time-mode: t
tooltip-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
temp-buffer-resize-mode: t
line-number-mode: t
auto-fill-function: mail-mode-auto-fill
abbrev-mode: t
Recent input:
SPC <backspace> <backspace> y SPC u s e r s SPC o f
SPC i t SPC h e r e . M-q <up> <C-right> <C-right>
<C-right> <C-right> <C-right> SPC o n SPC W i n d o
w s M-q <down> SPC SPC W h y SPC h a v e SPC a SPC
p a r t i a l SPC s o l u t i o n SPC w h e n SPC y
o u SPC c a n SPC h a v e SPC a SPC c o m p l e t e
SPC o n e ? <down> <return> <C-home> <down> <down>
<C-right> <C-right> <C-right> <C-right> <M-left> <C-end>
C-c C-s <switch-frame> d p p <M-home> <C-end> <M-end>
<switch-frame> <help-echo> <help-echo> <help-echo>
<switch-frame> M-1 g <up> <up> <return> SPC o <return>
C-x C-s <switch-frame> <help-echo> <help-echo> <help-echo>
<switch-frame> <help-echo> <switch-frame> <switch-frame>
M-1 g <up> <up> <return> d d r <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <down>
<C-right> <C-right> <C-right> <C-right> <C-right> <C-left>
<M-backspace> <M-backspace> <M-backspace> <C-end> C-c
C-y C-x C-x C-SPC <down> <down> C-w <down> <down> <down>
<down> C-SPC <next> <down> C-w <down> <down> <down>
<down> <down> <C-right> <C-right> <C-right> <C-right>
<C-right> <down> <C-left> <C-left> <left> <left> <left>
<left> <left> <left> <C-end> C-w <return> <return>
I t SPC s h o u l d SPC b e SPC p o s s i b l e , SPC
b u t SPC I S-SPC s h o u l d SPC t r y . <return>
<C-home> C-c C-s <switch-frame> <help-echo> <switch-frame>
<help-echo> <help-echo> <help-echo> <switch-frame>
C-x C-s <help-echo> <help-echo> <switch-frame> <help-echo>
<switch-frame> M-1 g <up> <return> d d C-x C-s <switch-frame>
<switch-frame> <switch-frame> M-x r e p o r t - e m
<tab> <return>
Recent messages:
Wrote d:/usr/eli/rmail/INBOX [2 times]
Getting mail from d:/usr/eli/data/mail.new...
Counting new messages...done (2)
Saving file d:/usr/eli/rmail/INBOX...
Wrote d:/usr/eli/rmail/INBOX [2 times]
Computing summary lines...done
2 new messages read
No following nondeleted message
Saving file d:/usr/eli/rmail/INBOX...
Wrote d:/usr/eli/rmail/INBOX [2 times]
Load-path shadows:
None found.
Features:
(shadow emacsbug shell pp descr-text mule-util ebuff-menu electric
bug-reference misearch multi-isearch add-log network-stream starttls
tls mail-extr smtpmail auth-source eieio password-cache dabbrev
mailalias sendmail rmailout help-mode autoconf autoconf-mode perl-mode
vc-git tcl conf-mode generic arc-mode archive-mode diff-mode dired-x
cl-macs gv dired vc-cvs sh-script smie executable face-remap org-wl
org-w3m org-vm org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs
org-html org-exp ob-exp org-exp-blocks org-agenda org-info org-gnus
gnus-util org-docview org-bibtex bibtex org-bbdb org byte-opt warnings
bytecomp byte-compile cconv advice help-fns advice-preload ob-tangle
ob-ref ob-lob ob-table org-footnote org-src ob-comint ob-keys
org-pcomplete pcomplete comint ansi-color ring org-list org-faces
org-entities org-version ob-emacs-lisp ob org-compat org-macs ob-eval
org-loaddefs find-func cal-menu calendar cal-loaddefs noutline outline
easy-mmode jka-compr cc-awk make-mode autorevert flyspell info vc-bzr
cc-langs cl cl-lib cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs qp rmailsum rmailmm
message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode
mailabbrev gmm-utils mailheader mail-parse rfc2231 rmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils desktop server
filecache mairix cus-edit easymenu cus-start cus-load wid-edit
saveplace midnight ispell generic-x paren battery time time-date
tooltip ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp
w32-common-fns disp-table w32-win w32-vars tool-bar dnd fontset image
regexp-opt fringe tabulated-list newcomment lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process w32 multi-tty
emacs)
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#14423: 24.3; Gnus gratuitously loads image libraries in w32 text-mode Emacs
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
2013-06-06 15:35 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Ted Zlatanov @ 2013-06-05 15:18 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 14423
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)))
^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#14423: 24.3; Gnus gratuitously loads image libraries in w32 text-mode Emacs
2013-06-05 15:18 ` Ted Zlatanov
@ 2013-06-06 15:35 ` Eli Zaretskii
2013-06-06 16:32 ` Ted Zlatanov
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2013-06-06 15:35 UTC (permalink / raw)
To: Ted Zlatanov; +Cc: 14423
> From: Ted Zlatanov <tzz@lifelogs.com>
> Cc: 14423@debbugs.gnu.org
> Gmane-Reply-To-List: yes
> Date: Wed, 05 Jun 2013 11:18:21 -0400
>
> That seems like a very trivial fix. Does the patch below do it?
Yes.
> Or should I make this check the very first thing?
No need. Just testing whether the function exists doesn't load any
libraries, only the call to the function does.
Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#14423: 24.3; Gnus gratuitously loads image libraries in w32 text-mode Emacs
2013-06-06 15:35 ` Eli Zaretskii
@ 2013-06-06 16:32 ` Ted Zlatanov
0 siblings, 0 replies; 4+ messages in thread
From: Ted Zlatanov @ 2013-06-06 16:32 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 14423
On Thu, 06 Jun 2013 18:35:27 +0300 Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Ted Zlatanov <tzz@lifelogs.com>
>> Cc: 14423@debbugs.gnu.org
>> Gmane-Reply-To-List: yes
>> Date: Wed, 05 Jun 2013 11:18:21 -0400
>>
>> That seems like a very trivial fix. Does the patch below do it?
EZ> Yes.
>> Or should I make this check the very first thing?
EZ> No need. Just testing whether the function exists doesn't load any
EZ> libraries, only the call to the function does.
EZ> Thanks.
OK; pushed. Thanks for the suggestion. If your tests pass it we can
close the bug... should be trivial :)
Ted
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-06-06 16:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2013-06-06 15:35 ` Eli Zaretskii
2013-06-06 16:32 ` Ted Zlatanov
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.