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: Sat, 6 Oct 2018 17:16:59 -0300 Message-ID: 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" X-Trace: blaine.gmane.org 1538856967 15343 195.159.176.226 (6 Oct 2018 20:16:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 6 Oct 2018 20:16:07 +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 06 22:16:02 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 1g8sza-0003tZ-3W for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Oct 2018 22:16:02 +0200 Original-Received: from localhost ([::1]:40285 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8t1g-0003qw-El for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Oct 2018 16:18:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8t1Z-0003qb-Jd for bug-gnu-emacs@gnu.org; Sat, 06 Oct 2018 16:18:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g8t1W-00049J-EJ for bug-gnu-emacs@gnu.org; Sat, 06 Oct 2018 16:18:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34619) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g8t1W-000476-7x for bug-gnu-emacs@gnu.org; Sat, 06 Oct 2018 16:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g8t1W-0006br-2h for bug-gnu-emacs@gnu.org; Sat, 06 Oct 2018 16:18: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: Sat, 06 Oct 2018 20:18: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.153885703925358 (code B ref 31240); Sat, 06 Oct 2018 20:18:02 +0000 Original-Received: (at 31240) by debbugs.gnu.org; 6 Oct 2018 20:17:19 +0000 Original-Received: from localhost ([127.0.0.1]:38877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g8t0p-0006aw-Gl for submit@debbugs.gnu.org; Sat, 06 Oct 2018 16:17:19 -0400 Original-Received: from mail-lj1-f193.google.com ([209.85.208.193]:46727) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g8t0o-0006aj-BY for 31240@debbugs.gnu.org; Sat, 06 Oct 2018 16:17:18 -0400 Original-Received: by mail-lj1-f193.google.com with SMTP id x3-v6so902259lji.13 for <31240@debbugs.gnu.org>; Sat, 06 Oct 2018 13:17:18 -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=6yWbBrIVt+7mqyQfsQbzK1EdLXb0Bvxo6e/O8j0ZoSk=; b=PuFJe0+A5wkPXA60efX852fpp6ypqbdCt25376nsEm2I+SlXwegKOrp5PJwsZUXfFT 7ywtBOkW3VRpEb3xq14yv9rsBhf/lkadH7CtnvCxS5N9EDi5z/7hGIVmWuZXLtyezbQk GLvpCVryPtXyNgz85BGUnWICVWzKm2Sj3rJUGG9ffCy+uIcsnGZCIhve1XWSgLHrge0G 0OFd/UXTanOnr+xhhn5soE/i6VrqEySpph9HMj/LuisYAPvpLi5WOmX4yiJ0VB1ybkKc Tck7JUOE3I2GYIbl+FSSiJl69xQvgd3sP6ZdDKtpAOC/x4QBs/Zi7nsX4rUrlu1pUKVL xoBA== 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=6yWbBrIVt+7mqyQfsQbzK1EdLXb0Bvxo6e/O8j0ZoSk=; b=IT9LU07Iaynd97c0WyGB05/v5YlPn3V8Rq7KURd41Qi7No0VT3rrqoxcc1qn9yZffl 043B3Otteg2WvDKroCAffTbEJdXkJ/GHLjMo9tFfagAxYW956pLwjum9d+W5yLhcNDBs eVCCMA3ctFkmKrvh94ulABLo43+xO0b/3NEOpFmpDOXKvAeWtxhAeMNiN5ta3KBA/PE/ dUtp63gn6nwSBgwoGgq+yRlSqTDhcMP48KxKV8Twej3+T5gAy8+LaYxJ/863uvplGIPQ SKLfyCa0IC88GWSN6dnt2qlx4OOMUoybLKZ/ztpJm+RgkYJLpDf6aAw7HuHj5+qGKL/G A5/Q== X-Gm-Message-State: ABuFfohOH5z5mRMFAvPTNM+oOR8kMJqk9J96On3/s4vgIBOaEkKS2iM+ PboQ/CMBvyvhMKEyvtt+e7o90uPEdT+JweV9aqU= X-Google-Smtp-Source: ACcGV614Nimr/Gc65cJL/ClzopMagEzYR0djad37wqIwMqmxgnmm7z2qw37eZROJ2vgb1YBv1vCD6DJrVNjPvHPIfpc= X-Received: by 2002:a2e:6a19:: with SMTP id f25-v6mr10708188ljc.50.1538857032122; Sat, 06 Oct 2018 13:17:12 -0700 (PDT) In-Reply-To: <5BB8EC23.1040303@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:150967 Archived-At: > FWIW I see no problems with the following naive amendment > > (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) > (not (= (line-number-at-pos start) > (line-number-at-pos point-to-paste))))) > > which also allows shifting the rectangle strictly to the left or > right. IIUC it's the deletion of the original rectangle after the > copy was inserted on a different line that's causing havoc with > intersections. But I have not tested all possible variants so please > correct me if I'm wrong. 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. 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.