all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* migrating from ido to icicles
@ 2012-12-19 19:11 jeffrey.m.weiss
  2012-12-19 22:41 ` Drew Adams
       [not found] ` <mailman.15718.1355956885.855.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 14+ messages in thread
From: jeffrey.m.weiss @ 2012-12-19 19:11 UTC (permalink / raw)
  To: help-gnu-emacs

I'm trying to use icicles exclusively and not use ido anymore.

There's one sticking point left, and that's how icicles deals with filename completion.

The problem is with drilling down directory levels.  It seems to be that once completion is active, both TAB and the cycle keys do the same thing.  The only way to say "I accept the currently highlighted directory candidate, drill down to start completing the next one" is M-SPC.

This seems like way more keypresses than necessary.  When you're finding files, you're drilling directories more than matching filenames.  That has to be the case, because file-paths have many directory levels but only one filename.  

What I want is just for completion of filenames, for TAB to only activate completion, and if it's already active, do what M-SPC currently does. Leave cycling for keys bound specifically for that purpose.

Is that possible?  Doesn't seem available via config options, but maybe writing my own command and binding it to C-x C-f would work.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: migrating from ido to icicles
  2012-12-19 19:11 jeffrey.m.weiss
@ 2012-12-19 22:41 ` Drew Adams
  2012-12-20 14:51   ` Jeff Weiss
       [not found] ` <mailman.15718.1355956885.855.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 14+ messages in thread
From: Drew Adams @ 2012-12-19 22:41 UTC (permalink / raw)
  To: jeffrey.m.weiss, help-gnu-emacs

> I'm trying to use icicles exclusively and not use ido anymore.

This page might help in that regard, in general:
http://www.emacswiki.org/emacs/Icicles_-_Ido_and_IswitchB

> There's one sticking point left, and that's how icicles deals 
> with filename completion.
> 
> The problem is with drilling down directory levels.  It seems 
> to be that once completion is active, both TAB and the cycle 
> keys do the same thing.  The only way to say "I accept the 
> currently highlighted directory candidate, drill down to 
> start completing the next one" is M-SPC.

Actually, `M-TAB' does what you want here only because it does "word"
completion, which also moves the cursor to the end of the completion.  It is
that cursor movement that switches from cycling back to completing.

In Icicles, cycling fills the minibuffer with a candidate, which you can edit
etc. normally.  In this it is quite different from Ido, IswitchB, and Icomplete,
which display candidates in the minibuffer but not as input to be edited
directly.

Icicles needs to know whether the input in the minibuffer is the result of
cycling or of editing or completing.  When you have been cycling, if you do
something other than hit a cycling key (or a scrolling key etc.) then it cancels
cycling - your action is taken as "editing" the cycled candidate.

Repeating TAB (or S-TAB) cycles among the current candidates.  And if one of
those (filename) candidates is a directory name then it is handled just like the
other, non-directory candidates: (a) cycling moves on from it to the next
candidate, and (b) RET (or C-RET) visits that directory using Dired.

IOW, a directory-name candidate is treated during cycling just like a file name.

But you can complete without cycling or after cycling a bit: If your input
matches only a unique directory name then TAB (or S-TAB) completes to that name.
Then a second TAB (or S-TAB) uses that directory not as a candidate but as the
base directory in which to complete.  IOW, it shows you all the files in that
directory as candidates.

IOW, the contents of the minibuffer are interpreted differently depending on
whether they are the result of completing or editing on the one hand, or cycling
on the other hand.  Cycling does not change the `default-directory' or the
current set of candidates.  Completion and editing can change both.

So all you really need to do is to change from cycling to "editing", to get
Icicles to interpret the current minibuffer content as a new starting point for
file-name completion, i.e., in this case as the new `default-directory'.

"Editing" really means doing pretty much anything other than cycling.  Just
moving the cursor, for instance.  What users typically do to drill down through
a directory that they have reached by cycling, is to hit `C-e' or `C-f' etc.,
and then hit TAB to complete the files in that directory.  E.g.:

C-x C-f con TAB TAB ... ; cycle until you get to CONTRIB/
C-e TAB                 ; complete in directory CONTRIB/

Or as I said, you can also not bother with cycling and just use completion.
E.g.:

C-x C-f cont TAB ; assuming only one match for that input

Or include progressive completion.  E.g.:

C-x C-f c TAB M-SPC ib S-TAB ; complete prefix `c', then match `ib'

> What I want is just for completion of filenames, for TAB to 
> only activate completion, and if it's already active, do what 
> M-SPC currently does. Leave cycling for keys bound 
> specifically for that purpose.

Long ago Icicles used TAB and S-TAB only for completion, not also for cycling as
now.  If there were a demand for this it could be optional, but today it is not.

If you want that behavior, replace
`icicle-next-(prefix|apropos)-complete-cycles-p' with `nil' wherever its value
is used in `icicles-mcmd.el'.  (You still do have other keys that perform only
cycling.)

HTH.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: migrating from ido to icicles
       [not found] ` <mailman.15718.1355956885.855.help-gnu-emacs@gnu.org>
@ 2012-12-20 12:31   ` Michael Heerdegen
  2012-12-21  0:10     ` Drew Adams
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Heerdegen @ 2012-12-20 12:31 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: jeffrey.m.weiss

"Drew Adams" <drew.adams@oracle.com> writes:

> Long ago Icicles used TAB and S-TAB only for completion, not also for
> cycling as now.  If there were a demand for this it could be optional,
> but today it is not.

I agree something like the proposed behavior would be handy.  I think I
would like it, too.

> If you want that behavior, replace
> `icicle-next-(prefix|apropos)-complete-cycles-p' with `nil' wherever its
> value is used in `icicles-mcmd.el'.  (You still do have other keys that
> perform only cycling.)

If it is that easy, why don't we do this in the code and make the
behavior optional?


Regards,

Michael.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: migrating from ido to icicles
  2012-12-19 22:41 ` Drew Adams
@ 2012-12-20 14:51   ` Jeff Weiss
  2012-12-20 15:45     ` Drew Adams
  0 siblings, 1 reply; 14+ messages in thread
From: Jeff Weiss @ 2012-12-20 14:51 UTC (permalink / raw)
  To: Drew Adams, jeffrey.m.weiss, help-gnu-emacs

Drew Adams <drew.adams@oracle.com> writes:

>> I'm trying to use icicles exclusively and not use ido anymore.
>
> This page might help in that regard, in general:
> http://www.emacswiki.org/emacs/Icicles_-_Ido_and_IswitchB
>
>> There's one sticking point left, and that's how icicles deals 
>> with filename completion.
>> 
>> The problem is with drilling down directory levels.  It seems 
>> to be that once completion is active, both TAB and the cycle 
>> keys do the same thing.  The only way to say "I accept the 
>> currently highlighted directory candidate, drill down to 
>> start completing the next one" is M-SPC.
>
> Actually, `M-TAB' does what you want here only because it does "word"
> completion, which also moves the cursor to the end of the completion.  It is
> that cursor movement that switches from cycling back to completing.

"M-TAB (translated from <M-tab>) runs the command complete-symbol, which
is an interactive compiled Lisp function in `bindings.el'."

"M-SPC runs the command icicle-prefix-word-complete, which is an
interactive compiled Lisp function in `icicles-mcmd.el'."

What happens for me is, if I hit M-TAB, point does not move, but the
mode line for the completions buffer switches from showing file
attributes back to showing the completion settings.  If I then hit TAB,
it completes using the current selection instead of cycling.
Unfortunately, the minibuffer is then filled with the first candidate in
the next directory level, which I don't want.

This is different than what either M-SPC or C-e does, they both appear
to only change the default-directory and the candidates, no candidate
shows in the minibuffer.  That's what I want. 

I like the behavior of M-SPC or C-e but I prefer to use M-TAB key to get
that behavior.  Should I just rebind it?

 
> In Icicles, cycling fills the minibuffer with a candidate, which you can edit
> etc. normally.  In this it is quite different from Ido, IswitchB, and Icomplete,
> which display candidates in the minibuffer but not as input to be edited
> directly.
>
> Icicles needs to know whether the input in the minibuffer is the result of
> cycling or of editing or completing.  When you have been cycling, if you do
> something other than hit a cycling key (or a scrolling key etc.) then it cancels
> cycling - your action is taken as "editing" the cycled candidate.
>
> Repeating TAB (or S-TAB) cycles among the current candidates.  And if one of
> those (filename) candidates is a directory name then it is handled just like the
> other, non-directory candidates: (a) cycling moves on from it to the next
> candidate, and (b) RET (or C-RET) visits that directory using Dired.
>
> IOW, a directory-name candidate is treated during cycling just like a file name.
>
> But you can complete without cycling or after cycling a bit: If your input
> matches only a unique directory name then TAB (or S-TAB) completes to that name.
> Then a second TAB (or S-TAB) uses that directory not as a candidate but as the
> base directory in which to complete.  IOW, it shows you all the files in that
> directory as candidates.
>
> IOW, the contents of the minibuffer are interpreted differently depending on
> whether they are the result of completing or editing on the one hand, or cycling
> on the other hand.  Cycling does not change the `default-directory' or the
> current set of candidates.  Completion and editing can change both.
>
> So all you really need to do is to change from cycling to "editing", to get
> Icicles to interpret the current minibuffer content as a new starting point for
> file-name completion, i.e., in this case as the new `default-directory'.
>
> "Editing" really means doing pretty much anything other than cycling.  Just
> moving the cursor, for instance.  What users typically do to drill down through
> a directory that they have reached by cycling, is to hit `C-e' or `C-f' etc.,
> and then hit TAB to complete the files in that directory.  E.g.:
>
> C-x C-f con TAB TAB ... ; cycle until you get to CONTRIB/
> C-e TAB                 ; complete in directory CONTRIB/
>
> Or as I said, you can also not bother with cycling and just use completion.
> E.g.:
>
> C-x C-f cont TAB ; assuming only one match for that input
>
> Or include progressive completion.  E.g.:
>
> C-x C-f c TAB M-SPC ib S-TAB ; complete prefix `c', then match `ib'
>
>> What I want is just for completion of filenames, for TAB to 
>> only activate completion, and if it's already active, do what 
>> M-SPC currently does. Leave cycling for keys bound 
>> specifically for that purpose.
>
> Long ago Icicles used TAB and S-TAB only for completion, not also for cycling as
> now.  If there were a demand for this it could be optional, but today it is not.
>
> If you want that behavior, replace
> `icicle-next-(prefix|apropos)-complete-cycles-p' with `nil' wherever its value
> is used in `icicles-mcmd.el'.  (You still do have other keys that perform only
> cycling.)
>
> HTH.

Thanks very much for the detailed explanation.  I'll have to experiment
to see if I can get what I need without modifying the source.

-Jeff



^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: migrating from ido to icicles
  2012-12-20 14:51   ` Jeff Weiss
@ 2012-12-20 15:45     ` Drew Adams
  2012-12-20 21:11       ` Jeff Weiss
  0 siblings, 1 reply; 14+ messages in thread
From: Drew Adams @ 2012-12-20 15:45 UTC (permalink / raw)
  To: 'Jeff Weiss', jeffrey.m.weiss, help-gnu-emacs

> >> The only way to say "I accept the currently highlighted
> >> directory candidate, drill down to start completing the
> >> next one" is M-SPC.
> >
> > Actually, `M-TAB' does what you want here only because it

I meant `M-SPC', the same as what you mentioned; sorry.

> > does "word" completion, which also moves the cursor to the
> > end of the completion.  It is that cursor movement that
> > switches from cycling back to completing.
> 
> "M-TAB (translated from <M-tab>) runs the command 
> complete-symbol, which is an interactive compiled Lisp
> function in `bindings.el'."
> 
> "M-SPC runs the command icicle-prefix-word-complete, which is an
> interactive compiled Lisp function in `icicles-mcmd.el'."

Yes, I meant `M-SPC'.

> What happens for me is, if I hit M-TAB,...

It tries to complete your input as a symbol name.

> This is different than what either M-SPC or C-e does, they both appear
> to only change the default-directory and the candidates, no candidate
> shows in the minibuffer.  That's what I want.

Yep.  Sorry about the typo & confusion.

> I like the behavior of M-SPC or C-e but I prefer to use M-TAB 
> key to get that behavior.  Should I just rebind it?

Sure.  But you will likely find at some point that you want a key (some key) to
complete symbol names (e.g. Lisp symbols, when you use `M-:').  `M-TAB' is the
key for this in general in Emacs.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: migrating from ido to icicles
  2012-12-20 15:45     ` Drew Adams
@ 2012-12-20 21:11       ` Jeff Weiss
  0 siblings, 0 replies; 14+ messages in thread
From: Jeff Weiss @ 2012-12-20 21:11 UTC (permalink / raw)
  To: Drew Adams, jeffrey.m.weiss, help-gnu-emacs

Drew Adams <drew.adams@oracle.com> writes:

>> >> The only way to say "I accept the currently highlighted
>> >> directory candidate, drill down to start completing the
>> >> next one" is M-SPC.
>> >
>> > Actually, `M-TAB' does what you want here only because it
>
> I meant `M-SPC', the same as what you mentioned; sorry.
>
>> > does "word" completion, which also moves the cursor to the
>> > end of the completion.  It is that cursor movement that
>> > switches from cycling back to completing.
>> 
>> "M-TAB (translated from <M-tab>) runs the command 
>> complete-symbol, which is an interactive compiled Lisp
>> function in `bindings.el'."
>> 
>> "M-SPC runs the command icicle-prefix-word-complete, which is an
>> interactive compiled Lisp function in `icicles-mcmd.el'."
>
> Yes, I meant `M-SPC'.
>
>> What happens for me is, if I hit M-TAB,...
>
> It tries to complete your input as a symbol name.
>
>> This is different than what either M-SPC or C-e does, they both appear
>> to only change the default-directory and the candidates, no candidate
>> shows in the minibuffer.  That's what I want.
>
> Yep.  Sorry about the typo & confusion.
>
>> I like the behavior of M-SPC or C-e but I prefer to use M-TAB 
>> key to get that behavior.  Should I just rebind it?
>
> Sure.  But you will likely find at some point that you want a key (some key) to
> complete symbol names (e.g. Lisp symbols, when you use `M-:').  `M-TAB' is the
> key for this in general in Emacs.

I was able to successfully bind M-SPC to icicle-prefix-word-complete by
customizing icicle-word-completion-keys.

However the docs for icicle-word-completion-keys suggest that I can also
bind SPC if I wanted.  That actually sounds better because I can't
remember the last time I tried to complete a filename with a space in
it. But no matter what I put in that field, SPC wouldn't trigger
icicle-prefix-word-complete, it was still bound to icicle-self-insert.

Is there some magic lisp expression for this?  Or is there some other
reason the binding doesn't work?

There's one other odd behavior I've been noticing.  Even though I have
icicle-expand-input-to-common-match-flag set to 1 (only expand when
using tab or s-tab), I am finding that I do get input inserted for me as
I'm trying to type, and it ends up mixing my input with its own,
resulting in bad input in the minibuffer.

For example, if the directory I'm completing in has 3 files, 

fop fob bar

if I quickly type 'fo' what appears in the minibuffer is 'foo'.  I think
that's because it's trying to expand the common match, since all the
files that have 'f' also have 'fo'.

-Jeff



^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: migrating from ido to icicles
@ 2012-12-20 22:30 Drew Adams
  2012-12-21  3:53 ` Jeff Weiss
  2012-12-21 14:41 ` Jeff Weiss
  0 siblings, 2 replies; 14+ messages in thread
From: Drew Adams @ 2012-12-20 22:30 UTC (permalink / raw)
  To: 'Jeff Weiss', jeffrey.m.weiss, help-gnu-emacs

> >> "M-SPC runs the command icicle-prefix-word-complete, which is an
> >> interactive compiled Lisp function in `icicles-mcmd.el'."
>
> I was able to successfully bind M-SPC to 
> icicle-prefix-word-complete by
> customizing icicle-word-completion-keys.

It is already bound to M-SPC, as you indicated above.
Perhaps you meant M-TAB.

> However the docs for icicle-word-completion-keys suggest that 
> I can also bind SPC if I wanted.  That actually sounds better
> because I can't remember the last time I tried to complete a
> filename with a space in it.

I don't recommend that, but you are welcome to do it.  Icicles completion works
for all kinds of things, many of which contain space chars.

The point of binding SPC to self-insertion is to, well, make it easy to insert a
space, rather than having to use `C-q SPC'.  Likewise, for `?' and `C-j'
(newline).

> But no matter what I put in that field, SPC wouldn't trigger
> icicle-prefix-word-complete, it was still bound to icicle-self-insert.

You need to do three things:

1. What you did: add the SPC binding for `icicle-word-completion-keys'/

2. Remove the SPC binding to `icicle-self-insert' from option
`icicle-completion-key-bindings'.

3. Toggle Icicle mode twice (exit and re-enter): M-x icy-mode M-x icy-mode.  (Or
restart Emacs.)

Vanilla Emacs binds SPC to prefix word completion.  Icicles binds it, in the
default value of `icicle-completion-key-bindings', to self-insertion insertion.
Likewise, `?' and `C-j'.

As I said, Icicles is used for completing lots of things besides just commands
and file names, and it generally makes sense to have ` ', `?', and `C-j' be
self-inserting.  But you can easily customize this away.

> There's one other odd behavior I've been noticing.  Even though I have
> icicle-expand-input-to-common-match-flag

That option name should be without the `-flag'.  Long ago the option was a
Boolean and its name had the suffix `-flag'.  Since you mention a value of `1'
you clearly do not have an older version of Icicles where the option had that
former name.

> set to 1 (only expand when
> using tab or s-tab), I am finding that I do get input inserted for me
> as I'm trying to type, and it ends up mixing my input with its own,
> resulting in bad input in the minibuffer.
> 
> For example, if the directory I'm completing in has 3 files, fop fob bar
> if I quickly type 'fo' what appears in the minibuffer is 
> 'foo'.
>
> I think that's because it's trying to expand the common match, since all the
> files that have 'f' also have 'fo'.

That is not what Icicles calls expansion to the common match.  It is what
Icicles calls incremental completion.

This explains common-match expansion:
http://www.emacswiki.org/emacs/Icicles_-_Expanded-Common-Match_Completion.

This explains incremental completion:
http://www.emacswiki.org/emacs/Icicles_-_Icompletion

You can cycle/toggle either of these during completion, to see the differences.
See the doc strings of `icicle-expand-input-to-common-match' and
`icicle-incremental-completion'.

HTH.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: migrating from ido to icicles
  2012-12-20 12:31   ` Michael Heerdegen
@ 2012-12-21  0:10     ` Drew Adams
  0 siblings, 0 replies; 14+ messages in thread
From: Drew Adams @ 2012-12-21  0:10 UTC (permalink / raw)
  To: 'Michael Heerdegen', help-gnu-emacs; +Cc: jeffrey.m.weiss

> If it is that easy, why don't we do this in the code and make the
> behavior optional?

It was not quite that easy, but I've done that now - see option
`icicle-TAB/S-TAB-only-completes-flag'.  I have not yet documented it, beyond
the doc string.

If you encounter a problem, please use `M-x icicle-send-bug-report'.  Thx.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: migrating from ido to icicles
  2012-12-20 22:30 migrating from ido to icicles Drew Adams
@ 2012-12-21  3:53 ` Jeff Weiss
  2012-12-21 18:31   ` Drew Adams
  2012-12-21 14:41 ` Jeff Weiss
  1 sibling, 1 reply; 14+ messages in thread
From: Jeff Weiss @ 2012-12-21  3:53 UTC (permalink / raw)
  To: Drew Adams, jeffrey.m.weiss, help-gnu-emacs

Drew Adams <drew.adams@oracle.com> writes:

>> >> "M-SPC runs the command icicle-prefix-word-complete, which is an
>> >> interactive compiled Lisp function in `icicles-mcmd.el'."
>>
>> I was able to successfully bind M-SPC to 
>> icicle-prefix-word-complete by
>> customizing icicle-word-completion-keys.
>
> It is already bound to M-SPC, as you indicated above.
> Perhaps you meant M-TAB.

Sorry yes I meant M-TAB.

>> However the docs for icicle-word-completion-keys suggest that 
>> I can also bind SPC if I wanted.  That actually sounds better
>> because I can't remember the last time I tried to complete a
>> filename with a space in it.
>
> I don't recommend that, but you are welcome to do it.  Icicles completion works
> for all kinds of things, many of which contain space chars.
>
> The point of binding SPC to self-insertion is to, well, make it easy to insert a
> space, rather than having to use `C-q SPC'.  Likewise, for `?' and `C-j'
> (newline).

Ok, maybe it won't work out, but I definitely use actual space
characters very rarely in the minibuffer for completion.

>> But no matter what I put in that field, SPC wouldn't trigger
>> icicle-prefix-word-complete, it was still bound to icicle-self-insert.
>
> You need to do three things:
>
> 1. What you did: add the SPC binding for `icicle-word-completion-keys'/
>
> 2. Remove the SPC binding to `icicle-self-insert' from option
> `icicle-completion-key-bindings'.
>
> 3. Toggle Icicle mode twice (exit and re-enter): M-x icy-mode M-x icy-mode.  (Or
> restart Emacs.)

I'll try that, thanks.  In general do I need to cycle icy-mode off/on
when I change these bindings?  I've noticed sometimes changes don't seem
to take effect immediately, it's hard to tell which ones require restart.

> Vanilla Emacs binds SPC to prefix word completion.  Icicles binds it, in the
> default value of `icicle-completion-key-bindings', to self-insertion insertion.
> Likewise, `?' and `C-j'.
>
> As I said, Icicles is used for completing lots of things besides just commands
> and file names, and it generally makes sense to have ` ', `?', and `C-j' be
> self-inserting.  But you can easily customize this away.
>
>> There's one other odd behavior I've been noticing.  Even though I have
>> icicle-expand-input-to-common-match-flag
>
> That option name should be without the `-flag'.  Long ago the option was a
> Boolean and its name had the suffix `-flag'.  Since you mention a value of `1'
> you clearly do not have an older version of Icicles where the option had that
> former name.

Ok, I copy/pasted that from the wiki page, I guess the actual variable
doesn't have "-flag" in it.  Makes sense since it isn't a boolean value.

>> set to 1 (only expand when
>> using tab or s-tab), I am finding that I do get input inserted for me
>> as I'm trying to type, and it ends up mixing my input with its own,
>> resulting in bad input in the minibuffer.
>> 
>> For example, if the directory I'm completing in has 3 files, fop fob bar
>> if I quickly type 'fo' what appears in the minibuffer is 
>> 'foo'.
>>
>> I think that's because it's trying to expand the common match, since all the
>> files that have 'f' also have 'fo'.
>
> That is not what Icicles calls expansion to the common match.  It is what
> Icicles calls incremental completion.
>
> This explains common-match expansion:
> http://www.emacswiki.org/emacs/Icicles_-_Expanded-Common-Match_Completion.
>
> This explains incremental completion:
> http://www.emacswiki.org/emacs/Icicles_-_Icompletion
>
> You can cycle/toggle either of these during completion, to see the differences.
> See the doc strings of `icicle-expand-input-to-common-match' and
> `icicle-incremental-completion'.
>
> HTH.

Ok now I'm confused.  I've read the docs, they seem clear enough.  I
thought incremental completion means "when I type a character, the
*Completions* buffer updates immediately to reflect what I just typed"

And I thought common-match expansion meant "when all the completions
have common characters beyond what's already in the minibuffer, they're
automatically added to the minibuffer".

Which one affects what's in the minibuffer?  I could have sworn that's
the common-match expansion, which I have turned off.  And yet, somehow
what I'm typing in the minibuffer ends up with extra characters that
I didn't type, and ultimately there are 0 matches because I've got "foo"
with an o that I typed, and an o that was added automatically, but there
are no completions starting with 'foo'.

-Jeff



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: migrating from ido to icicles
  2012-12-20 22:30 migrating from ido to icicles Drew Adams
  2012-12-21  3:53 ` Jeff Weiss
@ 2012-12-21 14:41 ` Jeff Weiss
  2012-12-21 18:32   ` Drew Adams
  1 sibling, 1 reply; 14+ messages in thread
From: Jeff Weiss @ 2012-12-21 14:41 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 4331 bytes --]

Ok, so I've tried all the combinations of both the incremental completion,
and common-match. I'm still totally confused by the behavior.  I think
maybe there is a bug somewhere or I'm not understanding something
fundamental.

What I want is:  Only fill in stuff on the minibuffer (the common match)
when I press tab.  Also, update the completions buffer as I type.

I cannot get this behavior.  It appears that the "1" setting for common
match simply doesn't work.  It's supposed to only expand to the common
match when I press TAB or S-TAB, but actually it just does nothing.
 Pressing TAB or S-TAB with this setting never does any expanding of the
common match.  If I change it to "3", then it will expand but it will do it
without pressing TAB (which I don't want, I end up with mixed up
gobbledygook that way because I am still typing when it's expanding).

So now I turn off incremental completion.  Then the common match TAB key
behavior works as described when set to "1".

Is this a bug or am I missing something?

Thanks for your help.

-Jeff


On Thu, Dec 20, 2012 at 5:30 PM, Drew Adams <drew.adams@oracle.com> wrote:

> > >> "M-SPC runs the command icicle-prefix-word-complete, which is an
> > >> interactive compiled Lisp function in `icicles-mcmd.el'."
> >
> > I was able to successfully bind M-SPC to
> > icicle-prefix-word-complete by
> > customizing icicle-word-completion-keys.
>
> It is already bound to M-SPC, as you indicated above.
> Perhaps you meant M-TAB.
>
> > However the docs for icicle-word-completion-keys suggest that
> > I can also bind SPC if I wanted.  That actually sounds better
> > because I can't remember the last time I tried to complete a
> > filename with a space in it.
>
> I don't recommend that, but you are welcome to do it.  Icicles completion
> works
> for all kinds of things, many of which contain space chars.
>
> The point of binding SPC to self-insertion is to, well, make it easy to
> insert a
> space, rather than having to use `C-q SPC'.  Likewise, for `?' and `C-j'
> (newline).
>
> > But no matter what I put in that field, SPC wouldn't trigger
> > icicle-prefix-word-complete, it was still bound to icicle-self-insert.
>
> You need to do three things:
>
> 1. What you did: add the SPC binding for `icicle-word-completion-keys'/
>
> 2. Remove the SPC binding to `icicle-self-insert' from option
> `icicle-completion-key-bindings'.
>
> 3. Toggle Icicle mode twice (exit and re-enter): M-x icy-mode M-x
> icy-mode.  (Or
> restart Emacs.)
>
> Vanilla Emacs binds SPC to prefix word completion.  Icicles binds it, in
> the
> default value of `icicle-completion-key-bindings', to self-insertion
> insertion.
> Likewise, `?' and `C-j'.
>
> As I said, Icicles is used for completing lots of things besides just
> commands
> and file names, and it generally makes sense to have ` ', `?', and `C-j' be
> self-inserting.  But you can easily customize this away.
>
> > There's one other odd behavior I've been noticing.  Even though I have
> > icicle-expand-input-to-common-match-flag
>
> That option name should be without the `-flag'.  Long ago the option was a
> Boolean and its name had the suffix `-flag'.  Since you mention a value of
> `1'
> you clearly do not have an older version of Icicles where the option had
> that
> former name.
>
> > set to 1 (only expand when
> > using tab or s-tab), I am finding that I do get input inserted for me
> > as I'm trying to type, and it ends up mixing my input with its own,
> > resulting in bad input in the minibuffer.
> >
> > For example, if the directory I'm completing in has 3 files, fop fob bar
> > if I quickly type 'fo' what appears in the minibuffer is
> > 'foo'.
> >
> > I think that's because it's trying to expand the common match, since all
> the
> > files that have 'f' also have 'fo'.
>
> That is not what Icicles calls expansion to the common match.  It is what
> Icicles calls incremental completion.
>
> This explains common-match expansion:
> http://www.emacswiki.org/emacs/Icicles_-_Expanded-Common-Match_Completion.
>
> This explains incremental completion:
> http://www.emacswiki.org/emacs/Icicles_-_Icompletion
>
> You can cycle/toggle either of these during completion, to see the
> differences.
> See the doc strings of `icicle-expand-input-to-common-match' and
> `icicle-incremental-completion'.
>
> HTH.
>
>

[-- Attachment #2: Type: text/html, Size: 5694 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: migrating from ido to icicles
  2012-12-21  3:53 ` Jeff Weiss
@ 2012-12-21 18:31   ` Drew Adams
  0 siblings, 0 replies; 14+ messages in thread
From: Drew Adams @ 2012-12-21 18:31 UTC (permalink / raw)
  To: 'Jeff Weiss', jeffrey.m.weiss, help-gnu-emacs

> Sorry yes I meant M-TAB.

I started that confusion, I guess. ;-)

> >> However the docs for icicle-word-completion-keys suggest that 
> >> I can also bind SPC if I wanted.  That actually sounds better
> >> because I can't remember the last time I tried to complete a
> >> filename with a space in it.
> >
> > I don't recommend that, but you are welcome to do it.  Icicles
> > completion works for all kinds of things, many of which contain
> > space chars.
> 
> Ok, maybe it won't work out,

It will work out.  It's just that with Icicles you might well end up completing
things that contain space chars, and in that case you might prefer not to have
to use `C-q SPC'.

> but I definitely use actual space characters very rarely in the
> minibuffer for completion.

You might end up using completion for more than you have so far.

> > 3. Toggle Icicle mode twice (exit and re-enter): M-x 
> > icy-mode M-x icy-mode.  (Or restart Emacs.)
> 
> I'll try that, thanks.  In general do I need to cycle icy-mode off/on
> when I change these bindings?  I've noticed sometimes changes 
> don't seem to take effect immediately, it's hard to tell which ones 
> require restart.

Most option value changes are reflected immediately, without your needing to do
anything else.

And in many cases you can hit a key during minibuffer input to toggle or cycle
particular options.  For example, `C-M-"' cycles
`icicle-expand-input-to-common-match' and `C-#' cycles
`icicle-incremental-completion'.

In some cases, notably minibuffer key bindings, you need to exit then reenter
Icicle mode, e.g., use `M-x icy-mode' twice.  The doc strings of the options
that require you to toggle Icicle mode should mention that.

Key-binding option changes generally require you to toggle Icicle mode because
it is when the mode is turned on/off that the bindings are made/unmade.

> > That option name should be without the `-flag'.  Long ago 
> > the option was a Boolean and its name had the suffix `-flag'.
> > Since you mention a value of `1' you clearly do not have an
> > older version of Icicles where the option had that former name.
> 
> Ok, I copy/pasted that from the wiki page,

Ouch!  Thanks, I found a couple such occurrences and have fixed them.

FYI, I update the plain-text doc that is distributed with the code, and then I
diff that to update the wiki pages.  Glad you caught this.

> > This explains common-match expansion:
> > 
> > http://www.emacswiki.org/emacs/Icicles_-_Expanded-Common-Match_Completion.
> >
> > This explains incremental completion:
> > http://www.emacswiki.org/emacs/Icicles_-_Icompletion
> >
> > You can cycle/toggle either of these during completion, to 
> > see the differences.  See the doc strings of
> > `icicle-expand-input-to-common-match' and
> > `icicle-incremental-completion'.
> 
> Ok now I'm confused.  I've read the docs, they seem clear enough.  I
> thought incremental completion means "when I type a character, the
> *Completions* buffer updates immediately to reflect what I just typed"

Yes.

> And I thought common-match expansion meant "when all the completions
> have common characters beyond what's already in the minibuffer, they're
> automatically added to the minibuffer".

That's right.  And highlighted in *Completions*.

> Which one affects what's in the minibuffer?

`i-e-i-t-c-m' affects expansion of your input to the common match, if there is
one.

`i-i-c' affects whether and when *Completions* gets updated incrementally as you
type/edit.

> I could have sworn that's the common-match expansion,

It is.  You have understood the doc correctly.

> which I have turned off.  And yet, somehow what I'm typing in the
> minibuffer ends up with extra characters that I didn't type,
> and ultimately there are 0 matches because I've got "foo"
> with an o that I typed, and an o that was added 
> automatically, but there are no completions starting with 'foo'.

Sounds like a bug.  Please report it using `M-x icicle-send-bug-report'.
Try to give a recipe starting from `emacs -Q', mentioning your Emacs version.

But I just uploaded a fix for a bug which made `i-e-i-t-c-m' = 0 and 1 not work
right.  You might try that first, to see if it also fixes the problem you see.
You will need to download the latest icicles-fn.el:
http://www.emacswiki.org/emacs-en/download/icicles-fn.el

Sorry for your trouble.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: migrating from ido to icicles
  2012-12-21 14:41 ` Jeff Weiss
@ 2012-12-21 18:32   ` Drew Adams
  2012-12-21 19:06     ` Jeff Weiss
  0 siblings, 1 reply; 14+ messages in thread
From: Drew Adams @ 2012-12-21 18:32 UTC (permalink / raw)
  To: me; +Cc: help-gnu-emacs

> Ok, so I've tried all the combinations of both the incremental
> completion, and common-match. I'm still totally confused by
> the behavior.  I think maybe there is a bug somewhere or I'm
> not understanding something fundamental.

See my other reply today.  There was a bug regarding a 0 or 1 value for
`icicle-expand-input-to-common-match'.  Perhaps the fix for that will fix the
problem you see.

> What I want is:  Only fill in stuff on the minibuffer (the
> common match) when I press tab.  Also, update the completions
> buffer as I type.

Then you want:
`icicle-expand-input-to-common-match' = 1 or 2
`icicle-incremental-completion' = non-nil (e.g. t or `always')

> I cannot get this behavior.  It appears that the "1" setting
> for common match simply doesn't work.  It's supposed to only
> expand to the common match when I press TAB or S-TAB, but
> actually it just does nothing.  Pressing TAB or S-TAB with this
> setting never does any expanding of the common match.

That should be OK now, with the fix I uploaded.

> Is this a bug or am I missing something?

It was a bug.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: migrating from ido to icicles
  2012-12-21 18:32   ` Drew Adams
@ 2012-12-21 19:06     ` Jeff Weiss
  2012-12-21 19:12       ` Drew Adams
  0 siblings, 1 reply; 14+ messages in thread
From: Jeff Weiss @ 2012-12-21 19:06 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1321 bytes --]

That new file fixed it, thanks for your help!  Off I go to explore other
icicles features.

-Jeff


On Fri, Dec 21, 2012 at 1:32 PM, Drew Adams <drew.adams@oracle.com> wrote:

> > Ok, so I've tried all the combinations of both the incremental
> > completion, and common-match. I'm still totally confused by
> > the behavior.  I think maybe there is a bug somewhere or I'm
> > not understanding something fundamental.
>
> See my other reply today.  There was a bug regarding a 0 or 1 value for
> `icicle-expand-input-to-common-match'.  Perhaps the fix for that will fix
> the
> problem you see.
>
> > What I want is:  Only fill in stuff on the minibuffer (the
> > common match) when I press tab.  Also, update the completions
> > buffer as I type.
>
> Then you want:
> `icicle-expand-input-to-common-match' = 1 or 2
> `icicle-incremental-completion' = non-nil (e.g. t or `always')
>
> > I cannot get this behavior.  It appears that the "1" setting
> > for common match simply doesn't work.  It's supposed to only
> > expand to the common match when I press TAB or S-TAB, but
> > actually it just does nothing.  Pressing TAB or S-TAB with this
> > setting never does any expanding of the common match.
>
> That should be OK now, with the fix I uploaded.
>
> > Is this a bug or am I missing something?
>
> It was a bug.
>
>

[-- Attachment #2: Type: text/html, Size: 1917 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: migrating from ido to icicles
  2012-12-21 19:06     ` Jeff Weiss
@ 2012-12-21 19:12       ` Drew Adams
  0 siblings, 0 replies; 14+ messages in thread
From: Drew Adams @ 2012-12-21 19:12 UTC (permalink / raw)
  To: 'Jeff Weiss'; +Cc: help-gnu-emacs

> That new file fixed it, thanks for your help!
> Off I go to explore other icicles features. 

Good to hear.  Please report any other problems you run into,
using `M-x icicle-send-bug-report'.  Thx.




^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-12-21 19:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-20 22:30 migrating from ido to icicles Drew Adams
2012-12-21  3:53 ` Jeff Weiss
2012-12-21 18:31   ` Drew Adams
2012-12-21 14:41 ` Jeff Weiss
2012-12-21 18:32   ` Drew Adams
2012-12-21 19:06     ` Jeff Weiss
2012-12-21 19:12       ` Drew Adams
  -- strict thread matches above, loose matches on Subject: below --
2012-12-19 19:11 jeffrey.m.weiss
2012-12-19 22:41 ` Drew Adams
2012-12-20 14:51   ` Jeff Weiss
2012-12-20 15:45     ` Drew Adams
2012-12-20 21:11       ` Jeff Weiss
     [not found] ` <mailman.15718.1355956885.855.help-gnu-emacs@gnu.org>
2012-12-20 12:31   ` Michael Heerdegen
2012-12-21  0:10     ` Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.