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: Thu, 27 Sep 2018 20:45:42 -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 1538091921 19426 195.159.176.226 (27 Sep 2018 23:45:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 27 Sep 2018 23:45:21 +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 Fri Sep 28 01:45:16 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 1g5fy8-0004xU-CJ for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Sep 2018 01:45:16 +0200 Original-Received: from localhost ([::1]:40334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5g0E-0006dy-LR for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Sep 2018 19:47:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5g03-0006Vk-Of for bug-gnu-emacs@gnu.org; Thu, 27 Sep 2018 19:47:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g5fzt-00072b-9U for bug-gnu-emacs@gnu.org; Thu, 27 Sep 2018 19:47:10 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52822) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g5fzq-0006z1-FM for bug-gnu-emacs@gnu.org; Thu, 27 Sep 2018 19:47:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g5fzq-0007Nz-BZ for bug-gnu-emacs@gnu.org; Thu, 27 Sep 2018 19:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Federico Tedin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Sep 2018 23:47:02 +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.153809196228301 (code B ref 31240); Thu, 27 Sep 2018 23:47:02 +0000 Original-Received: (at 31240) by debbugs.gnu.org; 27 Sep 2018 23:46:02 +0000 Original-Received: from localhost ([127.0.0.1]:57080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g5fys-0007MM-7i for submit@debbugs.gnu.org; Thu, 27 Sep 2018 19:46:02 -0400 Original-Received: from mail-it1-f174.google.com ([209.85.166.174]:37119) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g5fyq-0007Lr-IE for 31240@debbugs.gnu.org; Thu, 27 Sep 2018 19:46:01 -0400 Original-Received: by mail-it1-f174.google.com with SMTP id m9-v6so645529ita.2 for <31240@debbugs.gnu.org>; Thu, 27 Sep 2018 16:46:00 -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=e8kHe5M97M5fllFkcBYNnHFqCMJ6S/833AUQNLDCxpI=; b=kewpdHS98Ewh4ICP2ERFc7elgiiZRNviXHd5ai2DXODbq/MMTH4K7FLq4ZMSKx31TT y7G9aCK+bvSeS+YIuEmP2X8cVuh2nOTVPC5Y9kNUSs8ieCQ7ls+YVRTmpaF7eBMvK8Do sVfx+vNL3C9y10oKa84N4UvVUXQq2YItShPuBoYjSYpcAhGXa41x94GNAab5YOkJfM7X ICkmGEeWYDJRXMCiDUGWr/3r8lnoOkW1RNHF9F40GcWukp5w4K8NNr7cUfN4OmBXVdqC chC5ZJzRDGaMq1l+lnAMPZ9sh3vz2Zdwlvh2EMewFXx0r4QIXnWX43fG1aJzRxhfqRV8 VGbQ== 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=e8kHe5M97M5fllFkcBYNnHFqCMJ6S/833AUQNLDCxpI=; b=HIQSCnNAf7pL+nKRhjo4DoEKjlHkrOZpmPeR6wmoLuyskNt2dqIHgoyt9EJ3TUm3j9 gj+6QKBlWvptJJ/+a2rClQA3vP2OgO2ZvdSI3e9RDZWGM8F3S3/0GBftwnao/Vm8nNdy WBxdPpVUW3lJO9VyIZ6k396me6R9ck4ZOzJoGrg+QZDNNcEwKfNaqkP1N6vK8xOPaZdQ 75VyOsuL84wkOig3gUO3g/xqqBoMGeHd4XDr5WiwpwMAFpEdOka3idlJD4rWmHeA+cBd jbMlsDC5cu1KFL3GOODtGIIdZjVLXC1mmRvAM664TbwSgl4AddjoL71f2YLHLkIKbxj+ fvlA== X-Gm-Message-State: ABuFfoihaSZ/AIVtXEz9ZljSHN1goL/m/KPyYzR7nP6GpLrS3M6kvJNB hGZBkPngDfJhcfq4gQkEUXn+3oPz3WPxweSeoo/cXLYw X-Google-Smtp-Source: ACcGV62eSIT8sWD6Se3Jp2Pl1Vj8pEh0J39+cIFTyVJ+qC3Nu1rNR17/liYCx7iYWOB0QUS7pQL4qIjJYdV73bGZEl4= X-Received: by 2002:a02:844c:: with SMTP id l12-v6mr7905628jah.137.1538091954665; Thu, 27 Sep 2018 16:45:54 -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:150729 Archived-At: > Thanks! > > I tried this to test the patch: > > src/emacs -Q > M-x set-variable RET mouse-drag-and-drop-region RET t > With the mouse, drag from the "n" in "not saved" to the space after "C-x C-f" (in *scratch*) > C-x SPC > Now drag the region until the cursor is on the "a" of "and" > > For some reason, the region is not moved, and it gets re-activated as > a normal region instead of a rectangular region. Maybe I'm missing > something obvious. I was able to get the dragging of a rectangular > region working sometimes, but not consistently. I've tried your test, and it does break my fix, as you mentioned. The problem was in the criteria used to define the variable 'drag-but-negligible'. The drag action used in your test was being incorrectly marked as negligible. Because of this, the region was also re-activated, but not in Rectangle Mark mode (this was also a bug). I have made a correction where the variable 'drag-but-negligible' is defined, so dragging a rectangle region outside of itself will no longer mark it as negligible; and when it _is_ negligible, the region is re-activated as a rectangle again. I've also found some cases where the overlay list is not working well enough to track the selected rectangle. For example, if a buffer contains the following: aaaa BBbb CCcc Dragging a 2x2 square starting from the first 'B' (spaces added for clarity): a a a a [B B]b b [C C]c c to the column where the second 'a' is, results in the following: a B B a a a b b c c In this case, two 'C's are missing in the second line (after the first 'b'). The reason this is happening is the following: when mouse-drag-and-drop-region is called, the initial overlays are the following (shown with braces): a a a a {B B}b b {C C}c c After the 2x2 square is inserted on the second 'a', the first overlay is automatically expanded, because characters where inserted between its start/end: a B B a a a {b C C b}b b {c c}c c When the original text is then deleted (by deleting all overlays), the result is: a B B a a a b b c c So I think I have two options now: either forbid the user from dragging a rectangle to a position where the inserted rectangle would intersect the original rectangle, or find another way to track the originally selected rectangle in a way it can be accurately deleted after inserting it in the new position. I guess I'll go with the second option, since it would make function more useful for users.