all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Jason Baietto <jason@cholula.ccur.com>
Cc: 9178@debbugs.gnu.org, jason.baietto@ccur.com
Subject: bug#9178: 23.1; iimage mode copy and paste file corruption
Date: Tue, 20 Aug 2019 14:14:14 -0700	[thread overview]
Message-ID: <87d0gzzgih.fsf@mouse.gnus.org> (raw)
In-Reply-To: <201107261624.p6QGO210017011@localhost6.localdomain6> (Jason Baietto's message of "Tue, 26 Jul 2011 12:24:02 -0400")

Jason Baietto <jason@cholula.ccur.com> writes:

> I am using the iimage mode to display in-lined images in text files.
> When images are displayed, an image may be double-clicked to select
> it and then pasted at point within the same buffer using the middle
> mouse button.  I can do this using emacs on both Linux and Windows.
>
> The image will appear to be inserted at point and will be displayed as
> as expected (i.e. as a picture).

(I'm going through old bug reports that have unfortunately gotten no
attention yet.)

> However, the the copy and paste was
> a lie.  Although the image is displayed at the new location, only the
> first selectable "word" of the image path has been selected and
> pasted.

I'm unable to reproduce this error in Emacs 27 -- the image is not
copied over at all by double-clicking it.  Instead I get the first
"word" of the image selected, so it works as if the image wasn't there
at all.

Even killing and yanking text with images won't copy over the image,
which seems pretty odd, but was introduced by the patch below.

I can understand removing the image when the text changes, but removing
it when yanking the text seems odd...

Anyway, I agree that double-clicking the image should probably copy the
entire text under the image, which requires changing what the
double-mouse-1 action is in iimage-mode buffers, I guess?
`C-h k double-mouse-1' didn't say what the command is, though.

commit 277e67418184c2e7d75ac317da095880c981ccd9
Author: Martin Pohlack <mp26@os.inf.tu-dresden.de>
Date:   Mon Jun 7 17:01:23 2010 -0400

    * lisp/iimage.el: Remove images as soon as the underlying text is modified.
    (iimage-modification-hook): New function.
    (iimage-mode-buffer): Use it.

(defun iimage-modification-hook (beg end)
  "Remove display property if a display region is modified."
  ;;(debug-print "ii1 begin %d, end %d\n" beg end)
  (let ((inhibit-modification-hooks t)
        (beg (previous-single-property-change end 'display
                                              nil (line-beginning-position)))
        (end (next-single-property-change     beg 'display
                                              nil (line-end-position))))
    (when (and beg end (plist-get (text-properties-at beg) 'display))
      ;;(debug-print "ii2 begin %d, end %d\n" beg end)
      (remove-text-properties beg end
                              '(display nil modification-hooks nil)))))



-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





      reply	other threads:[~2019-08-20 21:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-26 16:24 bug#9178: 23.1; iimage mode copy and paste file corruption Jason Baietto
2019-08-20 21:14 ` Lars Ingebrigtsen [this message]

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=87d0gzzgih.fsf@mouse.gnus.org \
    --to=larsi@gnus.org \
    --cc=9178@debbugs.gnu.org \
    --cc=jason.baietto@ccur.com \
    --cc=jason@cholula.ccur.com \
    /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.