unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [sdl.web@gmail.com: Re: problem with transparent PNG image display]
@ 2007-06-24 23:47 Richard Stallman
  0 siblings, 0 replies; 19+ messages in thread
From: Richard Stallman @ 2007-06-24 23:47 UTC (permalink / raw)
  To: emacs-devel

Would someone please debug this, then ack?

------- Start of forwarded message -------
X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS,
	UNPARSEABLE_RELAY autolearn=failed version=3.1.0
To: emacs-pretest-bug@gnu.org
From: Leo <sdl.web@gmail.com>
Date: Sun, 17 Jun 2007 10:14:40 +0100
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Subject: Re: problem with transparent PNG image display

- --=-=-=

This follows from article: <m2ac0rogco.fsf@gmail.com> in pretest-bugs
list.

For example the attached icon has transparent background but shows a
white background in Emacs.

- -- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)

- --=-=-=
Content-Type: image/png
Content-Disposition: attachment; filename=system-users.png
Content-Transfer-Encoding: base64

iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJ
TUUH1gsKFTktQWg0swAAB8FJREFUWIXlV1tsFNcZ/mbO3HZ2d/bitfGFi7HXDuZaSAqikDYIVUFC
abi4BEopD3nrG1JKGlAqiwhh16h+qPrQVkrVh7RVUiyoooBKKJcQATFp7OILF8uG2JBiK7az6/XO
5Vz6MLtjY7kEqvapR/o1u2eOzvnO93/n+88A/+9N+roBbW1tcY/n9yiKuplSWgYAiqKMUOqdU+XQ
Hw8cODDxPwPQ0nJ0k6Krb659bq1aX7dEsawYACCbzeDOndv0ascVjzreW6+/fvj8fx3A8ePNG81I
5MiObTtD4XAEsgzIsgJZlsE5B8CRzU7iz+3v5acmJ3/22ms/vfyfACBzdTY1NZm6qf+qcfuuiGka
EIKDEAJFUaGqKoQQ8DwPiqIgXVun9tzsXrd+3Y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fb307Id/dTv/3tX0zjt/OA8g87XfhoUmAShLJBLz
9ux9pbGqsmqrppF6LmAIIeb8tpiZCkJITnAx+uCLf35w8aNLJzuvdw4AGH0aAMVmwtfJYxd9HB4A
HoBc4Yl/AfM5qxyUm8X5AAAAAElFTkSuQmCC
- --=-=-=
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

- --=-=-=--
------- End of forwarded message -------

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [sdl.web@gmail.com: Re: problem with transparent PNG image display]
@ 2007-07-23 18:07 Richard Stallman
  2007-07-23 22:12 ` Jason Rumney
  2007-08-26  0:50 ` Leo
  0 siblings, 2 replies; 19+ messages in thread
From: Richard Stallman @ 2007-07-23 18:07 UTC (permalink / raw)
  To: emacs-devel

[I sent this message a few weeks ago but did not get a response.]

Would someone please debug this, then ack?

------- Start of forwarded message -------
X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS,
	UNPARSEABLE_RELAY autolearn=failed version=3.1.0
To: emacs-pretest-bug@gnu.org
From: Leo <sdl.web@gmail.com>
Date: Sun, 17 Jun 2007 10:14:40 +0100
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Subject: Re: problem with transparent PNG image display

- --=-=-=

This follows from article: <m2ac0rogco.fsf@gmail.com> in pretest-bugs
list.

For example the attached icon has transparent background but shows a
white background in Emacs.

- -- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)

- --=-=-=
Content-Type: image/png
Content-Disposition: attachment; filename=system-users.png
Content-Transfer-Encoding: base64

iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJ
TUUH1gsKFTktQWg0swAAB8FJREFUWIXlV1tsFNcZ/mb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lkCVVUhyxIIIYIxKmUyX0FVtcJk05cpSRIQ
wrfhaSMSs7QkEA6b6OzsQmlpGVRFYVSjkaIT5q9cunKvp7PnwA/3/2BTz43uDYpGFgoBTQhBVFXN
j42Ph23bQWVlReF0FF1PFGqAeARAMecz64I/FsjlchifmFBoho7OvhMaADTMui0ffvONfSuWr2je
uGFjqDiJ7w9yYMFFG55WvQgWn8lEJpNFNpsVH12+ePXgTw59a/a1nAJwANgzY3Dg7p36JendyWRJ
Yn7VfKlI6Wylz4zZu5ZlAtMMQwiBv50/Z1/v+OzH3d3dg3N+F8xumUxGydn5Dl3TXszlcno8HidW
NIZQyEQoFIKuh2AYBnR9Oor/DSMEWSZwHAe9fb307Id/dTv/3tX0zjt/OA8g87XfhoUmAShLJBLz
9ux9pbGqsmqrppF6LmAIIeb8tpiZCkJITnAx+uCLf35w8aNLJzuvdw4AGH0aAMVmwtfJYxd9HB4A
HoBc4Yl/AfM5qxyUm8X5AAAAAElFTkSuQmCC
- --=-=-=
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

- --=-=-=--
------- End of forwarded message -------

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [sdl.web@gmail.com: Re: problem with transparent PNG image display]
  2007-07-23 18:07 Richard Stallman
@ 2007-07-23 22:12 ` Jason Rumney
  2007-07-24 16:45   ` Richard Stallman
                     ` (2 more replies)
  2007-08-26  0:50 ` Leo
  1 sibling, 3 replies; 19+ messages in thread
From: Jason Rumney @ 2007-07-23 22:12 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

Richard Stallman wrote:
> [I sent this message a few weeks ago but did not get a response.]
>
> Would someone please debug this, then ack?
>   
> For example the attached icon has transparent background but shows a
> white background in Emacs.
>   
Someone investigated before the release, and decided that the image
caching code needed overhauling, so this should be done in the trunk.

Because we cache images in their uncompressed and rendered form, we
cannot support full transparency for png images. So we use the
background color that is saved in the image itself to render the image.
When no background color is saved in the image, we render using the
background color of the face the image is first drawn with, so the
problem is not immediately apparent with those images, but if you draw
the same image object onto a different colored background, you will see
the same problem occur.

I don't know which platforms will let us cache image objects with
transparency, but the solution would be to do that, and draw the
background separately each time the image is drawn.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [sdl.web@gmail.com: Re: problem with transparent PNG image display]
  2007-07-23 22:12 ` Jason Rumney
@ 2007-07-24 16:45   ` Richard Stallman
  2007-07-31 20:22   ` Richard Stallman
  2007-08-01 14:30   ` Richard Stallman
  2 siblings, 0 replies; 19+ messages in thread
From: Richard Stallman @ 2007-07-24 16:45 UTC (permalink / raw)
  To: Jason Rumney; +Cc: emacs-devel

    When no background color is saved in the image, we render using the
    background color of the face the image is first drawn with, so the
    problem is not immediately apparent with those images, but if you draw
    the same image object onto a different colored background, you will see
    the same problem occur.

The cache could record what background color was used for rendering.
Then, on displaying the image again, if the desired background is
different, that could cause a cache-mismatch, which would cause
re-rendering.

For efficiency, we should do that only for formats that allow
transparency.

Is it possible to tell easily whether a png image has any
transparency?  Then we could optimize the images that don't
have any transparency by not recording a background for it.

    I don't know which platforms will let us cache image objects with
    transparency, but the solution would be to do that, and draw the
    background separately each time the image is drawn.

There must be something I don't get.  What would stop us from caching
the actual image data, transparent or not?

Is the idea that we want to save the time to re-render the image?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [sdl.web@gmail.com: Re: problem with transparent PNG image display]
  2007-07-23 22:12 ` Jason Rumney
  2007-07-24 16:45   ` Richard Stallman
@ 2007-07-31 20:22   ` Richard Stallman
  2007-07-31 21:30     ` Jason Rumney
  2007-08-01 14:30   ` Richard Stallman
  2 siblings, 1 reply; 19+ messages in thread
From: Richard Stallman @ 2007-07-31 20:22 UTC (permalink / raw)
  To: Jason Rumney; +Cc: emacs-devel

[I sent this message a week ago but did not get a response.
Could we get the discussion moving again?]

    When no background color is saved in the image, we render using the
    background color of the face the image is first drawn with, so the
    problem is not immediately apparent with those images, but if you draw
    the same image object onto a different colored background, you will see
    the same problem occur.

The cache could record what background color was used for rendering.
Then, on displaying the image again, if the desired background is
different, that could cause a cache-mismatch, which would cause
re-rendering.

For efficiency, we should do that only for formats that allow
transparency.

Is it possible to tell easily whether a png image has any
transparency?  Then we could optimize the images that don't
have any transparency by not recording a background for it.

    I don't know which platforms will let us cache image objects with
    transparency, but the solution would be to do that, and draw the
    background separately each time the image is drawn.

There must be something I don't get.  What would stop us from caching
the actual image data, transparent or not?

Is the idea that we want to save the time to re-render the image?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [sdl.web@gmail.com: Re: problem with transparent PNG image display]
  2007-07-31 20:22   ` Richard Stallman
@ 2007-07-31 21:30     ` Jason Rumney
  2007-08-01 14:30       ` Richard Stallman
  0 siblings, 1 reply; 19+ messages in thread
From: Jason Rumney @ 2007-07-31 21:30 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

Richard Stallman wrote:
> [I sent this message a week ago but did not get a response.
> Could we get the discussion moving again?]
>   

I don't know enough about the image code and PNG format to answer the
questions you raised. I replied to your previous message because I
remembered that someone had looked into this already, but noone else had
spoken up about it.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [sdl.web@gmail.com: Re: problem with transparent PNG image display]
  2007-07-23 22:12 ` Jason Rumney
  2007-07-24 16:45   ` Richard Stallman
  2007-07-31 20:22   ` Richard Stallman
@ 2007-08-01 14:30   ` Richard Stallman
  2007-08-01 14:43     ` Miles Bader
  2007-08-06 16:05     ` Chong Yidong
  2 siblings, 2 replies; 19+ messages in thread
From: Richard Stallman @ 2007-08-01 14:30 UTC (permalink / raw)
  To: emacs-devel

[I sent this message a week ago but did not get a response.
Could we get the discussion moving again?]

    When no background color is saved in the image, we render using the
    background color of the face the image is first drawn with, so the
    problem is not immediately apparent with those images, but if you draw
    the same image object onto a different colored background, you will see
    the same problem occur.

The cache could record what background color was used for rendering.
Then, on displaying the image again, if the desired background is
different, that could cause a cache-mismatch, which would cause
re-rendering.

For efficiency, we should do that only for formats that allow
transparency.

Is it possible to tell easily whether a png image has any
transparency?  Then we could optimize the images that don't
have any transparency by not recording a background for it.

    I don't know which platforms will let us cache image objects with
    transparency, but the solution would be to do that, and draw the
    background separately each time the image is drawn.

There must be something I don't get.  What would stop us from caching
the actual image data, transparent or not?

Is the idea that we want to save the time to re-render the image?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [sdl.web@gmail.com: Re: problem with transparent PNG image display]
  2007-07-31 21:30     ` Jason Rumney
@ 2007-08-01 14:30       ` Richard Stallman
  0 siblings, 0 replies; 19+ messages in thread
From: Richard Stallman @ 2007-08-01 14:30 UTC (permalink / raw)
  To: Jason Rumney; +Cc: emacs-devel

    I don't know enough about the image code and PNG format to answer the
    questions you raised. I replied to your previous message because I
    remembered that someone had looked into this already, but noone else had
    spoken up about it.

OK, I will send it again, not addressed specifically to you.

We need SOMEBODY to look at this!

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [sdl.web@gmail.com: Re: problem with transparent PNG image display]
  2007-08-01 14:30   ` Richard Stallman
@ 2007-08-01 14:43     ` Miles Bader
  2007-08-01 15:55       ` Jason Rumney
  2007-08-06 16:05     ` Chong Yidong
  1 sibling, 1 reply; 19+ messages in thread
From: Miles Bader @ 2007-08-01 14:43 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:
> The cache could record what background color was used for rendering.
> Then, on displaying the image again, if the desired background is
> different, that could cause a cache-mismatch, which would cause
> re-rendering.

I thought it already did this (in image.c:search_image_cache):

2007-06-13  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* dispextern.h (struct image) [HAVE_WINDOW_SYSTEM]: New members
	frame_foreground and frame_background.

	* image.c (lookup_image): Save frame foreground and background colors.
	(search_image_cache): Check if saved and current frame colors match.

-Miles

-- 
Americans are broad-minded people.  They'll accept the fact that a person can
be an alcoholic, a dope fiend, a wife beater, and even a newspaperman, but if a
man doesn't drive, there is something wrong with him.  -- Art Buchwald

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [sdl.web@gmail.com: Re: problem with transparent PNG image display]
  2007-08-01 14:43     ` Miles Bader
@ 2007-08-01 15:55       ` Jason Rumney
  2007-08-02  0:36         ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 19+ messages in thread
From: Jason Rumney @ 2007-08-01 15:55 UTC (permalink / raw)
  To: Miles Bader; +Cc: rms, emacs-devel

Miles Bader wrote:
> I thought it already did this (in image.c:search_image_cache):
>
> 2007-06-13  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
>
> 	* dispextern.h (struct image) [HAVE_WINDOW_SYSTEM]: New members
> 	frame_foreground and frame_background.
>
> 	* image.c (lookup_image): Save frame foreground and background colors.
> 	(search_image_cache): Check if saved and current frame colors match.
>   

I think its the background on which the image is rendered that is
important, not the frame background. The toolbar has its own background
color, independent of the frame's. And that only covers caching, images
still need to be drawn with the appropriate background from the face
rather than the background color saved in the image file itself.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [sdl.web@gmail.com: Re: problem with transparent PNG image display]
  2007-08-01 15:55       ` Jason Rumney
@ 2007-08-02  0:36         ` YAMAMOTO Mitsuharu
  0 siblings, 0 replies; 19+ messages in thread
From: YAMAMOTO Mitsuharu @ 2007-08-02  0:36 UTC (permalink / raw)
  To: Jason Rumney; +Cc: emacs-devel, rms, Miles Bader

>>>>> On Wed, 01 Aug 2007 16:55:30 +0100, Jason Rumney <jasonr@gnu.org> said:

> Miles Bader wrote:
>> I thought it already did this (in image.c:search_image_cache):
>> 
>> 2007-06-13  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
>> 
>> * dispextern.h (struct image) [HAVE_WINDOW_SYSTEM]: New members
>> frame_foreground and frame_background.
>> 
>> * image.c (lookup_image): Save frame foreground and background colors.
>> (search_image_cache): Check if saved and current frame colors match.
>> 

> I think its the background on which the image is rendered that is
> important, not the frame background. The toolbar has its own background
> color, independent of the frame's. And that only covers caching, images
> still need to be drawn with the appropriate background from the face
> rather than the background color saved in the image file itself.

FWIW, that change was just for fixing excessive image cache miss (and
performance degradation caused by needless image regeneration) in the
trunk, without affecting its original intention.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [sdl.web@gmail.com: Re: problem with transparent PNG image display]
  2007-08-01 14:30   ` Richard Stallman
  2007-08-01 14:43     ` Miles Bader
@ 2007-08-06 16:05     ` Chong Yidong
  2007-08-06 16:41       ` Jason Rumney
  2007-08-07  1:21       ` Richard Stallman
  1 sibling, 2 replies; 19+ messages in thread
From: Chong Yidong @ 2007-08-06 16:05 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     When no background color is saved in the image, we render using the
>     background color of the face the image is first drawn with, so the
>     problem is not immediately apparent with those images, but if you draw
>     the same image object onto a different colored background, you will see
>     the same problem occur.
>
> The cache could record what background color was used for rendering.
> Then, on displaying the image again, if the desired background is
> different, that could cause a cache-mismatch, which would cause
> re-rendering.

There is code to handle this in the trunk, but not in the branch.

I just changed the trunk code further to ignore the background color
specified by the png image (now that Emacs can properly handle
transparency, it is more correct to always use the frame background).

If you want this bug resolved for Emacs 22, it will be necessary to
port both changes from the trunk.  I think it should be moderately
safe.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [sdl.web@gmail.com: Re: problem with transparent PNG image display]
  2007-08-06 16:05     ` Chong Yidong
@ 2007-08-06 16:41       ` Jason Rumney
  2007-08-06 17:29         ` Chong Yidong
  2007-08-07  1:21       ` Richard Stallman
  1 sibling, 1 reply; 19+ messages in thread
From: Jason Rumney @ 2007-08-06 16:41 UTC (permalink / raw)
  To: Chong Yidong; +Cc: rms, emacs-devel

Chong Yidong wrote:
> There is code to handle this in the trunk, but not in the branch.
>
> I just changed the trunk code further to ignore the background color
> specified by the png image (now that Emacs can properly handle
> transparency, it is more correct to always use the frame background).
>   

It should be the face background, not the frame background. My
understanding is that the existing code that checks the frame background
was to fix a different bug with image caching.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [sdl.web@gmail.com: Re: problem with transparent PNG image display]
  2007-08-06 16:41       ` Jason Rumney
@ 2007-08-06 17:29         ` Chong Yidong
  2007-08-06 20:14           ` Jason Rumney
  0 siblings, 1 reply; 19+ messages in thread
From: Chong Yidong @ 2007-08-06 17:29 UTC (permalink / raw)
  To: Jason Rumney; +Cc: rms, emacs-devel

Jason Rumney <jasonr@gnu.org> writes:

> Chong Yidong wrote:
>> There is code to handle this in the trunk, but not in the branch.
>>
>> I just changed the trunk code further to ignore the background color
>> specified by the png image (now that Emacs can properly handle
>> transparency, it is more correct to always use the frame background).
>
> It should be the face background, not the frame background. My
> understanding is that the existing code that checks the frame background
> was to fix a different bug with image caching.

Why should images be displayed with the face background?  That
behavior doesn't make sense, since images are not displayed with a
face.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [sdl.web@gmail.com: Re: problem with transparent PNG image display]
  2007-08-06 17:29         ` Chong Yidong
@ 2007-08-06 20:14           ` Jason Rumney
  2007-08-07 15:56             ` Chong Yidong
  0 siblings, 1 reply; 19+ messages in thread
From: Jason Rumney @ 2007-08-06 20:14 UTC (permalink / raw)
  To: Chong Yidong; +Cc: rms, emacs-devel

Chong Yidong wrote:
> Why should images be displayed with the face background?  That
> behavior doesn't make sense, since images are not displayed with a
> face.
>   

Yes they are. The tool-bar should be displayed with the tool-bar face
(likewise the mode-line and fringe).

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [sdl.web@gmail.com: Re: problem with transparent PNG image display]
  2007-08-06 16:05     ` Chong Yidong
  2007-08-06 16:41       ` Jason Rumney
@ 2007-08-07  1:21       ` Richard Stallman
  2007-08-07 16:51         ` Chong Yidong
  1 sibling, 1 reply; 19+ messages in thread
From: Richard Stallman @ 2007-08-07  1:21 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel

    If you want this bug resolved for Emacs 22, it will be necessary to
    port both changes from the trunk.  I think it should be moderately
    safe.

Please do that -- this is a bug fix.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [sdl.web@gmail.com: Re: problem with transparent PNG image display]
  2007-08-06 20:14           ` Jason Rumney
@ 2007-08-07 15:56             ` Chong Yidong
  0 siblings, 0 replies; 19+ messages in thread
From: Chong Yidong @ 2007-08-07 15:56 UTC (permalink / raw)
  To: Jason Rumney; +Cc: rms, emacs-devel

Jason Rumney <jasonr@gnu.org> writes:

> Chong Yidong wrote:
>> Why should images be displayed with the face background?  That
>> behavior doesn't make sense, since images are not displayed with a
>> face.
>
> Yes they are. The tool-bar should be displayed with the tool-bar face
> (likewise the mode-line and fringe).

In the case of transparent PNG images, I think it's more reasonable to
expect the background color to be whatever is "underneath" the image.
I, for one, would be surprised if that is not the behavior.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [sdl.web@gmail.com: Re: problem with transparent PNG image display]
  2007-08-07  1:21       ` Richard Stallman
@ 2007-08-07 16:51         ` Chong Yidong
  0 siblings, 0 replies; 19+ messages in thread
From: Chong Yidong @ 2007-08-07 16:51 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     If you want this bug resolved for Emacs 22, it will be necessary to
>     port both changes from the trunk.  I think it should be moderately
>     safe.
>
> Please do that -- this is a bug fix.

Done.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [sdl.web@gmail.com: Re: problem with transparent PNG image display]
  2007-07-23 18:07 Richard Stallman
  2007-07-23 22:12 ` Jason Rumney
@ 2007-08-26  0:50 ` Leo
  1 sibling, 0 replies; 19+ messages in thread
From: Leo @ 2007-08-26  0:50 UTC (permalink / raw)
  To: emacs-devel

On 2007-07-23 19:07 +0100, Richard Stallman wrote:
> [I sent this message a few weeks ago but did not get a response.]
>
> Would someone please debug this, then ack?

This has indeed been fixed. Many thanks.

-- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)

         Gnus is one component of the Emacs operating system.

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2007-08-26  0:50 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-24 23:47 [sdl.web@gmail.com: Re: problem with transparent PNG image display] Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2007-07-23 18:07 Richard Stallman
2007-07-23 22:12 ` Jason Rumney
2007-07-24 16:45   ` Richard Stallman
2007-07-31 20:22   ` Richard Stallman
2007-07-31 21:30     ` Jason Rumney
2007-08-01 14:30       ` Richard Stallman
2007-08-01 14:30   ` Richard Stallman
2007-08-01 14:43     ` Miles Bader
2007-08-01 15:55       ` Jason Rumney
2007-08-02  0:36         ` YAMAMOTO Mitsuharu
2007-08-06 16:05     ` Chong Yidong
2007-08-06 16:41       ` Jason Rumney
2007-08-06 17:29         ` Chong Yidong
2007-08-06 20:14           ` Jason Rumney
2007-08-07 15:56             ` Chong Yidong
2007-08-07  1:21       ` Richard Stallman
2007-08-07 16:51         ` Chong Yidong
2007-08-26  0:50 ` Leo

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).