* dbus.el and use-dialog-box
@ 2016-07-12 19:09 Mario Lang
2016-07-14 12:30 ` Michael Albinus
0 siblings, 1 reply; 4+ messages in thread
From: Mario Lang @ 2016-07-12 19:09 UTC (permalink / raw)
To: emacs-devel
Hi.
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.
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?)
--
CYa,
⡍⠁⠗⠊⠕
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: dbus.el and use-dialog-box
2016-07-12 19:09 dbus.el and use-dialog-box Mario Lang
@ 2016-07-14 12:30 ` Michael Albinus
2016-07-14 13:32 ` Stefan Monnier
0 siblings, 1 reply; 4+ messages in thread
From: Michael Albinus @ 2016-07-14 12:30 UTC (permalink / raw)
To: Mario Lang; +Cc: emacs-devel
Mario Lang <mlang@delysid.org> 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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-07-14 18:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-12 19:09 dbus.el and use-dialog-box Mario Lang
2016-07-14 12:30 ` Michael Albinus
2016-07-14 13:32 ` Stefan Monnier
2016-07-14 18:18 ` Michael Albinus
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.