[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XPM via Lisp in the toolbar

From: alkibiades
Subject: Re: XPM via Lisp in the toolbar
Date: Fri, 15 Nov 2002 04:31:55 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-msvc-nt5.1.2600)

Richard Stallman <address@hidden> writes:

>     Or I could hook `xpm-create-image' into the appropriate functions in
>     image.el.
> This seems like the cleanest result.  If Emacs does not support XPM
> format internally, it can use your package.  So XPM will always "just
> work" as far as the user is concerned.


>     But what to do with
>     the tool bar? On MS Windows this breaks the tool bar totally. 
> Could you explain why it has that effect?  That is not obvious.  It is
> surprising that adding XPM support via conversion should break
> anything that worked previously.

Unfortunately Emacs' internals are just a big black box for me (and
this won't change for a long time). All I can say is: if I try to put
an icon on the toolbar on MS Windows XP via an image descriptor that
contains PPM data *and* sets the :mask attribute to gain transparency,
then the according button does not appear on the toolbar at all. Since
this is what happens to all images in the tool bar, the tool bar stays

However: If I apply the same image descriptor *without* the mask
attribute, the image appears on the tool bar as expected. But this "as
expected" is very ugly, because the background is not transparent in
that case.

Actually I doubt that it worked previously (for certain values of
`worked'). AFAICS the :mask attribute does not have any effect on MS
Windows at all. The tool bar seems to be special, because the image
does not show up -- while in a normal buffer the image appears, albeit
without any visible difference to the same image without the :mask
attribute. Currently the tool bar on MS Windows shows the PBM
(black&white) versions of the icons. "Transparency" works different
for PBM and does not involve the :mask property.

>     Or I could add a caching mechanism to toolbar.el so that the
>     conversion happens only once.
> Why not add the caching feature in your conversion library?
> Then it would apply to anything that tries to display XPM
> and works via conversion.

Hmm. I would do it. I hesitate only, because this would mean that
*every* XPM image viewed within an Emacs buffer would be stored as a
PBM/PGN/PPM file on the disk. So if a user, say, uses
`auto-image-file-mode' and dired to review a directory with 100 XPM
icons, she would have additional 100 PPM files on her hard disk after

Or do you mean to do caching without storing the image data on the
disk? So that only in a single instance of Emacs no image file is
converted twice? I think this would only be useful in very few cases;
for example if the user from my example above decided to review the
directory a second time. I doubt that this is worth the trouble.


Oliver Scholz               25 Brumaire an 211 de la Révolution
Taunusstr. 25               Liberté, Egalité, Fraternité!
60329 Frankfurt a. M.       http://www.jungdemokratenhessen.de
Tel. (069) 97 40 99 42      http://www.jdjl.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]