* RE: Icicles + icomplete apropos
2014-11-20 4:58 Icicles + icomplete apropos Nikolay Kudryavtsev
@ 2014-11-20 7:56 ` Drew Adams
0 siblings, 0 replies; 2+ messages in thread
From: Drew Adams @ 2014-11-20 7:56 UTC (permalink / raw)
To: Nikolay Kudryavtsev, help-gnu-emacs
> With the release of 24.4 iswitchb got marked as obsolete. So now I
> have to think about how to replace it in my setup.
> New icomplete is fine, but I was unable to make it work with icicles
> - when icy-mode is enabled, icomplete suddenly matches only on
> predicate, not on substring.
>
> Alternatively is there a way to specify apropos as the initial
> completion method in icicles? And only for buffers. So I
> would get the same iswitchb behavior without the need to press
> S-Tab.
I'll give you a quick reply now, but you can follow up with
me off list later, if you like. I'm not sure I understand
completely what you say. I'm guessing you meant "prefix", not
"predicate", for instance.
1. As far as I know, you can, if you want, continue to use
IswitchB with Emacs 25... Deprecated does not mean
desupported. IswitchB is still available as part of the GNU
Emacs distribution, and if and when it no longer is, it will
continue to be available elsewhere (e.g. Emacs Wiki), I'm sure.
2. In Icicle mode, Icomplete matching reflects the current
Icicle completion mode. The default completion mode is
controlled by option `icicle-default-cycling-mode'. The
default value of this option is `prefix', meaning "prefix"
completion (but see below, as this term can in fact include
substring completion). TAB completion is another term for
prefix completion.
If you set or bind option `icicle-default-cycling-mode' to
`apropos' then Icicles completion defaults to apropos
completion, and so does Icomplete behavior. That means
that Icomplete with Icicles will use regexp completion
(which includes substring completion).
Option `icicle-default-cycling-mode' affects Icicles cycling
using keys `up' and `down' (you do not need to hit `TAB' or
`S-TAB' first, to cycle). For example, `M-x foo', then `down
down down...':
(defun foo ()
(interactive)
(let* ((icicle-default-cycling-mode 'apropos))
(message "You chose: %s"
(completing-read "Foo: " obarray))))
And you can of course do that for a command that does
buffer-name completion: (defun my-icicle-buffer ...
And if you want to see completions in `*Completions*'
from the outset then you can set or bind option
`icicle-show-Completions-initially-flag' to non-nil.
3. Besides having Icicles start out using apropos
completion (which corresponds to `S-TAB'), you can get
substring completion with `TAB', as an Icicles "prefix"
completion method, if the current Icicles TAB completion
method is `vanilla', and if vanilla Emacs completion uses
substring matching.
That is, what Icicles calls "prefix" completion includes,
as one of the "prefix" completion methods, `vanilla' Emacs
completion, and that can include substring completion (but
not regexp completion).
For that, vanilla option `completion-styles' needs to
include `substring', or else vanilla option
`completion-category-overrides' needs to specify
`substring' for the particular kind of object currently
being completed (which it does, by default, for buffer
names).
So another way to get Icomplete to match substrings with
Icicles is to use "prefix" (i.e., `TAB') completion, but
with `vanilla' as the current prefix completion method
(depending on the values of the vanilla options mentioned).
You can cycle the current Icicles "prefix" completion
method on the fly, using `C-(' during completion. For
vanilla Emacs completion to be used for this, cycle to
`vanilla'. You can choose what the prefix completion
methods are and what their cycling order is, by
customizing option `icicle-TAB-completion-methods'.
4. If you use Icomplete mode, you might also want to
try library `icomplete+.el'.
http://www.emacswiki.org/IcompleteMode#IcompletePlus
^ permalink raw reply [flat|nested] 2+ messages in thread