From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Per Abrahamsen Newsgroups: gmane.emacs.devel Subject: Re: Creating recursive customization types / widgets Date: Mon, 01 Dec 2003 12:36:39 +0100 Organization: The Church of Emacs Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1070297426 20344 80.91.224.253 (1 Dec 2003 16:50:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 1 Dec 2003 16:50:26 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon Dec 01 17:50:23 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AQrFf-0006xR-00 for ; Mon, 01 Dec 2003 17:50:23 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AQrFf-0001aW-00 for ; Mon, 01 Dec 2003 17:50:23 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AQrrU-0006Dx-9G for emacs-devel@quimby.gnus.org; Mon, 01 Dec 2003 12:29:28 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AQnPZ-0000T9-71 for emacs-devel@gnu.org; Mon, 01 Dec 2003 07:44:21 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AQnOx-0000PY-Dz for emacs-devel@gnu.org; Mon, 01 Dec 2003 07:44:14 -0500 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AQnJW-0008Sf-WA for emacs-devel@gnu.org; Mon, 01 Dec 2003 07:38:07 -0500 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AQmM5-0006uh-00 for ; Mon, 01 Dec 2003 12:36:41 +0100 Mail-Followup-To: emacs-devel@gnu.org X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AQmM4-0006uY-00 for ; Mon, 01 Dec 2003 12:36:40 +0100 Original-Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AQmM4-0002Cn-00 for ; Mon, 01 Dec 2003 12:36:40 +0100 Original-Lines: 29 Original-X-Complaints-To: usenet@sea.gmane.org X-Face: +kRV2]2q}lixHkE{U)mY#+6]{AH=yN~S9@IFiOa@X6?GM|8MBp/ Mail-Copies-To: nobody User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:2JlTv+GGuF5ZUhFZBTmuYHCQyrw= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:18244 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:18244 Stefan Monnier writes: > Neat. I have no idea why it's called `child' and the resulting > use of `child' in (define-widget 'foo 'child ...) does not look > particularly intuitive, but I can't think of anything better either. Because it has a single child widget, and the new widget basically behave like the child, except for allowing recursion. I called it 'recursive' and 'delayed' under development. It is a common pattern in OOP. Having an object that wraps another object, delegates message to the other object, and thus acts like a proxy. So 'wrapper', delegator' or 'proxy' could be used as well. > We should install this. Yes. It answers the most common custom/widget programming question that I couldn't previously answer :-) >> If the datastructures is recursive, you need to gave a :match argument >> as well as :type. > > Why is that ? Good question. I was afraid of infinite recursion, but as long as the widget type "eat some tokens" of the value before the recursion starts, that doesn't happen.