unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: emacs-devel@gnu.org
Subject: Re: Using Qunsupported__w32_dialog
Date: Wed, 04 Jun 2014 16:09:42 +0300	[thread overview]
Message-ID: <83vbsg7re1.fsf@gnu.org> (raw)
In-Reply-To: <538F0F68.6020107@yandex.ru>

> Date: Wed, 04 Jun 2014 16:22:00 +0400
> From: Dmitry Antipov <dmantipov@yandex.ru>
> CC: emacs-devel@gnu.org
> 
> could you please review this? This is similar to r117255 but for
> popup dialogs, and Qunsupported__w32_dialog really confuses me
> (especially taking into account that I can't build for MS-Windows).

The patch looks good, except for one gotcha:

> +  /* Display the popup dialog by a terminal-specific hook ... */
> +  if (FRAME_TERMINAL (f)->popup_dialog_hook)
> +    return FRAME_TERMINAL (f)->popup_dialog_hook (f, header, contents);
> +
> +  /* ... or emulate it with a menu.  */
> +  return emulate_dialog_with_menu (f, contents);

This is incorrect for MS-Windows (and is indeed related to the
Qunsupported__w32_dialog thingy).

The problem here is that Emacs on MS-Windows does support dialogs, but
only "simple" ones, those that have only Yes/No choices.  Dialogs that
require more alternatives, or alternatives other than Yes/No, are not
yet supported (the relevant code is incomplete and ifdef'ed away).
Since many dialogs used by Emacs _are_ "simple", we don't want to lose
support for these dialogs, and so the popup_dialog_hook should not be
NULL on Windows.  So instead we do provide w32_popup_dialog, but if it
encounters a dialog structure it cannot support, it returns a special
value 'unsupported--w32-dialog', which is a signal for the caller
(x-popup-dialog) to call the emulation routine instead.

Therefore, the snippet above should instead say something like this:

  /* Display the popup dialog by a terminal-specific hook ... */
  if (FRAME_TERMINAL (f)->popup_dialog_hook)
    {
      Lisp_Object val =
        FRAME_TERMINAL (f)->popup_dialog_hook (f, header, contents);

      if (!EQ (val, Qunsupported__w32_dialog))
        return val;
    }

  /* ... or emulate it with a menu.  */
  return emulate_dialog_with_menu (f, contents);

And I think this means Qunsupported__w32_dialog cannot be static.

Thanks.



  reply	other threads:[~2014-06-04 13:09 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-03 20:00 Latest EMACS on BZR trunk does not compile with MinGW Vincent Belaïche
2014-06-03 20:22 ` Paul Eggert
2014-06-03 20:56   ` Óscar Fuentes
2014-06-03 21:15   ` Eli Zaretskii
2014-06-03 21:21     ` Vincent Belaïche
2014-06-04  6:47       ` Eli Zaretskii
2014-06-04 13:17         ` Vincent Belaïche
2014-06-04 13:31           ` Eli Zaretskii
2014-06-04 15:28             ` Vincent Belaïche
2014-06-04 15:44               ` Eli Zaretskii
2014-06-04 15:54                 ` Dani Moncayo
2014-06-04 16:05                   ` Eli Zaretskii
2014-06-04 21:50                     ` Dani Moncayo
2014-06-05  0:42                       ` Stefan Monnier
2014-06-05  2:51                         ` Eli Zaretskii
2014-06-05  3:40                           ` Óscar Fuentes
2014-06-05  7:03                             ` Dani Moncayo
2014-06-05  9:03                               ` Vincent Belaïche
2014-06-05 15:09                                 ` Eli Zaretskii
2014-06-05 14:51                             ` Eli Zaretskii
2014-06-05 16:19                               ` Óscar Fuentes
2014-06-05 17:52                                 ` Eli Zaretskii
2014-06-05 13:31                           ` Stefan Monnier
2014-06-05 15:15                             ` Eli Zaretskii
2014-06-05 16:50                               ` Stefan Monnier
2014-06-05 18:07                                 ` Eli Zaretskii
2014-06-05 19:35                                   ` Paul Eggert
2014-06-05 19:54                                     ` Eli Zaretskii
2014-06-10 19:25                                     ` Dani Moncayo
2014-06-10 20:21                                       ` Eli Zaretskii
2014-06-05 20:54                                   ` Stefan Monnier
2014-06-05  2:47                       ` Eli Zaretskii
2014-06-04 12:22     ` Using Qunsupported__w32_dialog Dmitry Antipov
2014-06-04 13:09       ` Eli Zaretskii [this message]
2014-06-04 13:37         ` Dmitry Antipov
2014-06-04 13:47           ` Eli Zaretskii
2014-06-04 14:06             ` Eli Zaretskii
2014-06-03 21:14 ` Latest EMACS on BZR trunk does not compile with MinGW Eli Zaretskii

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=83vbsg7re1.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=dmantipov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    /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).