emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about the initials completion-style


From: Tassilo Horn
Subject: Re: Question about the initials completion-style
Date: Thu, 22 Jul 2010 17:10:00 +0200
User-agent: KMail/1.13.5 (Linux/2.6.35-rc5-git6; KDE/4.4.5; x86_64; ; )

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<TAB>' 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]