From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Nick Helm Newsgroups: gmane.emacs.bugs Subject: bug#30929: 26.0.91; Text drag and drop does not work Date: Thu, 12 Apr 2018 17:34:17 +1200 Message-ID: References: <20180325115732.GA52626@breton.holly.idiocy.org> <20180407150119.GA1190@breton.holly.idiocy.org> <20180410193824.GA15361@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1523511195 2205 195.159.176.226 (12 Apr 2018 05:33:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 12 Apr 2018 05:33:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (darwin) Cc: 30929@debbugs.gnu.org To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 12 07:33:11 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 1f6Ur8-0000Oy-4M for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Apr 2018 07:33:10 +0200 Original-Received: from localhost ([::1]:35989 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f6UtE-0001Ad-Np for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Apr 2018 01:35:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34074) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f6Ut2-000191-5t for bug-gnu-emacs@gnu.org; Thu, 12 Apr 2018 01:35:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f6Usy-0007wk-Tb for bug-gnu-emacs@gnu.org; Thu, 12 Apr 2018 01:35:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39056) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f6Usy-0007wC-GE for bug-gnu-emacs@gnu.org; Thu, 12 Apr 2018 01:35:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f6Usw-000363-FX for bug-gnu-emacs@gnu.org; Thu, 12 Apr 2018 01:35:03 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Nick Helm Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Apr 2018 05:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30929 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30929-submit@debbugs.gnu.org id=B30929.152351127111864 (code B ref 30929); Thu, 12 Apr 2018 05:35:02 +0000 Original-Received: (at 30929) by debbugs.gnu.org; 12 Apr 2018 05:34:31 +0000 Original-Received: from localhost ([127.0.0.1]:46953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f6UsR-00035I-8I for submit@debbugs.gnu.org; Thu, 12 Apr 2018 01:34:31 -0400 Original-Received: from mail-me1aus01on0091.outbound.protection.outlook.com ([104.47.116.91]:60051 helo=AUS01-ME1-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f6UsP-000354-BP for 30929@debbugs.gnu.org; Thu, 12 Apr 2018 01:34:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenpointcomms.onmicrosoft.com; s=selector1-tenpoint-co-nz; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=tSMkQRFE8piRLy7O7jYXeyBItkqtC5Y4wuLu4nR0nKQ=; b=lUe+25qsNp9BWS3OwyNrOYraHmxooyVURoEXgCgZv7U8BVrotGP6l9VAhebe/FhXU71gOxBYGhXyZIWpKL8Fl+wsxJSuxkZY/z7oOgerMB6DKkL6QBgDi8lc62q/Nvl8K5Ec3emrsE5L2IEKQ2slpYd3QkU60+EgTIUclfYGe3I= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nick@tenpoint.co.nz; Original-Received: from oberon.local (125.239.174.80) by SY2PR01MB2908.ausprd01.prod.outlook.com (2603:10c6:1:1e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.653.12; Thu, 12 Apr 2018 05:34:20 +0000 X-Originating-IP: [125.239.174.80] X-ClientProxiedBy: SY2PR01CA0040.ausprd01.prod.outlook.com (2603:10c6:1:15::28) To SY2PR01MB2908.ausprd01.prod.outlook.com (2603:10c6:1:1e::21) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(7021125)(5600026)(4534165)(7022125)(4603075)(4627221)(201702281549075)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603328)(7153060)(7193020); SRVR:SY2PR01MB2908; X-Microsoft-Exchange-Diagnostics: 1; SY2PR01MB2908; 3:1q2Nhw3sEPuGvJLEdOJrimkqd5W2AYDUpdReYNcZda8wl/STS+dP3p0qTwWaTXO053/cCH+U1IT/GDV0J6u/u6jp7fBVtyLsL4ShA1/hZKNVSdb0NoJX+jJIjuPLmTMqydPN77Jgbz3uDfptgczGHy3GypbDx+PiWwQON8vg2LCAyx484iBMIV/FEKzxmpO/b+rPfCj45CT8AtQ50h2TjKimIlQwCUXVpbElTBklG5PiWNGyp1lX8/kTfDHcWwh4; 25:9EmnbiiDY07M8msF56j0eVt8lJ01bTsaEE39nTsZJWVq7Xf2RXajZOZzuilxM/QguFkzMcn76g32grt7jEBPywh0+1nnry/aTe3nazE7DI2bPCI4qldT80pDdioGvwSAKrJ6zpptTnipdDl1gWQl2VacLvxt/qsB+s+Y/oCZRL0mG6FD4sCTW2zJ9K1Npyy3cJocE+tpliuHNDGcTYtRPYrpUQ4C7HUqJ52fY/sfpbNd2yms86pgqIFBTOw969o+GIN+jP71JEt8da002lZlUY+1zSHgoGiwq+uzC7t25CN+WhNJHPN3J+KD5aeZ7VRbfFi6v8GeMz0t093anmZxUQ==; 31:WTHw6+XFQOt3dwzbd+08KEDrZpRDDUF1sHdwiDHeC6Hj+Vqy/lBCuW1wbO2c+CDgHUYUCp9iHsn/Cxt9/g+DXgEs8X3v/EyJ0O55oICDSmgthd+xGVM1XOsQd4go052W40kG0nQHacZJZAariq1XdRvOQ+FJrgvnf3UrLHzLe7mMiRY0oi22CtgfLP0v7TMaGVXNXU2yDSAa18fe33Ea4ALJMpz+q/ecajfblSgjx X-MS-TrafficTypeDiagnostic: SY2PR01MB2908: X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(6041310)(2016111802025)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(6043046)(6072148)(201708071742011); SRVR:SY2PR01MB2908; BCL:0; PCL:0; RULEID:; SRVR:SY2PR01MB2908; X-Microsoft-Exchange-Diagnostics: 1; SY2PR01MB2908; 4:62O9A+uqoj73rzml2KkpntB+HnCs6RKQPGcqn39y5umKyTHD/rdVcdZabrNcvO4NsPoCwXjBNkdUOO/Yy/7k5/6ZAVtLtyhSjZjjjb2/3oiyWpB26p9/wk5meU9g1Purzy0ChE2S7kpoote1xdifkg5leBjZD2yBxCHo17XCp3go+JgepXV3hqhUVXqpk/8z9g8KqKjlD6gRDwFzWqLKclaBurLnDMDISDfbXkWTo72ZxAXmsdA+0Buvnyxqnk0yL67lZrYotisrwloohaGMPA== X-Forefront-PRVS: 06400060E1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(396003)(366004)(376002)(346002)(39830400003)(39380400002)(189003)(199004)(2906002)(486006)(3846002)(16526019)(86362001)(47776003)(6116002)(229853002)(76176011)(25786009)(52116002)(4326008)(8676002)(81156014)(2486003)(186003)(6916009)(476003)(23676004)(36756003)(6666003)(26005)(68736007)(52146003)(8746002)(8936002)(81166006)(6506007)(316002)(7736002)(6246003)(386003)(956004)(105586002)(478600001)(6486002)(53936002)(446003)(6512007)(106356001)(66066001)(50466002)(93886005)(2616005)(58126008)(74482002)(97736004)(305945005)(5660300001); DIR:OUT; SFP:1102; SCL:1; SRVR:SY2PR01MB2908; H:oberon.local; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: tenpoint.co.nz does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1; SY2PR01MB2908; 23:AdGWq3AniZhdIvUtTB+/89hafg6AEfR1z2zS8NU48DnChugqRgstmrW+BzGyi0cwylslk9plaTDqUrsw6hZpZlRjNMNlGmY2tkgaOXI87WrJ/N17DPLb5UpoO8/FFTIBrdTEs9I3HtNAg5qxzN9A1iqcLCm9OzXy+j5nv8M4SIB4aQ3wJmrdUuAZxlUdnGk2sUvBk7Mi8JeVn+HixXbLcWotjM3sUvnECpDkMCS1QzgevrwtabcEskncT7HyP9wcRLNF/4E5N5PGP6xKIAcgaHY/bd/1XaV5bOxDX8J2bHmpUerdKa01gwDVf2iQYWubPytpoXDVXj3C95TYRfCTtPgVngYosnzgbpawAjKjT56YfcHC/74S4LhSjEy6/07RFiRf9vkM+ay1FZQigQDKez0zwHf+csJV5QPM1P+EBW7GGWmJ4Z0gp8qP9asw+1dYRXaUZUwhcnTxSv01agSbyEx2R/0N1IpUpHitdBBP7rvIu2zGjmIVLZ6sha2/KOUTB1Vz+BoEIoM+xqfJOytJC4HMn+GYf59KxtgzF6o1iGHZM8mrMfagZlhMZW1U8Ba8QP3r1+DJD1aiBgmAHsmtV2rum/Z1g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y1heRmvIbz82Lgz29REoi990yAF+05aO9X/xdK6hD4msEqYixef6+SLRG6hKw=; 24:W9d39lG7qSQhZ0SUbJk8l+pICxN73AE0AP4b1ojIAjcF804iAgSLg5q/B9hJXuI4RN/QFcjQ8JUsfLCPT28dr2BonK5hpu3RQ12juuQQquE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SY2PR01MB2908; 7:l/qvO/i6mxP969Ke797oX6ZtXqTut36iKMDpWPk8yqTd4S9zMjtWbE/haiKWYXr3TFMam0uk6DyyXnGsr9esgv/UQXk2qV+wNxbAeyxqbjdh4VVu/Wxxx3RCF6lok8qQ+NRwXhuF8Qxpl5vjPKxVgwypUhF/FziDICoCO9rl3oC2oXZUWlHN43IdPPM2Fp+a8opUPxryKpSpVudbRpRvM2Vaii3VPzl+ROL57ezxZiDU+cKY424QDdbsKnP/utyL X-MS-Office365-Filtering-Correlation-Id: 1fce5282-8480-46e7-15f9-08d5a0370abf X-OriginatorOrg: tenpoint.co.nz X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2018 05:34:20.4546 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1fce5282-8480-46e7-15f9-08d5a0370abf X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: ed686f26-19e8-407b-91d0-7364c1c6f5cf X-MS-Exchange-Transport-CrossTenantHeadersStamped: SY2PR01MB2908 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:145118 Archived-At: On Wed, 11 Apr 2018 at 07:38:24 +1200, Alan Third wrote: > On Mon, Apr 09, 2018 at 01:51:58PM +1200, Nick Helm wrote: > This is probably a better idea, we pass the string, the type (from the > PB) and the mask to lisp, and then let ns-drag-n-drop sort it out. > Like you say, if an expert wants to do something different they can > then write their own function. > > So in C we just construct something like: > > '(file > (ns-drag-operation-copy > ns-drag-operation-link) > "filename") > > Are you wanting to give this a go? I=E2=80=99m happy to work on it if not. Ok, I see what you mean. Yep, I can have a go at it. > I=E2=80=99m not sure what the deal is with drag=E2=80=90n=E2=80=90drop fr= om Emacs on > GNU/Linux, but assuming it works under GNUstep as well as Cocoa we > could add Emacs as a drag source. I'll check. There may also be some technical hurdle, but I'd like to have a go at this too. The docs for NSDraggingSource make it sound so easy... >> I'm guessing the boat has well and truly sailed for such major tweaks >> in Emacs 26 though. Instead, would it make sense to change the >> default binding on macOS so at least basic (unmodified) text dnd >> works out of the box for the upcoming release? > What would we have to do, just change the default bindings in > ns-win.el? > > (global-set-key [drag-n-drop] 'ns-drag-n-drop) > (global-set-key [C-drag-n-drop] 'ns-drag-n-drop-other-frame) > (global-set-key [M-s-drag-n-drop] 'ns-drag-n-drop-as-text) > (global-set-key [C-M-s-drag-n-drop] 'ns-drag-n-drop-as-text-other-frame) Yes, but I was thinking of only changing this one - (global-set-key [M-drag-n-drop] 'ns-drag-n-drop-as-text) + (global-set-key [M-s-drag-n-drop] 'ns-drag-n-drop-as-text) as it's the only one unbound by default. This would be the bare minimum change to make sure all unmodified dnd operations work by default.=20 > BTW, is it just me or does =E2=80=98ns-drag-n-drop-as-text-other-frame=E2= =80=99 not > actually do anything different from =E2=80=98ns-drag-n-drop-as-text=E2=80= =99? The former pops up a new frame for me, but I have to bind it to an event first. I don't think there's an easy way to generate the default [C-M-drag-n-drop] event because of the way the modifiers are interpreted, so `ns-drag-n-drop-as-text-other-frame' is never called. > The current binding works if I drag and drop text from iterm2, but > fails if I drag from textedit. I'm guessing, but this might be expected. The sender sets the initial operation mask based on its capabilities. I don't know iTerm2 very well, but it probably doesn't support move operations (as its text is read only) so it masks out the move to force a copy. Emacs receives [drag-n-drop] and the op works because `ns-drag-n-drop' is smart enough to know what to do with text on the pb. TextEdit supports both move and copy, so it doesn't mask out the move, and Emacs receives [M-s-drag-n-drop] which is currently unbound.