From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Unknown Newsgroups: gmane.emacs.bugs Subject: bug#43470: 27.1; Drag and Drop not working properly in 27.1 on OSX Date: Fri, 18 Sep 2020 14:00:16 +0200 Message-ID: References: <0EB1A591-9FE4-4128-96A0-C2A8E36BC8CE@duke.edu> <20200917174640.GB635@breton.holly.idiocy.org> <32895e7e-d608-48ad-8f03-397f2d03cd06_IMAP_ADDED_MISSING@ICHABOD> Reply-To: =?UTF-8?Q?Reply-to=3A_Daniel_Mart=C3=83=C2=ADn_=3Cmardani29=40yahoo=2Ees?= =?UTF-8?Q?=3E=0A?= Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31555"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (darwin) Cc: "Paul Magwene, Ph.D." , 43470@debbugs.gnu.org To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 18 14:01:25 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kJF4u-000860-Sg for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Sep 2020 14:01:24 +0200 Original-Received: from localhost ([::1]:49838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJF4t-0004fh-RQ for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Sep 2020 08:01:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJF4b-0004ew-En for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2020 08:01:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57814) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kJF4Y-00081M-IH for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2020 08:01:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kJF4Y-00070r-Gn for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2020 08:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Sep 2020 12:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43470 X-GNU-PR-Package: emacs Original-Received: via spool by 43470-submit@debbugs.gnu.org id=B43470.160043043226906 (code B ref 43470); Fri, 18 Sep 2020 12:01:02 +0000 Original-Received: (at 43470) by debbugs.gnu.org; 18 Sep 2020 12:00:32 +0000 Original-Received: from localhost ([127.0.0.1]:41127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJF44-0006zu-2B for submit@debbugs.gnu.org; Fri, 18 Sep 2020 08:00:32 -0400 Original-Received: from sonic313-20.consmr.mail.ir2.yahoo.com ([77.238.179.187]:37741) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJF41-0006ze-HH for 43470@debbugs.gnu.org; Fri, 18 Sep 2020 08:00:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1600430422; bh=X9VUk/kvqAK6NrRWsJ4kerqzLEfAOUtTKE6WJmHul1Y=; h=From:To:Cc:Subject:References:Date:In-Re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jIzk.dtLaoF9Bvj.OiU6LT8lalzli9c8pueq0 1E8IIwWAJvUPx1_Umms5hszGb63Gc6UxT2KW6vCnsOEjrXY9zBeCsINirFvDTth5jxPbZafOG1Rk U5ngcg9OYk1620vwfVEcs5Chc87SR4XrWzkIH.dpL6 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.ir2.yahoo.com with HTTP; Fri, 18 Sep 2020 12:00:22 +0000 Original-Received: by smtp401.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 01cd9b9724bc67aeec54e4895fab3101; Fri, 18 Sep 2020 12:00:18 +0000 (UTC) In-Reply-To: <32895e7e-d608-48ad-8f03-397f2d03cd06_IMAP_ADDED_MISSING@ICHABOD> (Alan Third's message of "Thu, 17 Sep 2020 20:46:37 +0100") X-Mailer: WebService/1.1.16583 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Apache-HttpAsyncClient/4.1.4 (Java/11.0.7) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Original-From: Xref: news.gmane.io gmane.emacs.bugs:188294 Archived-At: --=-=-= Content-Type: text/plain Alan Third writes: > IIRC (and I could definitely be wrong here) a simple find/replace > breaks the ability to handle more than one file being dragged at a > time, which is why I left it (it used to work fine even though it was > flagged as deprecated). You're right. I also misread the FIXME, which mentions this particular problem. That part of the patch is not correct. I think we need to use the same constant names as those that are included in the ns_drag_types array, at least until we implement proper support for the new pasteboard API. This means that three constant names should be renamed in nsterm.m. I've attached a new patch that implements this idea. I've tested the following drag and drop operations work correctly after the patch is applied: - Drag a URL. - Drag arbitrary text from another application. - Drag tabular text from another application. - Drag a couple of files from the OS file manager. It correctly creates a couple of buffers in Emacs that visit those files. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Use-modern-constant-names-for-the-NS-pasteboard.patch >From 8d50e8c08600306a6355014d90eb21b1b15af59e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= Date: Fri, 18 Sep 2020 13:36:47 +0200 Subject: [PATCH] Use modern constant names for the NS pasteboard Use the same pasteboard constant names defined in ns_drag_types. (Bug#43470). * src/nsterm.m: Rename NSURLPboardType to NSPasteboardTypeURL, NSStringPboardType to NSPasteboardTypeString, and NSTabularTextPboardType to NSPasteboardTypeTabularText --- src/nsterm.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nsterm.m b/src/nsterm.m index 26059ab67c..bab7a0abb9 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -8610,7 +8610,7 @@ -(BOOL)performDragOperation: (id ) sender while ( (file = [fenum nextObject]) ) strings = Fcons ([file lispString], strings); } - else if ([type isEqualToString: NSURLPboardType]) + else if ([type isEqualToString: NSPasteboardTypeURL]) { NSURL *url = [NSURL URLFromPasteboard: pb]; if (url == nil) return NO; @@ -8619,8 +8619,8 @@ -(BOOL)performDragOperation: (id ) sender strings = list1 ([[url absoluteString] lispString]); } - else if ([type isEqualToString: NSStringPboardType] - || [type isEqualToString: NSTabularTextPboardType]) + else if ([type isEqualToString: NSPasteboardTypeString] + || [type isEqualToString: NSPasteboardTypeTabularText]) { NSString *data; -- 2.28.0 --=-=-=--