GNU bug report logs - #9178
23.1; iimage mode copy and paste file corruption

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: jason.baietto@HIDDEN; dated Wed, 27 Jul 2011 19:12:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 9178 <at> debbugs.gnu.org:


Received: (at 9178) by debbugs.gnu.org; 20 Aug 2019 21:14:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 20 17:14:23 2019
Received: from localhost ([127.0.0.1]:34163 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1i0BSR-0005wd-7f
	for submit <at> debbugs.gnu.org; Tue, 20 Aug 2019 17:14:23 -0400
Received: from quimby.gnus.org ([80.91.231.51]:53906)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1i0BSP-0005wV-NO
 for 9178 <at> debbugs.gnu.org; Tue, 20 Aug 2019 17:14:22 -0400
Received: from [12.144.191.101] (helo=sandy)
 by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.89) (envelope-from <larsi@HIDDEN>)
 id 1i0BSL-0004FK-3w; Tue, 20 Aug 2019 23:14:19 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Jason Baietto <jason@HIDDEN>
Subject: Re: bug#9178: 23.1; iimage mode copy and paste file corruption
References: <201107261624.p6QGO210017011@HIDDEN>
Date: Tue, 20 Aug 2019 14:14:14 -0700
In-Reply-To: <201107261624.p6QGO210017011@HIDDEN> (Jason
 Baietto's message of "Tue, 26 Jul 2011 12:24:02 -0400")
Message-ID: <87d0gzzgih.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Jason Baietto <jason@HIDDEN> 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 [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 9178
Cc: 9178 <at> debbugs.gnu.org, jason.baietto@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Jason Baietto <jason@HIDDEN> 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@HIDDEN>
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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#9178; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 27 Jul 2011 19:11:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 27 15:11:10 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Qm9Vd-00074O-LS
	for submit <at> debbugs.gnu.org; Wed, 27 Jul 2011 15:11:10 -0400
Received: from eggs.gnu.org ([140.186.70.92])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <jason@HIDDEN>) id 1Qlkjz-0001mQ-EF
	for submit <at> debbugs.gnu.org; Tue, 26 Jul 2011 12:44:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jason@HIDDEN>) id 1Qlkjt-0007Gx-7g
	for submit <at> debbugs.gnu.org; Tue, 26 Jul 2011 12:44:14 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM
	autolearn=no version=3.3.1
Received: from lists.gnu.org ([140.186.70.17]:46417)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jason@HIDDEN>) id 1Qlkjt-0007Gt-69
	for submit <at> debbugs.gnu.org; Tue, 26 Jul 2011 12:44:13 -0400
Received: from eggs.gnu.org ([140.186.70.92]:53118)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jason@HIDDEN>) id 1Qlkjs-0004fu-0o
	for bug-gnu-emacs@HIDDEN; Tue, 26 Jul 2011 12:44:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jason@HIDDEN>) id 1Qlkjr-0007GO-2m
	for bug-gnu-emacs@HIDDEN; Tue, 26 Jul 2011 12:44:12 -0400
Received: from flusers.ccur.com ([173.221.59.2]:46889
	helo=localhost6.localdomain6) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jason@HIDDEN>) id 1Qlkjq-0007G1-TW
	for bug-gnu-emacs@HIDDEN; Tue, 26 Jul 2011 12:44:11 -0400
Received: from localhost6.localdomain6 (localhost.localdomain [127.0.0.1])
	by localhost6.localdomain6 (8.14.4/8.14.4) with ESMTP id p6QGO3S1017013
	for <bug-gnu-emacs@HIDDEN>; Tue, 26 Jul 2011 12:24:03 -0400
Received: (from jason@localhost)
	by localhost6.localdomain6 (8.14.4/8.14.4/Submit) id p6QGO210017011;
	Tue, 26 Jul 2011 12:24:02 -0400
Date: Tue, 26 Jul 2011 12:24:02 -0400
Message-Id: <201107261624.p6QGO210017011@HIDDEN>
From: Jason Baietto <jason@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 23.1; iimage mode copy and paste file corruption
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	2)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 140.186.70.17
X-Spam-Score: -5.1 (-----)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Wed, 27 Jul 2011 15:11:08 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
Reply-To: jason.baietto@HIDDEN
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.1 (-----)

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).  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.  The file has now been corrupted, and if you now delete the
original image path the image path will be lost; upon the next visit
to the file only the first word that was pasted will be displayed.



In GNU Emacs 23.1.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.18.9)
 of 2011-02-01 on x86-003.build.bos.redhat.com
Windowing system distributor `Red Hat, Inc.', version 11.0.10707000
configured using `configure  '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xft' '--with-xpm' '--with-x-toolkit=gtk' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'target_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.utf8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Text

Minor modes in effect:
  iimage-mode: t
  display-time-mode: t
  delete-selection-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
o r t <tab> <return> i i m a g e SPC s e l e c t i 
o n SPC c o n f u s i n g <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> f i l e SPC c o r r u p t i o n <return> 
T h e C-a C-k C-n C-n C-p C-p C-p C-x u C-k C-n C-n 
C-p C-p C-n C-n C-p C-n C-n C-n C-n C-p C-p C-p C-p 
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n <escape> x k i l l SPC b u f f <tab> <return> 
<return> C-x 0 x k C-g C-x k <down-mouse-1> <mouse-1> 
<help-echo> <help-echo> <down-mouse-1> <mouse-1> <down-mouse-1> 
<mouse-1> <escape> x i i m a g e SPC m o d e C-g C-x 
C-f t e s t . t <backspace> j <backspace> t x t <return> 
C-c C-x h C-g C-x h <backspace> y o u n g - c a r m 
e n . j p g C-a C-k C-y SPC C-y C-a C-x C-s C-c C-l 
C-c C-l C-c C-l C-c C-l C-c C-l C-c C-l C-c C-l C-c 
C-l C-c C-l <down-mouse-1> <mouse-movement> <mouse-1> 
<double-down-mouse-1> <double-mouse-1> <down-mouse-1> 
<mouse-1> SPC <down-mouse-2> <mouse-2> C-a C-x C-s 
C-x C-g C-c C-l C-c C-l C-c C-l C-c C-l C-c C-l C-c 
C-l <escape> x r e o <backspace> p o <tab> r <tab> 
e <tab> <backspace> <backspace> g <tab> <return>

Recent messages:
Mark set
Saving file /home/jason/test.txt...
Wrote /home/jason/test.txt
Iimage mode disabled
Iimage mode enabled
Iimage mode disabled
Iimage mode enabled
Iimage mode disabled
Iimage mode enabled
Making completion list...




Acknowledgement sent to jason.baietto@HIDDEN:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#9178; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.