From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: charles@aurox.ch (Charles A. Roelli) Newsgroups: gmane.emacs.bugs Subject: bug#31240: 26.1; mouse-save-then-kill does not kill rectangles Date: Mon, 24 Sep 2018 22:04:16 +0200 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1537820335 6533 195.159.176.226 (24 Sep 2018 20:18:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 24 Sep 2018 20:18:55 +0000 (UTC) Cc: 31240@debbugs.gnu.org To: Federico Tedin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 24 22:18:50 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4XJh-0001aE-6C for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Sep 2018 22:18:49 +0200 Original-Received: from localhost ([::1]:47174 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4XLn-0004RL-FQ for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Sep 2018 16:20:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4XJk-0000aM-La for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2018 16:18:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4X3S-0008VA-NI for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2018 16:02:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48143) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g4X3S-0008Uq-AC for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2018 16:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g4X3S-0006iv-23 for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2018 16:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: charles@aurox.ch (Charles A. Roelli) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Sep 2018 20:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31240 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31240-submit@debbugs.gnu.org id=B31240.153781931325831 (code B ref 31240); Mon, 24 Sep 2018 20:02:01 +0000 Original-Received: (at 31240) by debbugs.gnu.org; 24 Sep 2018 20:01:53 +0000 Original-Received: from localhost ([127.0.0.1]:52401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4X3I-0006iZ-Pz for submit@debbugs.gnu.org; Mon, 24 Sep 2018 16:01:52 -0400 Original-Received: from sinyavsky.aurox.ch ([37.35.109.145]:48674) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4X3H-0006iG-9z for 31240@debbugs.gnu.org; Mon, 24 Sep 2018 16:01:51 -0400 Original-Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id 1FF1D22869 for <31240@debbugs.gnu.org>; Mon, 24 Sep 2018 20:05:36 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= references:subject:subject:in-reply-to:to:from:from:message-id :date:date; s=dkim; t=1537819534; x=1538683535; bh=BxZJpUm0fUrDQ JBokakY8nZzSE4G3P6h/GQEIjZuGLM=; b=hKHurQeZ9GDRqAMLP6I47xemrp/t0 y5tvABCmMM3glBpWEUgHjpFd6BRMITy2JjOdSIo6x8CP0al0diK48hieWn1uFkis gh1C43DdaSkSdcZYYAwkYVu9/nZHR3glD4rY69S2mfzcx70XmoxBFwUqveX/aPLM dBBUS8irOODOBg= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Original-Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id EvEQ9kNejZV0 for <31240@debbugs.gnu.org>; Mon, 24 Sep 2018 20:05:34 +0000 (UTC) Original-Received: from gray (unknown [IPv6:2a02:1205:c693:2d60:c62c:3ff:fe30:b864]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id B955A22866; Mon, 24 Sep 2018 20:05:34 +0000 (UTC) In-reply-to: (message from Federico Tedin on Sun, 23 Sep 2018 19:23:13 -0300) 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: 208.118.235.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:150622 Archived-At: > From: Federico Tedin > Date: Sun, 23 Sep 2018 19:23:13 -0300 > > You're right about mouse-drag-and-drop-region, it doesn't work > correctly when using rectangular regions. After taking a look at the > code, I managed to fix two things: the dragged text now has the > correct rectangular contents (but the original text is incorrectly > deleted using a normal region) Would it be feasible to replace calls to "delete-region" with the right call to "region-extract-function"? Even though the current arguments to "delete-region" in "mouse-drag-and-drop-region" are based on the position of "mouse-drag-and-drop-overlay", this should not pose an issue. > , and the tooltip displaying the dragged > text also shows the correct contents. > > To fix the rest of the functionalities, I would need to know the > recommended way of handling some of the details of how > mouse-drag-and-drop-region is implemented: > > - The dragged region is tracked using an overlay. From what I > understand, this is a problem since overlays only handle regions > with a single beginning and end, and rectangles have one or more of > those. We should be able to keep using the overlay for normal regions, and adapt mouse-drag-and-drop-region to use "apply-on-rectangle" with the rectangle bounds as an argument when it needs to do something with a rectangular region. > - In order to check if the dragged text is read-only, the function > "next-single-char-property-change" is used. This function has the > same problem as the overlay, as it assumes the region is contiguous. I think "apply-on-rectangle" could be helpful here too. > I'm thinking both problems could be solved by using a list of overlays > instead of just one, creating them from the result of calling > "region-bounds". Then, the rest of the function could be adapted to > use the overlay list. Yes, this would work too.