From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: Question about the initials completion-style Date: Thu, 22 Jul 2010 17:10:00 +0200 Message-ID: <201007221710.00706.tassilo@member.fsf.org> References: <201007151800.48336.tassilo@member.fsf.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1279811417 16128 80.91.229.12 (22 Jul 2010 15:10:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 22 Jul 2010 15:10:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 22 17:10:12 2010 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.69) (envelope-from ) id 1ObxPY-0006am-AZ for ged-emacs-devel@m.gmane.org; Thu, 22 Jul 2010 17:10:12 +0200 Original-Received: from localhost ([127.0.0.1]:36378 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ObxPX-0003CS-Le for ged-emacs-devel@m.gmane.org; Thu, 22 Jul 2010 11:10:11 -0400 Original-Received: from [140.186.70.92] (port=50921 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ObxPS-0003CN-1d for emacs-devel@gnu.org; Thu, 22 Jul 2010 11:10:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ObxPQ-0001GN-Ni for emacs-devel@gnu.org; Thu, 22 Jul 2010 11:10:05 -0400 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:7293) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ObxPQ-0001G9-GO for emacs-devel@gnu.org; Thu, 22 Jul 2010 11:10:04 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id 5848E781D0DE; Thu, 22 Jul 2010 17:10:03 +0200 (CEST) Original-Received: from deliver.uni-koblenz.de ([127.0.0.1]) by localhost (deliver.uni-koblenz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 04048-10; Thu, 22 Jul 2010 17:10:02 +0200 (CEST) X-CHKRCPT: Envelopesender noch tassilo@member.fsf.org Original-Received: from thinkpad.localnet (tsdh.uni-koblenz.de [141.26.67.142]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTP id 50CD5781D0D6; Thu, 22 Jul 2010 17:10:02 +0200 (CEST) User-Agent: KMail/1.13.5 (Linux/2.6.35-rc5-git6; KDE/4.4.5; x86_64; ; ) In-Reply-To: X-Face: `TY6r/ws=N5uqO1E`M=Sups<}n%T[E^o_?MJj 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:127641 Archived-At: On Thursday 22 July 2010 16:38:47 Stefan Monnier wrote: > > I really like the idea of the `initials' completion style, but that > > doesn't work for me. When I do `M-x ss' I want to call > > `server-start' (or any other command with exactly 2 words separated > > by some non-word-char). I had an own mode for executing commands by > > giving only initials, but I'd like to drop that for the new > > `completion-styles' in recent emacsen. > [...] > > So it would be good, if there was a variant of partial-completion > > that didn't consider symbols with more hyphens than are actually > > there. Or is there a way to do that right now (using a recent bzr > > checkout)? > > There is no such feature, no. Feel free to code it up, Wow, that's some pretty easy, straight-forward code. ;-) It looks to me that I could copy the `completion-pcm-all-completions' function and add a FILTER for deleting the entries consisting of too many words to the call to `completion-pcm--find-all-completions'. I'll try that as soon as I find some time... > but be warned: there's more than one s-s match even in "emacs -Q" so > you'll have to type something more. So you may end up discovering > that you still have to type just as much. Maybe. A related question: Is the canonical way to use different completion styles depending on what to complete advising the relevant functions? Currently, I use that: --8<---------------cut here---------------start------------->8--- (setq completion-styles '(basic initials partial-completion) read-buffer-completion-ignore-case t) (defadvice read-buffer (around th-read-buffer-set-substring-completion activate) "Enable substring completion when reading buffers." (let ((completion-styles '(basic substring))) ad-do-it)) --8<---------------cut here---------------end--------------->8--- Works good and feels like IDO, especially in combination with icomplete. So thanks a lot for all your great work on the completion facilities. :-) Bye, Tassilo