From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#9178: 23.1; iimage mode copy and paste file corruption Date: Tue, 20 Aug 2019 14:14:14 -0700 Message-ID: <87d0gzzgih.fsf@mouse.gnus.org> References: <201107261624.p6QGO210017011@localhost6.localdomain6> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="18769"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 9178@debbugs.gnu.org, jason.baietto@ccur.com To: Jason Baietto Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 20 23:27:16 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i0Beu-0004mx-Fg for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Aug 2019 23:27:16 +0200 Original-Received: from localhost ([::1]:41940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Bes-0000eT-Mz for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Aug 2019 17:27:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54890) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0BT5-0008PS-UO for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2019 17:15:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0BT4-00050d-MK for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2019 17:15:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53575) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0BT4-00050T-IO for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2019 17:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i0BT4-0005xs-Ac for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2019 17:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Aug 2019 21:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9178 X-GNU-PR-Package: emacs Original-Received: via spool by 9178-submit@debbugs.gnu.org id=B9178.156633566322860 (code B ref 9178); Tue, 20 Aug 2019 21:15:02 +0000 Original-Received: (at 9178) by debbugs.gnu.org; 20 Aug 2019 21:14:23 +0000 Original-Received: from localhost ([127.0.0.1]:34163 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i0BSR-0005wd-7f for submit@debbugs.gnu.org; Tue, 20 Aug 2019 17:14:23 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:53906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i0BSP-0005wV-NO for 9178@debbugs.gnu.org; Tue, 20 Aug 2019 17:14:22 -0400 Original-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 ) id 1i0BSL-0004FK-3w; Tue, 20 Aug 2019 23:14:19 +0200 In-Reply-To: <201107261624.p6QGO210017011@localhost6.localdomain6> (Jason Baietto's message of "Tue, 26 Jul 2011 12:24:02 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:165445 Archived-At: Jason Baietto 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 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