all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: rms@gnu.org
Cc: Chong Yidong <cyd@stupidchicken.com>, emacs-devel@gnu.org
Subject: Re: [dooglus@gmail.com: display problem after renaming open image files]
Date: Tue, 03 Apr 2007 10:12:47 +0200	[thread overview]
Message-ID: <868xd998qo.fsf@lola.quinscape.zz> (raw)
In-Reply-To: <E1HYdjH-00074E-E0@fencepost.gnu.org> (Richard Stallman's message of "Tue\, 03 Apr 2007 03\:46\:59 -0400")

Richard Stallman <rms@gnu.org> writes:

>     > $ cp ../pic.png pic1.png
>     > open the first file
>     > rename pic1.png to pic3.png:
>     > revisit the first file
>     > The image shows up as a small square rather than the real image.
>
>     This is because the underlying image file, pic1.png, is gone.  I think
>     this is not worth fixing at this point.
>
> It is clearly a bug, and we should try to fix it.

I can't see that.

> What causes this bug?  What data structure still refers
> to the old file name, and has not been updated to the new one?

The image property.  And Emacs does not track the arbitrary renaming
of files outside of it.

We can either let the image property refer to the file, or we can use
a :data property.  The latter, however, would require duplicating the
image content into that property, so we'll permanently have

a) the image buffer with the content
b) the :data property with the content
c) the image cache with the content

That's a bit much.  I think it is fine to refer to the file as long as
Emacs is not used for editing images.  And I would even go so far to
say that we could junk the buffer contents and reload it when exiting
image mode.

In a somewhat less extreme manner, one could junk the buffer contents
and _move_ them into a :data property, then move them out again when
exiting image mode.  That way the content would stay in the buffer,
would not rely on the external file, and would not take up extra
space.

Another possibility would be to allow one or several of
a) a buffer
b) an overlay (use the covered text)
c) a cons of two markers
d) t (use the data covered by the overlay itself)
as an argument to the :data parameter of an image property.  Then we
would not need to copy material back and forth.  One would need to
think about what could happen when the material references by :data
changes.

While this may make for interesting additions (especially when talking
about simple formats like pnm which can be easily manipulated within
Emacs), the current state of affairs is _perfectly_ usable, reasonably
understandable and consistent and fit for release.

-- 
David Kastrup

  reply	other threads:[~2007-04-03  8:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-01 21:42 [dooglus@gmail.com: display problem after renaming open image files] Richard Stallman
2007-04-01 22:16 ` Chong Yidong
2007-04-03  7:46   ` Richard Stallman
2007-04-03  8:12     ` David Kastrup [this message]
2007-04-03 14:03       ` Chong Yidong
2007-04-05 23:13       ` Richard Stallman
2007-04-05 23:55         ` Chong Yidong
2007-04-06 17:18           ` Kim F. Storm
2007-04-07 12:41           ` Richard Stallman
2007-04-07 14:54             ` Chong Yidong

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=868xd998qo.fsf@lola.quinscape.zz \
    --to=dak@gnu.org \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=rms@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 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.