unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* RFC: defcustom display-popup-menus for display-popup-menus-p
@ 2016-12-21 19:45 Ted Zlatanov
  2016-12-21 20:28 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Ted Zlatanov @ 2016-12-21 19:45 UTC (permalink / raw)
  To: emacs-devel

Currently the function `display-popup-menus-p' doesn't have any
user-customizable behavior as far as I can tell, and it's used by
`read-multiple-choice' for instance.

This creates annoying dialogs that require a mouse to click.

I propose a new boolean defcustom `display-popup-menus' so users can
disable graphical popups.

Ted




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: RFC: defcustom display-popup-menus for display-popup-menus-p
  2016-12-21 19:45 RFC: defcustom display-popup-menus for display-popup-menus-p Ted Zlatanov
@ 2016-12-21 20:28 ` Eli Zaretskii
  2016-12-21 20:43   ` Ted Zlatanov
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2016-12-21 20:28 UTC (permalink / raw)
  To: emacs-devel

> From: Ted Zlatanov <tzz@lifelogs.com>
> Date: Wed, 21 Dec 2016 14:45:02 -0500
> 
> Currently the function `display-popup-menus-p' doesn't have any
> user-customizable behavior as far as I can tell, and it's used by
> `read-multiple-choice' for instance.
> 
> This creates annoying dialogs that require a mouse to click.
> 
> I propose a new boolean defcustom `display-popup-menus' so users can
> disable graphical popups.

display-popup-menus-p is supposed to be a capability-reporting
function, like display-graphic-p.  It shouldn't be customizable.  What
should be customizable are the Lisp programs which ask questions via
popup menus.  The function you mention, read-multiple-choice, already
allows that via the existing variable use-dialog-box.

Btw, the dialog/menu should only pop up if the command itself was
invoked via a mouse.  Since you say you don't want to click the mouse,
I wonder how come you got that popup menu in the first place.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: RFC: defcustom display-popup-menus for display-popup-menus-p
  2016-12-21 20:28 ` Eli Zaretskii
@ 2016-12-21 20:43   ` Ted Zlatanov
  2016-12-21 20:49     ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Ted Zlatanov @ 2016-12-21 20:43 UTC (permalink / raw)
  To: emacs-devel

On Wed, 21 Dec 2016 22:28:08 +0200 Eli Zaretskii <eliz@gnu.org> wrote: 

>> I propose a new boolean defcustom `display-popup-menus' so users can
>> disable graphical popups.

EZ> display-popup-menus-p is supposed to be a capability-reporting
EZ> function, like display-graphic-p.  It shouldn't be customizable.  What
EZ> should be customizable are the Lisp programs which ask questions via
EZ> popup menus.  The function you mention, read-multiple-choice, already
EZ> allows that via the existing variable use-dialog-box.

Hrm, I missed that in the code. Sorry.

I think `use-dialog-box' should be mentioned in the function docstring
for `read-multiple-choice' maybe? So other people catch it?

EZ> Btw, the dialog/menu should only pop up if the command itself was
EZ> invoked via a mouse.  Since you say you don't want to click the mouse,
EZ> I wonder how come you got that popup menu in the first place.

Gnus, when reading an article with HTML images, throws a NSM graphical
popup about trusting the image origin. But Gnus will otherwise show the
NSM text prompt. So it must be something at the HTML interaction with
EWW that breaks the dialog detection logic. For example this article did
it:

news.gmane.org gwene.com.feedburner.webupd8:2034

(My personal opinion is that using the mouse should not influence the UI
flow, so I've disabled `use-dialog-box' for myself. I think in general
graphical dialogs are a problem with Emacs. They jump out of the frame,
steal focus, carry very little useful information, and are not natively
part of the Emacs interface. I'd much rather see the Emacs frame get
blanked by an in-frame dialog box implemented with native widgets but in
an Emacs context.)

Ted




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: RFC: defcustom display-popup-menus for display-popup-menus-p
  2016-12-21 20:43   ` Ted Zlatanov
@ 2016-12-21 20:49     ` Eli Zaretskii
  2016-12-27 20:43       ` Ted Zlatanov
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2016-12-21 20:49 UTC (permalink / raw)
  To: emacs-devel; +Cc: emacs-devel

> From: Ted Zlatanov <tzz@lifelogs.com>
> Date: Wed, 21 Dec 2016 15:43:53 -0500
> 
> I think `use-dialog-box' should be mentioned in the function docstring
> for `read-multiple-choice' maybe? So other people catch it?

Be my guest, but IMO mentioning it will make no sense unless you also
tell that the function uses popup menus under some circumstances.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: RFC: defcustom display-popup-menus for display-popup-menus-p
  2016-12-21 20:49     ` Eli Zaretskii
@ 2016-12-27 20:43       ` Ted Zlatanov
  2017-01-31 19:20         ` Ted Zlatanov
  0 siblings, 1 reply; 6+ messages in thread
From: Ted Zlatanov @ 2016-12-27 20:43 UTC (permalink / raw)
  To: emacs-devel

On Wed, 21 Dec 2016 22:49:26 +0200 Eli Zaretskii <eliz@gnu.org> wrote: 

>> From: Ted Zlatanov <tzz@lifelogs.com>
>> Date: Wed, 21 Dec 2016 15:43:53 -0500
>> 
>> I think `use-dialog-box' should be mentioned in the function docstring
>> for `read-multiple-choice' maybe? So other people catch it?

EZ> Be my guest, but IMO mentioning it will make no sense unless you also
EZ> tell that the function uses popup menus under some circumstances.

Is this OK? I tried to be as clear and concise as possible since that
function's docstring is already pretty long.

Thanks
Ted

diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index fdcfa70..fb88f50 100644
--- a/lisp/emacs-lisp/subr-x.el
+++ b/lisp/emacs-lisp/subr-x.el
@@ -214,6 +214,11 @@ (defun read-multiple-choice (prompt choices)
 perform the requested window recentering or scrolling and ask
 again.
 
+When `use-dialog-box' is t (the default), this function can pop
+up a dialog window to collect the user input. That functionality
+requires `display-popup-menus-p' to return t. Otherwise, a text
+dialog will be used.
+
 The return value is the matching entry from the CHOICES list.
 
 Usage example:




^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: RFC: defcustom display-popup-menus for display-popup-menus-p
  2016-12-27 20:43       ` Ted Zlatanov
@ 2017-01-31 19:20         ` Ted Zlatanov
  0 siblings, 0 replies; 6+ messages in thread
From: Ted Zlatanov @ 2017-01-31 19:20 UTC (permalink / raw)
  To: emacs-devel

On Tue, 27 Dec 2016 15:43:31 -0500 Ted Zlatanov <tzz@lifelogs.com> wrote: 

TZ> Is this OK? I tried to be as clear and concise as possible since that
TZ> function's docstring is already pretty long.

I pushed my suggested change; thanks for your help!

Ted




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-01-31 19:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-21 19:45 RFC: defcustom display-popup-menus for display-popup-menus-p Ted Zlatanov
2016-12-21 20:28 ` Eli Zaretskii
2016-12-21 20:43   ` Ted Zlatanov
2016-12-21 20:49     ` Eli Zaretskii
2016-12-27 20:43       ` Ted Zlatanov
2017-01-31 19:20         ` Ted Zlatanov

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