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: Fri, 12 Oct 2018 19:08:50 -0300 Message-ID: References: <5BB8EC23.1040303@gmx.at> <5BB9A4E5.3070308@gmx.at> <20181008.192544.1387561894315194511.tkk@misasa.okayama-u.ac.jp> <5BBC5C25.8080002@gmx.at> <5BBD9A08.3090707@gmx.at> <5BC05F09.40007@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1539382089 15466 195.159.176.226 (12 Oct 2018 22:08:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 12 Oct 2018 22:08:09 +0000 (UTC) Cc: 31240@debbugs.gnu.org, homeros.misasa@gmail.com, tkk@misasa.okayama-u.ac.jp, charles@aurox.ch To: rudalics@gmx.at Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 13 00:08:04 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 1gB5bI-0003uH-BX for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Oct 2018 00:08:04 +0200 Original-Received: from localhost ([::1]:42828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gB5dO-00025U-Iw for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 Oct 2018 18:10:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gB5dI-00021C-JB for bug-gnu-emacs@gnu.org; Fri, 12 Oct 2018 18:10:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gB5dD-0001qL-G0 for bug-gnu-emacs@gnu.org; Fri, 12 Oct 2018 18:10:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43302) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gB5dD-0001q5-At for bug-gnu-emacs@gnu.org; Fri, 12 Oct 2018 18:10:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gB5dC-0000cq-Px for bug-gnu-emacs@gnu.org; Fri, 12 Oct 2018 18:10: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: Fri, 12 Oct 2018 22:10: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.15393821512332 (code B ref 31240); Fri, 12 Oct 2018 22:10:02 +0000 Original-Received: (at 31240) by debbugs.gnu.org; 12 Oct 2018 22:09:11 +0000 Original-Received: from localhost ([127.0.0.1]:47560 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gB5cN-0000bY-FN for submit@debbugs.gnu.org; Fri, 12 Oct 2018 18:09:11 -0400 Original-Received: from mail-lj1-f181.google.com ([209.85.208.181]:39304) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gB5cL-0000bL-Da for 31240@debbugs.gnu.org; Fri, 12 Oct 2018 18:09:09 -0400 Original-Received: by mail-lj1-f181.google.com with SMTP id p1-v6so12587679ljg.6 for <31240@debbugs.gnu.org>; Fri, 12 Oct 2018 15:09:09 -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=ntWp4oAWkj4oWsaUO6hXFWhzWI/kUCoMkogZYrsBSt4=; b=r1gjd5ldibRkJphHYKjKcGP1P3IkArRkpX78gCsR11dvy8mbthGt/+tLM0UrlvpNkw bkcH77UmmIEGTu8fQEhJ+Rv1nIuMKLcmXHHoA+xY+42sNpbzFIyr9sf5QvAhO2X7L82E 1nwIGYI/PxnZyA5RkZIb8q5HSXGkio4gxe4Q5kbflgfV+34a2l0utRwD7XL2vuRvuboT 8Cck7E4iWBadXdMa0mil3WM1884iHVVgv/PpOCxgguc6IcfFN6YmiG205nbCgc0ccUH1 DPEMCqV700kctqDI4KGx4gB8JWys4zC3MfV7lO0HmR0juVpk54nIEHkMHBB9Pbzye0WM ABGw== 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=ntWp4oAWkj4oWsaUO6hXFWhzWI/kUCoMkogZYrsBSt4=; b=tpTjd+bYtUbeP/KRceT35XCEnSIEvGIwzBNMYTanHRZIIuPSL2sLHNnj9D03aySkGM RIDXWkt0FfhQWTKG4I75yMK7Cm+3nqjJVrGFO3gyPZlTjs0OmobWe7ExkwLI5r3LuL/r tfZykFmMq8nimY/2XF1Yhk3bMpS8zZHLD9R6WQYTw1FAVPEqJ3pntBZWyLQpvwLV/VkI Ybd0aLfG0QvZ0kD45EbtGpXn5+Q4YicKgSDoQ4twU0fiF1AT8R6isHVSfmOgG4GNxbXD MoJ16fh01qOy01K93j1F1bGJowF99+/zJJH3WO4Hh7QzzyArhLAYL+jSlOfu2Md4V8t0 nCng== X-Gm-Message-State: ABuFfogTkSlYxInC7pkLBW8nEyqrmMAuGS0lRmS8X+7mKPZhBOQH+FR2 SD3LHHjog0Ay4WPmHGrji6wUU3wpeNdmXhRnOkw= X-Google-Smtp-Source: ACcGV60DqXoGPs943WVv2+dP+3n6wRsobIBbfrVcnWVp1nLUZVDLgZNWevy4j0WDXtJQG3fJrzlbMVFm4mt2bA7aqXw= X-Received: by 2002:a2e:900c:: with SMTP id h12-v6mr5449649ljg.121.1539382143309; Fri, 12 Oct 2018 15:09:03 -0700 (PDT) In-Reply-To: <5BC05F09.40007@gmx.at> 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:151189 Archived-At: > If I now drag it up by one line and four columns to the right (so that > it just does not intersect with itself) I get > > ;;;;;;;;;;RECT;;;;;;;;; > ;;;;;;RECT;;;;;;;;; > ;;;;;;RECT;;;;;;;;; > ;;;;;;RECT;;;;;;;;; > ;;;;;;RECT;;;;;;;;; > ;;;;;;;;;;;;;;; > ;;;;;;;;;;;;;;;;;;; > > which is somehow counterintuitive. Any ideas? This is because after inserting the rectangle, the original rectangle (which is to the left of the inserted one) is deleted. When it is deleted, then the last 4 lines of the inserted rectangle are shifted to the left: 1) Inserted new rectangle: ;;;;;;;;;;RECT;;;;;;;;; ;;;;;;RECTRECT;;;;;;;;; ;;;;;;RECTRECT;;;;;;;;; ;;;;;;RECTRECT;;;;;;;;; ;;;;;;RECTRECT;;;;;;;;; ;;;;;;RECT;;;;;;;;; ;;;;;;;;;;;;;;;;;;; 2) Deleted the original one: ;;;;;;;;;;RECT;;;;;;;;; <--- this line isn't shifted ;;;;;;RECT;;;;;;;;; ;;;;;;RECT;;;;;;;;; ;;;;;;RECT;;;;;;;;; ;;;;;;RECT;;;;;;;;; ;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; I've thought up two ways of dealing with this problem: A) Forbid the user from dragging the rectangle to the right when the new rectangle is *not* completly above or completly below the original one. As an exception, allow the user to drag the rectangle purely to the right (same line). In this option, the drag operation in your example would not be permitted. I think this option would be a bit confusing for users (and too restrictive). B) Add a variable mouse-drag-and-drop-rectangle-fill, initially set to nil. When the variable's value is nil, the behaviour of dragging and dropping rectangles is exactly the same as it is now. When it is set to a non-nil value (for example, " "), then replace all characters of the original rectangle with the variable's value. In this case, your example would look like this: 1) M-: (setq mouse-drag-and-drop-rectangle-fill " ") 2) Inserted new rectangle: ;;;;;;;;;;RECT;;;;;;;;; ;;;;;;RECTRECT;;;;;;;;; ;;;;;;RECTRECT;;;;;;;;; ;;;;;;RECTRECT;;;;;;;;; ;;;;;;RECTRECT;;;;;;;;; ;;;;;;RECT;;;;;;;;; ;;;;;;;;;;;;;;;;;;; 3) Deleted the original one: ;;;;;;;;;;RECT;;;;;;;;; ;;;;;; RECT;;;;;;;;; ;;;;;; RECT;;;;;;;;; ;;;;;; RECT;;;;;;;;; ;;;;;; RECT;;;;;;;;; ;;;;;; ;;;;;;;;; ;;;;;;;;;;;;;;;;;;; I can't think of any other way of ensuring the inserted rectangle retains its shape after being inserted, if there are pending delete operations to its left.