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: Mon, 8 Oct 2018 20:18:31 -0300 Message-ID: References: <5BB8EC23.1040303@gmx.at> <5BB9A4E5.3070308@gmx.at> <20181008.192544.1387561894315194511.tkk@misasa.okayama-u.ac.jp> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1539040627 15244 195.159.176.226 (8 Oct 2018 23:17:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 8 Oct 2018 23:17:07 +0000 (UTC) Cc: homeros.misasa@gmail.com, charles@aurox.ch, 31240@debbugs.gnu.org To: tkk@misasa.okayama-u.ac.jp Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 09 01:17: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 1g9elp-0003oc-Q2 for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Oct 2018 01:17:02 +0200 Original-Received: from localhost ([::1]:48714 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9enw-0007Tf-B2 for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Oct 2018 19:19:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59367) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9enp-0007TO-Kg for bug-gnu-emacs@gnu.org; Mon, 08 Oct 2018 19:19:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g9enm-0002qa-DF for bug-gnu-emacs@gnu.org; Mon, 08 Oct 2018 19:19:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36677) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g9enm-0002qM-7W for bug-gnu-emacs@gnu.org; Mon, 08 Oct 2018 19:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g9enl-0001MB-VW for bug-gnu-emacs@gnu.org; Mon, 08 Oct 2018 19:19: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: Mon, 08 Oct 2018 23:19: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.15390407345195 (code B ref 31240); Mon, 08 Oct 2018 23:19:01 +0000 Original-Received: (at 31240) by debbugs.gnu.org; 8 Oct 2018 23:18:54 +0000 Original-Received: from localhost ([127.0.0.1]:40935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g9enc-0001Lh-VZ for submit@debbugs.gnu.org; Mon, 08 Oct 2018 19:18:54 -0400 Original-Received: from mail-lj1-f170.google.com ([209.85.208.170]:45421) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g9enb-0001LO-9D for 31240@debbugs.gnu.org; Mon, 08 Oct 2018 19:18:51 -0400 Original-Received: by mail-lj1-f170.google.com with SMTP id j4-v6so15586109ljc.12 for <31240@debbugs.gnu.org>; Mon, 08 Oct 2018 16:18:51 -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=DmVauZIT4hX3Kq2+vN9Lnd+kHDok/MEDbFA4XY3KydI=; b=BjA/b8EyYTbaxMm09bA3goAzg820rFrdBttQ8xctw9Q+O9Fz8XopQXTKacRzBQT9wq CgCAutUqdnWSpHKEZvqkgCMioxYgKYZa1ulK30ocXYW60tHpVz2l26SonTWctUSpiLeD rDa6ju6vPK1BuRjCOoUeotYy+rMje2mWz0dslVvP+TqAXzgCeLMp5fA434dpJudBGKfd epZBGdhHa/aiJT7/GMU4ZY/ln2QYjpZ/NYDZbUHxws+aOugLe3j08YxF/Y0mUfLawtjw 3rxykpJZl9PNUsiipgthAAL8q1PfinxwTZxTF6MueEVLy2ImV32OywAW6GHE+eoR2FWO 3u/g== 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=DmVauZIT4hX3Kq2+vN9Lnd+kHDok/MEDbFA4XY3KydI=; b=KusdqZKjQhCl4N6Wio3umzOcRmRJ3L1MnHi6O+q0szXYuDoIdw26N2huEQSbqfHFee 1/bYgeKbPAwac/izIkfxpHSE4us0X53jzmiT1POb+usiwqG5UHnbace2QvvEswWhnRZV KSL96+c1GA8HpgCN23IsOdUDeDFZvFQYvwRb9YI4PYjA264N/y2EpWhcySB/f2q+Db5o JdxiPZ9PnkPYm5A9NWefHgcEsBeMrPYk+tkmWp5slzQUi0r4ATbOc4ikkXtPkb8h8woE 2wNrM/lxT6dC2EYEPomUMtNqIb5G+sPPL3Y0SytJ2IQe19NSOG5N5QsZcLpQ41E1iLhQ kAXg== X-Gm-Message-State: ABuFfogiGsecLS5j9lnEpdwcNOtJaGMW77anQOGU14vwHAe34fm/mfnw YQHH2IPNk6gDqqdSQGuyuYQlMNyShYndT4rE0Ew= X-Google-Smtp-Source: ACcGV61zos5QMjMg0uIkDTXpNpoe0Yzye5Kez9bNusOyW/wWUXWIoVxiqfaMjZAsR77Q+jeL5P3pxg1Q3oasgeGv6jU= X-Received: by 2002:a2e:48d:: with SMTP id a13-v6mr15761629ljf.27.1539040725237; Mon, 08 Oct 2018 16:18:45 -0700 (PDT) In-Reply-To: <20181008.192544.1387561894315194511.tkk@misasa.okayama-u.ac.jp> 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:151033 Archived-At: > (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)))))))) Martin, I didn't manage to understand the condition you are testing: (and (>= start point-to-paste) (<= point-to-paste (+ start (car size)))))))) If the first condition is true, the second will also be true (if point-to-paste is smaller than start, point-to-paste will also be smaller than start plus a positive integer). > 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. > I appreciate mouse-drag-and-drop-region when I move a sentence because > the sentence never disappears from screen. Based on this criteria, > mouse-drag-and-drop-region inserts first and delete second. > Practically it is quick, thus order does not matter much. >From what I understand, these two explanations refer to the same thing: it is better to have at all times the dragged region somewhere in the buffer (even when undoing the drag operation). It would be best to keep this behaviour in future versions of mouse-drag-and-drop-region. > There are two cases for dragging a sentence, that are ones with (1) > deleting the original selection and (2) keeping it. Since to insert > is common for two cases, deletion of the original selection comes > later. If it works, order does not matter much. I also agree with this, it is tidier to leave the optional operation at the end. > 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. I'll check if I can come up with a better solution that best fits the points that have been discussed above. If I can't, I'll check how complex it would be to implement this special case at the end.