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, 13 Oct 2018 11:01:38 -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> <5BC1AA69.5010304@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1539439268 29722 195.159.176.226 (13 Oct 2018 14:01:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 13 Oct 2018 14:01:08 +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 16:01:03 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 1gBKTW-0007b1-WB for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Oct 2018 16:01:03 +0200 Original-Received: from localhost ([::1]:45134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBKVc-0002jI-Q6 for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Oct 2018 10:03:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBKVW-0002j7-Hc for bug-gnu-emacs@gnu.org; Sat, 13 Oct 2018 10:03:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gBKVS-00080n-Hd for bug-gnu-emacs@gnu.org; Sat, 13 Oct 2018 10:03:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44258) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gBKVS-00080j-Cx for bug-gnu-emacs@gnu.org; Sat, 13 Oct 2018 10:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gBKVS-0002Yj-5n for bug-gnu-emacs@gnu.org; Sat, 13 Oct 2018 10:03: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, 13 Oct 2018 14:03: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.15394393249759 (code B ref 31240); Sat, 13 Oct 2018 14:03:02 +0000 Original-Received: (at 31240) by debbugs.gnu.org; 13 Oct 2018 14:02:04 +0000 Original-Received: from localhost ([127.0.0.1]:48513 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBKUU-0002XJ-GF for submit@debbugs.gnu.org; Sat, 13 Oct 2018 10:02:02 -0400 Original-Received: from mail-lj1-f170.google.com ([209.85.208.170]:45479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBKUQ-0002Wi-Dv for 31240@debbugs.gnu.org; Sat, 13 Oct 2018 10:02:01 -0400 Original-Received: by mail-lj1-f170.google.com with SMTP id j4-v6so13683469ljc.12 for <31240@debbugs.gnu.org>; Sat, 13 Oct 2018 07:01:58 -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=hi+93hFcqdm0lSLwoYxSMlklGw9rlF7D0GHvszQhem8=; b=SCZKaXhl6YGpzJSiJJ6naZz5SJAyiDYHvFpZITu2OR2uTkavgLjdDYXND1pnOoZFUL +ZPTnrqkwZ9thQL7MCvRUueBePZ5A5vkbKmbu+Poi9Cc43XC5YARjjjtWnpogX/Bb9Ps I7Ej3hTAamrjgMohRuxtOnB2qJuTFF8bKBMdFX8LvB6Zhz/wVMh6gDoZGkueF60JE0x9 IcS5UEPOZuSsHljf+qluZOUM5MW57Yu+G9TpiUkxHCdRi4DYX/p9gGrl0YNgmRwbzGjh uhWzZDRqGnOnuXZAFb9fdcev7XVP/FZIsQ6qkp8NQ8hrroY2a5SVU+zFKzJbmqbN1V5k 5D2A== 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=hi+93hFcqdm0lSLwoYxSMlklGw9rlF7D0GHvszQhem8=; b=nX40KhSWfC2m7FBu880BMLuBSJK4W+qvx+A+seVNuvovVLOkLslbQvwERLHC9C28JG IGsRbuRGV1Aqv4iD4m23fY+Ejl9RD4lRHUW3pfbcZklE2NoU25Y27cCgo29gr451fm1n 16KwlLBVJ7iBQ+DjiZ+MfxSNccWIhcb+ZkRbkLM0wa+I8q1AQ671HoyWOdiaOOzvKlX0 7IM4PZ3DOlkJb7U0Iac8nSN/AUH+zijAjhavIFEcT/LXa4afEYI/J/D9bLSQ0M0ytOOr RaB0w/oeHXwEmAXxq+yO2/J66+0/3TolELUOM1+CzXKOV9QeQ7dAKP8tus7Cgkifwwha +KzA== X-Gm-Message-State: ABuFfojsTLd5EA8kQ3onObOtfQC/XUeOppRupCcLMNHynh4PNDY5Qa35 QTvojtTB53oKj6fyIPLbnq8DwkfD35wNAoq5jCI= X-Google-Smtp-Source: ACcGV62YERIVx0+uIOZXAEudnNQr7XBgaZ8fRiGQHElZgEnyQFdSa2QwNWHwx7RY3mMjJ5Q2LpX3QhTjM6mbny1PIYw= X-Received: by 2002:a2e:900c:: with SMTP id h12-v6mr7017443ljg.121.1539439312289; Sat, 13 Oct 2018 07:01:52 -0700 (PDT) In-Reply-To: <5BC1AA69.5010304@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:151223 Archived-At: > Let's keep B) in mind for the case that someone comes up with a real > use case where this would be needed. Mine was just a constructed one > that looked convincing to me to to be reported. I agree that option B) seems better. Should I implement it now. or would it be better to wait for other opinions? > The only remaining problem I have now is that we are far beyond the 80 > columns limit for code. I came up with truncating the assignment to > 'drag-but-negligible' as follows > ... > but that's ugly. If you have any ideas how to handle that better (for > example, by moving the comment up by a few lines) I'll do that. > Otherwise, I'll have to use that form above. I started re-indenting some lines to see if I could make them fit in 80 columns, but then I realized the results were exactly the same as yours. I just ended up moving the comment instead: ;; Check if "drag but negligible". Operation "drag but ;; negligible" is defined as drag-and-drop the text to ;; the original region. When modifier is pressed, the ;; text will be inserted to inside of the original ;; region. ;; If the region is rectangular, check if the newly inserted ;; rectangular text would intersect the already selected ;; region. If it would, then set "drag-but-negligible" to t. ;; As a special case, allow dragging the region freely anywhere ;; to the left, as this will never trigger its contents to be ;; inserted into the overlays tracking it. (setq drag-but-negligible (and (eq (overlay-buffer (car mouse-drag-and-drop-overlays)) buffer-to-paste) (if region-noncontiguous (let ((size (cons region-width region-height)) (start-coordinates (rectangle-position-as-coordinates start)) (point-to-paste-coordinates (rectangle-position-as-coordinates point-to-paste))) (and (rectangle-intersect-p start-coordinates size point-to-paste-coordinates size) (not (<= (car point-to-paste-coordinates) (car start-coordinates))))) (and (<= (overlay-start (car mouse-drag-and-drop-overlays)) point-to-paste) (<= point-to-paste (overlay-end (car mouse-drag-and-drop-overlays))))))))