From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel Subject: Re: Mac OS Sierra tab feature breaks C-x 5 2 Date: Wed, 12 Jul 2017 19:23:21 +0100 Message-ID: <20170712182321.GA23391@breton.holly.idiocy.org> References: <191BFCA3-3C5B-4A75-8985-A958E638ADCE@gmail.com> <20170706174204.GA19121@breton.holly.idiocy.org> <20170706221637.GA19607@breton.holly.idiocy.org> <20170710195220.GA21900@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1499883841 15139 195.159.176.226 (12 Jul 2017 18:24:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 12 Jul 2017 18:24:01 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) Cc: Paul Michael Reilly , Jean-Christophe Helary , Emacs-Devel devel To: Anders Lindgren Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 12 20:23:56 2017 Return-path: Envelope-to: ged-emacs-devel@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 1dVMIj-0003fA-BZ for ged-emacs-devel@m.gmane.org; Wed, 12 Jul 2017 20:23:53 +0200 Original-Received: from localhost ([::1]:55151 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVMIo-0007PG-Tm for ged-emacs-devel@m.gmane.org; Wed, 12 Jul 2017 14:23:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVMIh-0007Ol-Il for emacs-devel@gnu.org; Wed, 12 Jul 2017 14:23:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVMIg-00073P-JX for emacs-devel@gnu.org; Wed, 12 Jul 2017 14:23:51 -0400 Original-Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:36563) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dVMIg-0006uV-Bd for emacs-devel@gnu.org; Wed, 12 Jul 2017 14:23:50 -0400 Original-Received: by mail-wm0-x241.google.com with SMTP id y5so488173wmh.3 for ; Wed, 12 Jul 2017 11:23:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Qoz1JtB+H+GZ9dL2dTeYVkh3BJyTDfljrdXdnGfbs78=; b=t9iPpG04LBwxY0gbs/jJNeQHQ3wDj+YRIK3t7655bl2f4sG9PvErLsGb+vA8Uohp2I Z6+EJNvELlQ2mQvbMIG5qnqq7hkko1hWm0f6MQIjyXpXHT9vaxr5V2RlH3umMUM0SJgW 05Li9AwCD2qQvw9X2xsIXIGMoVSLnuI/lZIUVRCa1MnJLWBpywJBgAisuordrfi1VWAU ToPVeIYODiWYgjh66BUqKsA3kdZer8gRx0OaL8RSD0ItswcSKHlJQgjhwgAsS4YQyJ71 d51z3Oxp0a0OPqP2SWHoPXswofq01KjNurbkTbYa18x82JcD5goV1tZxTy8J6qQHJ9qv I6zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=Qoz1JtB+H+GZ9dL2dTeYVkh3BJyTDfljrdXdnGfbs78=; b=gXz9ZgqhkjSY1o7xMxaFZ4LJrvTRFgP0Gu6HAQSFx6xnhsXh5HCqiufjqrq+qxaQ+4 MIAVjrYqpom1K2W6eZXl4c5PchRV23bBXYupZz7tzQGsRJb6RrhxTgQWRiTGvOsWlGOS OwE9uff7i/gN0UqwPV+lt5vdP2Aln88279a/Hiu0DrC9HpRKR9w1H2Rww4x6qZFzttS1 MqY8nlZJ3TB8+Cgg96z9VIl/YTOffG2VKK5SsMBN5fQd2nLou0reJuymofTsqTkGVvnR fJMAXL54JDDNlIe6hdpBR9HDGviVS99IscFhhu9OpJ2qp5U+NwfmZfUesUS8AHgeKpHP TnIw== X-Gm-Message-State: AIVw112Cx5dfZs2tJkjncnf+feCaHvmIZZIUTmll54tYE9hWXALkoZdi Ys91s3gmy8Avqg== X-Received: by 10.28.47.67 with SMTP id v64mr3711062wmv.84.1499883805404; Wed, 12 Jul 2017 11:23:25 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-e9a1-3503-5c3f-d7d9.holly.idiocy.org. [2001:8b0:3f8:8129:e9a1:3503:5c3f:d7d9]) by smtp.gmail.com with ESMTPSA id p7sm3961686wmf.11.2017.07.12.11.23.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jul 2017 11:23:24 -0700 (PDT) Content-Disposition: inline In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:216555 Archived-At: On Mon, Jul 10, 2017 at 10:22:43PM +0200, Anders Lindgren wrote: > Now it compiles, but with a warning: > > ---- > nsterm.m:7078:10: warning: instance method '-setTabbingMode:' not found > (return type defaults to 'id') [-Wobjc-method-access] > [win setTabbingMode: NSWindowTabbingModeDisallowed]; > ^~~~~~~~~~~~~~ > /System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:167:12: > note: receiver is instance of class declared here > @interface NSWindow : NSResponder NSUserInterfaceValidations, NSUserInterfaceItemIdentifica... > ----- > > > I've seen other packages declare methods in NSWindows, but I don't know how > "correct" that is. For example: > > https://github.com/electron/electron/blob/master/atom/browser/native_window_mac.mm#L450 Yeah, I’m not sure about this either. It strikes me as a bit suspect, but I don’t know that the alternatives are going to be any better. We could disable the warning: #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wobjc-method-access" if ([win respondsToSelector: @selector(setTabbingMode:)]) [win setTabbingMode: NSWindowTabbingModeDisallowed]; #pragma clang diagnostic pop which is, I think, the right thing to do, but that’s quite messy looking, and I suspect we’ll have to do the same for the gcc warning. I don’t know if we’d then have to do some #ifdef stuff to separate the clang and gcc stuff. This has the potential to get REALLY messy. Another possibility is to cast `win` to `id`, which I’d guess would look like: [(id)win setTabbingMode: NSWindowTabbingModeDisallowed]; That compiles here, no idea if it gets rid of the warning. It’s short and sweet, but The Internet seems to think this is generally a bad idea. I think we’d be OK since we’re only casting it once here, and as we already know whether or not the method is available, type‐checking (which we’re bypassing) doesn’t really give us anything. By the way, while digging around I came across a lot of stuff saying `@selector(setTabbingMode)` should give a warning if `setTabbingMode` doesn’t exist. Are you seeing one? -- Alan Third