From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: Re: custom type tests Date: Sun, 02 Dec 2007 05:12:48 +0900 Message-ID: <87wsryjhrz.fsf@uwakimon.sk.tsukuba.ac.jp> References: <475150C1.4060608@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196539821 13908 80.91.229.12 (1 Dec 2007 20:10:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Dec 2007 20:10:21 +0000 (UTC) Cc: Drew Adams , Emacs-Devel To: "Lennart Borgman (gmail)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 01 21:10:27 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IyYfR-0006cT-3I for ged-emacs-devel@m.gmane.org; Sat, 01 Dec 2007 21:10:25 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IyYfA-0005VR-Ry for ged-emacs-devel@m.gmane.org; Sat, 01 Dec 2007 15:10:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IyYf7-0005Uo-Bc for emacs-devel@gnu.org; Sat, 01 Dec 2007 15:10:05 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IyYf4-0005TX-Sk for emacs-devel@gnu.org; Sat, 01 Dec 2007 15:10:05 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IyYf4-0005TU-P8 for emacs-devel@gnu.org; Sat, 01 Dec 2007 15:10:02 -0500 Original-Received: from mtps02.sk.tsukuba.ac.jp ([130.158.97.224]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IyYf4-0000RE-Ag for emacs-devel@gnu.org; Sat, 01 Dec 2007 15:10:02 -0500 Original-Received: from uwakimon.sk.tsukuba.ac.jp (unknown [130.158.99.156]) by mtps02.sk.tsukuba.ac.jp (Postfix) with ESMTP id C83468003; Sun, 2 Dec 2007 05:09:58 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id 4C7ED11FA3F; Sun, 2 Dec 2007 05:12:49 +0900 (JST) In-Reply-To: <475150C1.4060608@gmail.com> X-Mailer: VM 7.17 under 21.5 (beta28) "fuki" (+CVS-20070621) XEmacs Lucid X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:84438 Archived-At: Lennart Borgman (gmail) writes: > Drew Adams wrote: > > It's really what I said before: > > > >>>> Given a custom type, how can I find all user options that > >>>> have that type (or a compatible type, such as a subtype)? > > > > By "have that type", I meant "are defined with that type", not "have values > > of that type". > > > Ah, sorry, I see. I think that would require some work, especially since > the same type may be expressed in several ways in custom. This seems to be an instance of the unification problem, which is a well-known NP-complete (ie, very expensive to compute even with an optimal algorithm) problem. It's very probable that Emacs customizations (at least in practice) satisfy restrictions that make efficient (enough) computation possible, though. Algorithms are available, eg Aho Sethi Ullman "Compilers" (aka the Dragon Book) gives some elementary ones. The main problem would be figuring out all the rules for constructing subtype implementations, since some of them would never be used by a human writing a defcustom and are sparsely documented.