unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: widgets with dynamic-choice
Date: Tue, 19 Jul 2016 09:24:15 -0400	[thread overview]
Message-ID: <jwveg6phjrw.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: 87a8hest12.fsf@lifelogs.com

>>> * when should the widget get updated?

[ BTW, "updated" doesn't seem like the right word.  Did you mean
  "computed"?  ]

SM> When we need to display it?
> That means potentially a long delay on display. With customization UIs
> that can be really frustrating. Can we agree on a timeout at least?

We don't have such a thing for the completion table of text-based
widgets, so I don't see why we should have that here.  IOW I think it's
the responsability of the function not to take too much time.

>>> * how are errors handled? do we empty the list or go back to the last
>>> good version?
SM> I wouldn't try to be clever here either.  Just let the signal percolate.
> So presumably a novice user will get a strange error that they don't
> know how to handle or report? It's a practical solution but maybe a bit
> unfriendly...

In case there's a bug in the function?  Yes.  Same as when there's a bug
anywhere else.  I don't understand why you think this case is different.

SM> I think we should start with a dynamic version of `choice` and see from
SM> there if it can be easily generalized or not.

> OK, so this is the simple way:
>
> (defcustom myvar nil "Whatever"
>   :type '(dynamic-choice myvar-dynamic-choice-function))
>
> Simple and easy to understand, but not extensible.

Right.

> Could we leave room for future extension? The following will be a bit
> friendlier if other types are supported.
>
> (defcustom myvar nil "Whatever"
>   :type '(choice :dynamic myvar-dynamic-choice-function))

Yes, it would be great to allow this kind of :dynamic for
various types.  But I'm not familiar enough with the code to have
a sense of how it would work out.


        Stefan




  reply	other threads:[~2016-07-19 13:24 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 [this message]
2016-07-19 14:11       ` Ted Zlatanov
2016-07-19 14:25         ` Stefan Monnier
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=jwveg6phjrw.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).