From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: widgets with dynamic-choice Date: Mon, 18 Jul 2016 14:25:13 -0400 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87a8hest12.fsf@lifelogs.com> References: <87oa5usx9a.fsf@lifelogs.com> Reply-To: emacs-devel@gnu.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1468866383 29976 80.91.229.3 (18 Jul 2016 18:26:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Jul 2016 18:26:23 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 18 20:26:08 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bPDF2-0005Pf-At for ged-emacs-devel@m.gmane.org; Mon, 18 Jul 2016 20:26:08 +0200 Original-Received: from localhost ([::1]:49679 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPDF1-0000on-O2 for ged-emacs-devel@m.gmane.org; Mon, 18 Jul 2016 14:26:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPDEQ-0000j7-DO for emacs-devel@gnu.org; Mon, 18 Jul 2016 14:25:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPDEM-0002VN-H3 for emacs-devel@gnu.org; Mon, 18 Jul 2016 14:25:29 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:50649) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPDEM-0002VJ-9s for emacs-devel@gnu.org; Mon, 18 Jul 2016 14:25:26 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bPDEH-0004pU-M6 for emacs-devel@gnu.org; Mon, 18 Jul 2016 20:25:21 +0200 Original-Received: from c-98-229-60-157.hsd1.ma.comcast.net ([98.229.60.157]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Jul 2016 20:25:21 +0200 Original-Received: from tzz by c-98-229-60-157.hsd1.ma.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Jul 2016 20:25:21 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 51 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-98-229-60-157.hsd1.ma.comcast.net X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cancel-Lock: sha1:RY4EZJZe9GY4CDFcNeWrtqJPtyY= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:205824 Archived-At: On Mon, 18 Jul 2016 13:26:44 -0400 Stefan Monnier wrote: >> * what should it look like? Just a callable symbol or a form or >> something else? SM> As you may know I abhor `eval`, so I'd rather not have a "form" there, SM> but a function instead. I didn't know that, but OK :) >> * when should the widget get updated? 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? >> * how do we deal with outliers like a dynamic 100000 element list? SM> The widget probably shouldn't try to do anything special for that. SM> The same problem already exists with `choice` after all. OK. >> * 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... >> * should this just be a way to provide 'choice and 'radio, or do we want >> a more generic facility that can handle the other composite types? 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. 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)) Ted