unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Anders Lindgren <andlind@gmail.com>
To: Alan Third <alan@idiocy.org>
Cc: Paul Michael Reilly <pmr@pajato.com>,
	Jean-Christophe Helary <jean.christophe.helary@gmail.com>,
	Emacs-Devel devel <emacs-devel@gnu.org>
Subject: Re: Mac OS Sierra tab feature breaks C-x 5 2
Date: Wed, 12 Jul 2017 23:20:57 +0200	[thread overview]
Message-ID: <CABr8ebZPKTtyhPa+nPFyri7orjX5izgGjeqWkAp+UdbisTw7gw@mail.gmail.com> (raw)
In-Reply-To: <20170712182321.GA23391@breton.holly.idiocy.org>

[-- Attachment #1: Type: text/plain, Size: 2718 bytes --]

> 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.
>

It's possible to encapsulate pragmas into preprocessor macros using the
_Pragma construct. In fact, config.h contains similar stuff, c.f.
_GL_INLINE_HEADER_BEGIN and _GL_INLINE_HEADER_END.


Another possibility is to cast `win` to `id`, which I’d guess would
> look like:
>
>     [(id)win setTabbingMode: NSWindowTabbingModeDisallowed];
>

I still get the same warning, so this is not a solution.


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?
>

No, no warning is issued about that.

I believe that there are a number of #ifdef:s that could be rewritten in
this way, so we need something ergonomically. (If we could get rid of all
such ifdef:s there would not be a need for OS-version specific binaries.)


Given the options, I would say that a solution along the lines of
_GL_INLINE_HEADER_BEGIN would be best. The pros are:

* All the messy bits can be located in one place, and it can easily be
updated to match future compiler versions. (Should some compiler start to
warn about, say, `@selector(setTabbingMode)`, that too could be
incorporated in the macros.)
* There is a natural location to place documentation and to describe the
situation
* In the code that use the macros, there is a signal to the reader that
something special is going on
* It's possible to write formal tests, ensuring the macros work as intended.

Unlike _GL_INLINE_HEADER_BEGIN, we should not use a leading underscore, as
such identifiers are reserved for the compiler itself. Maybe
NS_SILENCE_MISSING_METHOD_WARNING_BEGIN and -_END? The end result would
look like:

      NS_SILENCE_MISSING_METHOD_WARNING_BEGIN
      if ([win respondsToSelector: @selector(setTabbingMode:)])
        [win setTabbingMode: NSWindowTabbingModeDisallowed];
      NS_SILENCE_MISSING_METHOD_WARNING_END

    -- Anders

[-- Attachment #2: Type: text/html, Size: 3640 bytes --]

  reply	other threads:[~2017-07-12 21:20 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-06 11:29 Mac OS Sierra tab feature breaks C-x 5 2 Paul Michael Reilly
2017-07-06 12:14 ` Jean-Christophe Helary
2017-07-06 12:46   ` Sebastian Christ
2017-07-06 12:53 ` Alan Third
2017-07-06 14:35   ` Alan Third
2017-07-06 15:05     ` Jean-Christophe Helary
2017-07-06 17:42       ` Alan Third
2017-07-06 22:16         ` Alan Third
2017-07-10 19:17           ` Anders Lindgren
2017-07-10 19:52             ` Alan Third
2017-07-10 20:22               ` Anders Lindgren
2017-07-12 18:23                 ` Alan Third
2017-07-12 21:20                   ` Anders Lindgren [this message]
2017-07-13 20:22                     ` Alan Third
2017-07-16 18:43                       ` Anders Lindgren
2017-07-16 23:01                         ` Alan Third
2017-07-17 20:09                           ` Charles A. Roelli
2017-07-18  6:06                             ` Anders Lindgren
2017-07-18 18:33                               ` Charles A. Roelli
2017-07-18 22:16                                 ` Alan Third
2017-07-19  4:57                                   ` Charles A. Roelli
2017-07-21 20:31                                     ` Anders Lindgren
2017-07-22 11:22                                       ` Alan Third
2017-07-23 12:17                                         ` NS runtime feature detection (was: Mac OS Sierra tab feature breaks C-x 5 2) Alan Third
2017-07-24 19:02                                           ` NS runtime feature detection Charles A. Roelli
2017-07-24 20:45                                             ` Alan Third
2017-07-23 22:35                                         ` Mac OS Sierra tab feature breaks C-x 5 2 Tim Cross
  -- strict thread matches above, loose matches on Subject: below --
2017-07-06 17:24 Matthew Bauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABr8ebZPKTtyhPa+nPFyri7orjX5izgGjeqWkAp+UdbisTw7gw@mail.gmail.com \
    --to=andlind@gmail.com \
    --cc=alan@idiocy.org \
    --cc=emacs-devel@gnu.org \
    --cc=jean.christophe.helary@gmail.com \
    --cc=pmr@pajato.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).