From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: widgets with dynamic-choice
Date: Tue, 19 Jul 2016 10:25:26 -0400 [thread overview]
Message-ID: <jwvh9blg1eu.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: 87shv5ra35.fsf@lifelogs.com
> I think that's easy for the programmers but annoying for the users.
> Responsive UI is important everywhere in Emacs. I am happy to discuss
> the pros and cons of what I'm proposing, I'm not saying it must be done.
> Only that it should not be discarded outright.
Agreed, but if the function takes a month, what can the widget do?
Timeout and then what? A "UI" which tells me "this thing
timed out" is not a "responsive UI". A responsive UI will do something
*useful* in a timely fashion.
You could use an async interface, calling the function with a callback
so the display can be updated incrementally as new elements of the
dynamic choice are encountered. Of course, that still doesn't solve the
case where the next element takes a month to be found.
"Too long computations" are simply bugs in the function and there's
no point trying to detect them in the widget code, IMO: the user will
notice the problem on its own anyway.
> Specifically for this case, interactive dialogs should show something
> within 1-5 seconds or users will assume something is wrong
And rightly so.
> and try to interrupt or move away.
So, not very different from what you'd get by adding a timeout. Hence,
adding a timeout doesn't improve the user's experience. To improve the
user's experience, you need to fix the underlying function so it doesn't
take that long.
BTW, for all the cases I remember where I've wanted a `dynamic-choice'
widget, the computation of the list would be trivial and instantaneous.
SM> In case there's a bug in the function? Yes. Same as when there's a bug
SM> anywhere else. I don't understand why you think this case is different.
> Because currently widgets load instantly from a fixed set (with the one
> exception you mentioned), and with this proposal they can call a
> function. We're adding complexity so I wanted to at least consider the
> effect of it to users in the Customize interface.
Even loading from a fixed set, I've experienced bugs with the
customize UI. This really is no different (and it's even less
different if you consider Emacs as a whole).
> I think `widget-setup' is the right place to add the dynamic fills
> (computation), hooking that into the buffer redisplay hook. The part of
> `widget-*-value-create' that gets and inserts the list of choices from
> :args will need to be factored out so it can be called from
> that hook. WDYT?
The reason why I haven't implemented it myself is because I know next to
nothing about the widget code, so I'm afraid I won't be of much
help here.
Stefan
next prev parent reply other threads:[~2016-07-19 14:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-18 16:53 widgets with dynamic-choice Ted Zlatanov
2016-07-18 17:26 ` Stefan Monnier
2016-07-18 18:25 ` Ted Zlatanov
2016-07-19 13:24 ` Stefan Monnier
2016-07-19 14:11 ` Ted Zlatanov
2016-07-19 14:25 ` Stefan Monnier [this message]
2016-07-26 14:42 ` Ted Zlatanov
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=jwvh9blg1eu.fsf-monnier+gmane.emacs.devel@gnu.org \
--to=monnier@iro.umontreal.ca \
--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).