[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dbus.el and use-dialog-box

From: Michael Albinus
Subject: Re: dbus.el and use-dialog-box
Date: Thu, 14 Jul 2016 14:30:13 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Mario Lang <address@hidden> writes:

> Hi.

Hi Mario,

> It appears that `yes-or-no-p' when called from a D-Bus
> method handler honors `use-dialog-box'.  In other words, when
> `use-dialog-box' is non-nil, `yes-or-no-p' uses a dialog to ask the
> question.

Yes. I suspect this would also be the case for file notification events
(not tested) and other special events.

> The docstring of `use-dialog-box' only refers to mouse events:
> "Non-nil means mouse commands use dialog boxes to ask questions.
> This applies to `y-or-n-p' and `yes-or-no-p' questions asked by commands
> invoked by mouse clicks and mouse menu items."
> Is this expected behaviour, or should D-Bus events be excluded
> (from the check in Fyes_or_no_p?)

If you have a look on Fyes_or_no_p, there is no dedicated check for
mouse events. The check reads

  if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
      && use_dialog_box && ! NILP (last_input_event))

A similar check, using last_nonmenu_event and use_dialog_box, is applied
also in other functions, like Fmessage_or_box and
Fnext_read_file_uses_dialog_p. A cons cell in last_nonmenu_event is
regarded as mouse event, but this isn't true any longer for years. Any
special event represented as cons cell will match.

It might not be the designed behaviour, but I find it natural. Everybody
who dislikes this could configure use-dialog-box So I propose to
document this behaviour in the said three functions as well as in
use_dialog_box, replacing "mouse events" by "special events".

Best regards, Michael.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]