From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#31240: 26.1; mouse-save-then-kill does not kill rectangles Date: Sun, 07 Oct 2018 08:17:09 +0200 Message-ID: <5BB9A4E5.3070308@gmx.at> References: <5BADDC88.7010206@gmx.at> <5BB10CCE.4020503@gmx.at> <5BB1DBF0.5060706@gmx.at> <5BB320CA.5090606@gmx.at> <5BB36FF4.80403@gmx.at> <5BB70B54.5000103@gmx.at> <864le0agjk.fsf@misasa.okayama-u.ac.jp> <5BB8EC23.1040303@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1538892984 31329 195.159.176.226 (7 Oct 2018 06:16:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 7 Oct 2018 06:16:24 +0000 (UTC) Cc: 31240@debbugs.gnu.org, homeros.misasa@gmail.com, tkk@misasa.okayama-u.ac.jp, charles@aurox.ch To: Federico Tedin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 07 08:16:19 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 1g92MV-00083L-AI for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Oct 2018 08:16:19 +0200 Original-Received: from localhost ([::1]:41292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g92Ob-0005qM-PF for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Oct 2018 02:18:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g92OF-0005i3-Du for bug-gnu-emacs@gnu.org; Sun, 07 Oct 2018 02:18:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g92OA-0004H3-G3 for bug-gnu-emacs@gnu.org; Sun, 07 Oct 2018 02:18:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34733) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g92OA-0004Gn-Ba for bug-gnu-emacs@gnu.org; Sun, 07 Oct 2018 02:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g92O9-00049n-To for bug-gnu-emacs@gnu.org; Sun, 07 Oct 2018 02:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Oct 2018 06:18: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.153889305515946 (code B ref 31240); Sun, 07 Oct 2018 06:18:01 +0000 Original-Received: (at 31240) by debbugs.gnu.org; 7 Oct 2018 06:17:35 +0000 Original-Received: from localhost ([127.0.0.1]:38991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g92Nj-000498-79 for submit@debbugs.gnu.org; Sun, 07 Oct 2018 02:17:35 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:40363) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g92Nh-00048u-W4 for 31240@debbugs.gnu.org; Sun, 07 Oct 2018 02:17:34 -0400 Original-Received: from [192.168.1.101] ([46.125.249.119]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MIPhr-1g8Dh8348d-0049Pb; Sun, 07 Oct 2018 08:17:13 +0200 Original-Received: from [192.168.1.101] ([46.125.249.119]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MIPhr-1g8Dh8348d-0049Pb; Sun, 07 Oct 2018 08:17:13 +0200 In-Reply-To: X-Provags-ID: V03:K1:2cO0wUKvzhjaG11F602LQRKZwtFBSgIqGuBk1UpdM8sFhQlJByp WnL1rvvgULXFqAZ5TBu9q6jGpfXQOzeb7siQuAWcUAnarvcN/2P0Eu9m7Pdfjt417jFPDbV GIuecGne9GgoJQtzjp+Y98g41HGMg1YknbvzVPHOuQpjONIv3y6rm0ukQD98vAtUEBVIJrR IM7Lq6+uHWfGuqepsZFQw== X-UI-Out-Filterresults: notjunk:1;V01:K0:FbzXKCx+eHg=:dHYIlC8BZ9tYYUJ66wMDsR iNC8jz90bfnvdyTmWbk9CpQw2Ig0MOqdMwpCeS8AedouyTXyA2WP0d+xU4FSx1ISODI4QvM8G YF+BvFvGwTCkV5Y0ytRm60WJ0f8qOwj2gFddr7bT8xKngozM0KLKfUFyglXmNzqVbEdi0E+Pl son23FVM3W5zb8IB+FN/OgxuYB/hWgnhJ2fD6350Ge0kCA+Y1rl8b0E93hJ9thjHovH02AWQM WbkN/gZyEc9Qho4I4AuiBVnYu7XfX+Q3AdMVgHg7hcXTJscwwNlrznfiRYAehzghmps+6Mzug D4coaJUYGpuMaXrkwR7IaOSz3WyhWNZvdj7lYwKnkHpDXLra+WgCwH21kI6PyfjzkgdJNL15F DVabXpki1tjQT5EByxOLSZ8LOpwjnC/Uxf23EIRWbBZtJVZShUOybaebsC9Zu0qiL78tJjS/f CZaVGtmhT6ahLpHKNNVFzvWYOlvPUmr++yrNUSQMivgTe92Q2Wa6BggThlrBbvDOePOGPcjxc Venf1t8ahF4rvYYCPRL4XdcEnYU5IVzFsHNLD9LruK7OomYLPw8jyakddNZgPw6S5M05Q4beQ dl/DsKmyQtcs8OxNiAFJiYA+vOWK0zPeBSNcDhTSfXyNfV5up0u+aowAREbaxtnjY7Mju0LLX mPYyG999gtWlfWuiU3WoaK2hUL6Yz76MuCWGxq9MlrzVgqIP011tbixcK0cVD0DmF/Tpy0Wcy eLKRggqCsbpqVFy3pw01fUhFdGQrvvszc5BWowZRYK1IGkTAWEGJzgKcqz3n+EVkfHID2Hc5 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:150970 Archived-At: > The problem with this is that when the rectangle is inserted to the > right of the original one, it is inserted inside the overlays tracking > the selected rectangular region. When the original rectangle is then > deleted (by deleting the overlays), the newly inserted rectangle is > also deleted. You can try this by dragging a rectangle 1 char to the > right. You're probably right, I have no knowledge of the rectangle code. Another naive try: Disallow inserting the rectangle in the first row of the original because that case is almost identical to that of inserting a contiguous region into itself. (if region-noncontiguous (let ((size (cons region-width region-height))) (and (rectangle-intersect-p (rectangle-position-as-coordinates start) size (rectangle-position-as-coordinates point-to-paste) size) (or (not (= (line-number-at-pos start) (line-number-at-pos point-to-paste))) (and (>= start point-to-paste) (<= point-to-paste (+ start (car size)))))))) > This problem exists because mouse-drag-and-drop-region first inserts > the dragged contents, and then deletes the original selection. Is > there a reason this has been implemented like this? It sounds like it > would make more sense to first delete the original selection, and then > insert it elsewhere. This would be almost the same as killing and then > yanking some text. That being said, for non-rectangular regions, any > of the two methods works the same. Maybe undoing the operation is more conservative the way we do it now: Currently, a first undo step would restore the original and a second step would delete the copy. Otherwise, we would delete the copy first and then restore the original which would leave us with no clue of whatever the region contained after the first undo step. Kunihiro-san could tell us more about this, maybe. OTOH if reverting the order yields good results when moving the text to an intersecting but different line we could special-case the delete first/copy afterwards behavior on region-noncontiguous. martin