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: A dynamic pattern-matching Date: Tue, 03 Mar 2009 14:16:28 -0500 Message-ID: References: <18860.59659.494547.384677@moose.fleuret.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1236107813 20867 80.91.229.12 (3 Mar 2009 19:16:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Mar 2009 19:16:53 +0000 (UTC) Cc: emacs-devel@gnu.org To: Francois Fleuret Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 03 20:18:09 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 1Lea7s-0001el-Ss for ged-emacs-devel@m.gmane.org; Tue, 03 Mar 2009 20:18:01 +0100 Original-Received: from localhost ([127.0.0.1]:38304 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lea6X-0000fO-Ke for ged-emacs-devel@m.gmane.org; Tue, 03 Mar 2009 14:16:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lea6S-0000fF-CV for emacs-devel@gnu.org; Tue, 03 Mar 2009 14:16:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lea6R-0000f3-2T for emacs-devel@gnu.org; Tue, 03 Mar 2009 14:16:32 -0500 Original-Received: from [199.232.76.173] (port=36317 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lea6Q-0000f0-Rm for emacs-devel@gnu.org; Tue, 03 Mar 2009 14:16:30 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:59591) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lea6Q-0007kV-JR for emacs-devel@gnu.org; Tue, 03 Mar 2009 14:16:30 -0500 Original-Received: from alfajor.home (vpn-132-204-232-170.acd.umontreal.ca [132.204.232.170]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id n23JHAm0001558; Tue, 3 Mar 2009 14:17:10 -0500 Original-Received: by alfajor.home (Postfix, from userid 20848) id B4ED9A2B95; Tue, 3 Mar 2009 14:16:28 -0500 (EST) In-Reply-To: <18860.59659.494547.384677@moose.fleuret.org> (Francois Fleuret's message of "Tue, 3 Mar 2009 09:23:39 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3223=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:109419 Archived-At: > I wrote a dynamic pattern-matching that restricts in real-time the > display of a list of items to the ones matching the typed > pattern. Since it uses a standard buffer it shows the said list over a > large visual space, which is very practical. So, IIUC, it could be described as: like icomplete-mode except that 1- the list of completions is shown in a separate buffer. 2- that the cursor is shown in that separate buffer rather than in the minibuffer. 3- that the current pattern is not shown in the minibuffer but in the header-line (or mode-line). 4- that the completion is based on "substring match" rather than "prefix match". 5- that you can specify an AND pattern. 6- the API is slightly different from completing-read. It looks interesting. It'd be good to try and integrate it better with the current completion code: - it'd be easy to write a variant of icomplete-mode that addresses point 1 by using a separate buffer (which we'd call "*Completions*"). - I don't think point 3 is important, right? - I guess point 2 is also somewhat secondary, tho it's important to have a notion of "the currently selected entry" (this is also used in ido/ibuffer and is somewhat missing in the default completion code) - point 4 can be simulated by adding a "*" at the beginning of the pattern. Or we could add a `substring' completion-style. - point 5 hopefully can be implemented as a completion-style. - point 6... not sure: it seems like the difference might be important, along with the fact that the user may like to use this style of selection for some commands but not all. WDPT? Stefan PS: FWIW, when I tried (add-hook 'minibuffer-setup-hook 'sm-minibuffer-setup-hook) (defun sm-minibuffer-setup-hook () (add-hook 'post-command-hook 'sm-completions-update nil t)) (defun sm-completions-update () (if (and minibuffer-completion-table (get-buffer-window "*Completions*" 'visible)) (minibuffer-completion-help))) it seemed too slow to be bearable, so it would require some efforts to speed things up.