From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Federico Tedin Newsgroups: gmane.emacs.bugs Subject: bug#31240: 26.1; mouse-save-then-kill does not kill rectangles Date: Sun, 23 Sep 2018 19:23:13 -0300 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1537741336 28862 195.159.176.226 (23 Sep 2018 22:22:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 23 Sep 2018 22:22:16 +0000 (UTC) Cc: 31240@debbugs.gnu.org To: charles@aurox.ch Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 24 00:22:11 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 1g4ClU-0007M1-FX for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Sep 2018 00:22:08 +0200 Original-Received: from localhost ([::1]:42726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4Cna-0004R9-NF for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Sep 2018 18:24:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4CnN-0004Qz-AS for bug-gnu-emacs@gnu.org; Sun, 23 Sep 2018 18:24:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4CnK-0005z1-6l for bug-gnu-emacs@gnu.org; Sun, 23 Sep 2018 18:24:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46925) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g4CnK-0005yv-1w for bug-gnu-emacs@gnu.org; Sun, 23 Sep 2018 18:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g4CnJ-0003Xc-Rc for bug-gnu-emacs@gnu.org; Sun, 23 Sep 2018 18:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Federico Tedin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Sep 2018 22:24: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.153774141313576 (code B ref 31240); Sun, 23 Sep 2018 22:24:01 +0000 Original-Received: (at 31240) by debbugs.gnu.org; 23 Sep 2018 22:23:33 +0000 Original-Received: from localhost ([127.0.0.1]:51183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4Cmr-0003Wt-BJ for submit@debbugs.gnu.org; Sun, 23 Sep 2018 18:23:33 -0400 Original-Received: from mail-io1-f50.google.com ([209.85.166.50]:44497) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4Cmp-0003Wh-My for 31240@debbugs.gnu.org; Sun, 23 Sep 2018 18:23:32 -0400 Original-Received: by mail-io1-f50.google.com with SMTP id u12-v6so11187691ioc.11 for <31240@debbugs.gnu.org>; Sun, 23 Sep 2018 15:23:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vihax+6rTmreAFrpZzy0mwA5G+/jNzAxHqVx/SSJhLo=; b=HsqXnWgTTSvIUCU5ikeQLkbxJd7yl9UXVBM4Ujcj8ZHGEfmHjBZTLW7sfQhknuSK9f /HN36tSKYrUjYNRccfqTkXcAdmaF7P6zKvVnhtgMxaMU6N0wZ/WlHcz0V5d38v5t+4Am Qc87MGMbnYfslm4iVlwowEmpqxlAFkzrk+L/BXCahKZeBOAJqpY0LgIFAFZQT1h55em7 fQ1kJkg8O+3156/eto6oiT77Tpth1M0c1Mdimet8HkOnKWpHr7HcahHUgMNOAScZ0k9G xC2G37+H6cyZkC5LnA2Olk7fXMlGY8t6GuqLgKaSE3lY48C5DEPnJukEYzZnSR4gc1l/ Zk6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vihax+6rTmreAFrpZzy0mwA5G+/jNzAxHqVx/SSJhLo=; b=qZRnzjcj6xn8QR8ZeTzxHgdY69KZjHYRLIukfu2qfx+Pt1qtdAB1VGTsixHuO5HUiH rvaFRP/vQFtt/C1SNWnzZHCdxNil34SKDMNafv4JBQ5x+BGjPwhtbaG0T+2SylywtPlq DE+MhG3a+oDBvz5EG9O1geirJrV8J3YROClZI0Vk+Gw6sg7njNK0qyidzSD2zTAWMWEA ho9BpqxbUtr7xkEa2btuKmF3GDy8kxctmghugLHktG3nWjJXghvp5YUYC8YsugcPt7GI 1o3IM5Sqc4pLT6ur5J9afQCbpG0m5c9thf2jMSPyrMzxl+gdAOtCSryE2IMtx9xMtBzc rA1Q== X-Gm-Message-State: ABuFfohijfKPRjaXaFFVWO4ELTirQ1CtLihYn5V/u/0CFJwm+q835u96 C4uOIntx26xg4jv0jTYHcb2UNcw5MzFeD0k/dAyRP8E8 X-Google-Smtp-Source: ACcGV60YGVVlMAjtI7dTXFYMxan1mydP0F/p5sPdK8Cmvs1P5RzXaN31Y59e5qVE8n1UW8LHugptWr6DqQtNhJeSmco= X-Received: by 2002:a5e:8347:: with SMTP id y7-v6mr6356568iom.254.1537741406027; Sun, 23 Sep 2018 15:23:26 -0700 (PDT) In-Reply-To: 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:150579 Archived-At: > Thanks, this looks good. I think we also need a similar change for > function "mouse-drag-and-drop-region", which is used when the variable > of the same name is non-nil. For example, the following recipe > exposes it: > > M-x set-variable RET mouse-drag-and-drop-region RET t RET > M-< C-SPC M-f C-n C-x SPC > Drag the rectangle region with the mouse, and its shape is ignored > > Hopefully we can apply the same kind of change in that function too. 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), 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. - 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'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.