From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#33035: 27.0.50; Deprecated macOS functions Date: Sun, 10 Jan 2021 14:25:28 +0100 Message-ID: <1AE9CD2F-44C2-45DE-96CD-ED585E70E8DC@acm.org> References: Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_76599574-020E-460A-AC07-AA79D75C9FED" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31240"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 33035@debbugs.gnu.org, Philipp Stephani , Alan Third To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 10 14:30:56 2021 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 1kyao3-00082P-Jv for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Jan 2021 14:30:55 +0100 Original-Received: from localhost ([::1]:41896 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyao2-0004Ff-Lk for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Jan 2021 08:30:54 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57992) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyajL-0000hJ-JF for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2021 08:26:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41890) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kyajJ-0005gV-UX for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2021 08:26:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kyajJ-0000eo-Of for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2021 08:26:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Jan 2021 13:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33035 X-GNU-PR-Package: emacs Original-Received: via spool by 33035-submit@debbugs.gnu.org id=B33035.16102851402478 (code B ref 33035); Sun, 10 Jan 2021 13:26:01 +0000 Original-Received: (at 33035) by debbugs.gnu.org; 10 Jan 2021 13:25:40 +0000 Original-Received: from localhost ([127.0.0.1]:53436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyaix-0000du-QI for submit@debbugs.gnu.org; Sun, 10 Jan 2021 08:25:39 -0500 Original-Received: from mail1438c50.megamailservers.eu ([91.136.14.38]:35274 helo=mail263c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyaiv-0000dX-IX for 33035@debbugs.gnu.org; Sun, 10 Jan 2021 08:25:38 -0500 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1610285131; bh=hFbeUSfMxM1Wr7HjWqc0PQP+8SalnRlkCbSat/ycdRU=; h=From:Subject:Date:Cc:To:From; b=CurtpnPiRdaZk2JlPko7bHj7ttCP3AXOsUMLECSLzOiigIdHDXEOBJAGL6BTvPAqD KBG4GgiEnKsw1P/cK12gI7zdfA4FoL+3ZMFiRUS+XebbX1urQGnqNdnot554UVNXVj 3rn3XjhjQBV4BcdoAsSjO1i6Zp08O6Xgpw3SWvr4= Feedback-ID: mattiase@acm.or Original-Received: from stanniol.lan (c-064ae655.032-75-73746f71.bbcust.telenor.se [85.230.74.6]) (authenticated bits=0) by mail263c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 10ADPS0s023102; Sun, 10 Jan 2021 13:25:30 +0000 X-Mailer: Apple Mail (2.3445.104.17) X-CTCH-RefID: str=0001.0A742F1E.5FFB004A.0038, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=foiim2wf c=1 sm=1 tr=0 a=Ni+dBsiEfW2GqKMPYZim9A==:117 a=Ni+dBsiEfW2GqKMPYZim9A==:17 a=M51BFTxLslgA:10 a=aQrrj4VPuJl7LM9tZUoA:9 a=CjuIK1q_8ugA:10 a=V5B2J0hWSr-927ZPRrUA:9 a=De_Ol2h6w80A:10 X-Origin-Country: SE 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" Xref: news.gmane.io gmane.emacs.bugs:197602 Archived-At: --Apple-Mail=_76599574-020E-460A-AC07-AA79D75C9FED Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Not sure if this is the right way to go about it, but it does silence = the remaining warnings about NSFilenamesPboardType. Tested on Mojave. --Apple-Mail=_76599574-020E-460A-AC07-AA79D75C9FED Content-Disposition: attachment; filename=ns-pboard-warning.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="ns-pboard-warning.diff" Content-Transfer-Encoding: 7bit diff --git a/src/nsterm.m b/src/nsterm.m index 2defb9e2ee..2ca3f6f3ff 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -5602,7 +5602,7 @@ Needs to be here because ns_initialize_display_info () uses AppKit classes. ns_drag_types = [[NSArray arrayWithObjects: NSPasteboardTypeString, NSPasteboardTypeTabularText, - NSFilenamesPboardType, + NSPasteboardTypeFileURL, NSPasteboardTypeURL, nil] retain]; /* If fullscreen is in init/default-frame-alist, focus isn't set @@ -8533,23 +8533,17 @@ -(BOOL)performDragOperation: (id ) sender { return NO; } - /* FIXME: NSFilenamesPboardType is deprecated in 10.14, but the - NSURL method can only handle one file at a time. Stick with the - existing code at the moment. */ - else if ([type isEqualToString: NSFilenamesPboardType]) + else if ([type isEqualToString: NSPasteboardTypeFileURL]) { - NSArray *files; - NSEnumerator *fenum; - NSString *file; - - if (!(files = [pb propertyListForType: type])) - return NO; - type_sym = Qfile; - fenum = [files objectEnumerator]; - while ( (file = [fenum nextObject]) ) - strings = Fcons ([file lispString], strings); + NSArray *a = [pb readObjectsForClasses: @[[NSURL self]] + options: nil]; + NSEnumerator *ae = [a objectEnumerator]; + NSURL *u; + while ((u = [ae nextObject])) { + strings = Fcons ([[u path] lispString], strings); + } } else if ([type isEqualToString: NSPasteboardTypeURL]) { --Apple-Mail=_76599574-020E-460A-AC07-AA79D75C9FED--