From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Completions in Semantic Date: Mon, 19 Oct 2009 14:29:55 -0400 Message-ID: References: <87tyxwxq6t.fsf@stupidchicken.com> <1255924220.6961.1039.camel@projectile.siege-engine.com> <1255969613.6961.1056.camel@projectile.siege-engine.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1255977058 22415 80.91.229.12 (19 Oct 2009 18:30:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Oct 2009 18:30:58 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org To: eric@siege-engine.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 19 20:30:49 2009 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 1Mzx0H-0003u4-RR for ged-emacs-devel@m.gmane.org; Mon, 19 Oct 2009 20:30:46 +0200 Original-Received: from localhost ([127.0.0.1]:54458 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mzx0H-0000Bk-7L for ged-emacs-devel@m.gmane.org; Mon, 19 Oct 2009 14:30:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mzwze-0008M2-H5 for emacs-devel@gnu.org; Mon, 19 Oct 2009 14:30:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mzwza-0008JD-5e for emacs-devel@gnu.org; Mon, 19 Oct 2009 14:30:06 -0400 Original-Received: from [199.232.76.173] (port=42400 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MzwzZ-0008Ix-Od for emacs-devel@gnu.org; Mon, 19 Oct 2009 14:30:01 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183]:27826 helo=ironport2-out.pppoe.ca) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MzwzZ-0003QH-G2 for emacs-devel@gnu.org; Mon, 19 Oct 2009 14:30:01 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: As4EAH5N3EpLd/m0/2dsb2JhbACBUdl5hDEEiAU X-IronPort-AV: E=Sophos;i="4.44,586,1249272000"; d="scan'208";a="47824791" Original-Received: from 75-119-249-180.dsl.teksavvy.com (HELO pastel.home) ([75.119.249.180]) by ironport2-out.pppoe.ca with ESMTP; 19 Oct 2009 14:29:55 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 0F31880E7; Mon, 19 Oct 2009 14:29:55 -0400 (EDT) In-Reply-To: <1255969613.6961.1056.camel@projectile.siege-engine.com> (Eric M. Ludlam's message of "Mon, 19 Oct 2009 12:26:53 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:116251 Archived-At: >> E.g. Info-complete-menu-item builds the table dynamically, using the >> prefix to try and build a smaller table, and reusing the previously >> built table if the completion is in the same context as the last one and >> the earlier prefix is a prefix of the new one. > I agree. It just wasn't available when I wrote that stuff against Emacs > 21. (2003?) Not that it matters, but the version of minibuf.c from "Sun 1993-05-23 03:32:05 +0000" says: DEFUN ("try-completion", Ftry_completion, Stry_completion, 2, 3, 0, [...] ALIST can also be a function to do the completion itself.\n\ It receives three arguments: the values STRING, PREDICATE and nil.\n\ Whatever it returns becomes the value of `try-completion'.\n\ > * Inline completion in a buffer. (ie - keymap, recursive-edit, > minibuffer like, but in the buffer text with the intention of > inserting that text..) You mean like lisp-complete-symbol but modal? > * Option for using a CLOS object as an input to these tools. > (ie - completion classes inherit from some interface.) > as a way of managing persistent data between completion events. > Just a favorite of mine, I'm sure. The functions that you can pass to try-completion and friends are basically objcts: the 3rd argument is the method to call. So it should be trivial to write a wrapper that takes a CLOS object obeying a completion-interface and returns a lambda expression suitable for try-completion and friends. Stefan