unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Info-mode and ido
@ 2008-03-25 11:32 William Xu
  2008-03-29 22:02 ` Drew Adams
  0 siblings, 1 reply; 13+ messages in thread
From: William Xu @ 2008-03-25 11:32 UTC (permalink / raw)
  To: help-gnu-emacs

Hi, 

I'm trying to make use of ido style completion in Info-mode.
Specifically, when `m'(namely, M-x Info-menu) in info buffer, I'd like
it to do completion in ido's style.  

The relevant codes seems in info.el: 

,----[ Info-menu ]
| (completing-read (if default
|                      (format "Menu item (default %s): "
|                              default)
|                    "Menu item: ")
|                  'Info-complete-menu-item nil t)
`----

I'm thinking that I need to replace completing-read with
ido-completing-read.  I have read docstring of completing-read, but
still can't figure it out how does it work when `collection' is
function, in here, 'Info-complete-menu-buffer.

Any hints? 

-- 
William

http://williamxu.net9.org





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

* RE: Info-mode and ido
  2008-03-25 11:32 Info-mode and ido William Xu
@ 2008-03-29 22:02 ` Drew Adams
  2008-03-30  7:49   ` William Xu
  0 siblings, 1 reply; 13+ messages in thread
From: Drew Adams @ 2008-03-29 22:02 UTC (permalink / raw)
  To: 'William Xu', help-gnu-emacs

> I'm trying to make use of ido style completion in Info-mode.
> Specifically, when `m' (namely, M-x Info-menu) in info buffer, I'd like
> it to do completion in ido's style.  

I can't answer your ido question, but you might want to try `icicle-Info-menu'
(bound to `m' in Icicle mode) as an alternative. It is a multi-command, which
means you can use a single command invocation to navigate among the nodes for
any number of Info menu items. Cycling, completion (including substring/regexp)
and direct access are available.

`m', `g', and `i' act similarly - each is a browser: menu items, manual nodes,
index entries. Your current minibuffer input filters the set of available
candidates (menu, node, or index) incrementally. You can also sort these
candidates in various ways - for `g' that includes the book's node order as one
possibility.

http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Info_Enhancements






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

* Re: Info-mode and ido
  2008-03-29 22:02 ` Drew Adams
@ 2008-03-30  7:49   ` William Xu
  2008-03-30  9:12     ` Peter Dyballa
  2008-03-30 16:42     ` Drew Adams
  0 siblings, 2 replies; 13+ messages in thread
From: William Xu @ 2008-03-30  7:49 UTC (permalink / raw)
  To: help-gnu-emacs

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

> I can't answer your ido question, but you might want to try `icicle-Info-menu'
> (bound to `m' in Icicle mode) as an alternative.

Thanks.  I give it a try again.  Download and install via:

  http://www.emacswiki.org/cgi-bin/wiki/get-icicles.sh  

In info-mode, when I did a `m Emacs RET', i got this in minibuffer: 

,----
| No such node or anchor: Emacs
`----

I also tried with "m ERC RET" and some others, all failed.  

,----[ C-h v emacs-version RET ]
| emacs-version is a variable defined in `version.el'.
| Its value is "22.2.50.1"
| 
| 
| Documentation:
| Version numbers of this version of Emacs.
`----

-- 
William

http://williamxu.net9.org

        水调歌头
   丙辰中秋,欢饮达旦,大醉,作此篇兼怀子由。
                苏轼
明月几时有?把酒问青天。
不知天上宫阙,今夕是何年。
我欲乘风归去,又恐琼楼玉宇,高处不胜寒。
起舞弄清影,何似在人间!

转朱阁,低绮户,照无眠。
不应有限,何事长向别时圆?
人有悲欢离合,月有阴晴圆缺,此事古难全。
但愿人长久,千里共婵娟。





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

* Re: Info-mode and ido
  2008-03-30  7:49   ` William Xu
@ 2008-03-30  9:12     ` Peter Dyballa
  2008-03-30  9:18       ` William Xu
  2008-03-30 16:42     ` Drew Adams
  1 sibling, 1 reply; 13+ messages in thread
From: Peter Dyballa @ 2008-03-30  9:12 UTC (permalink / raw)
  To: William Xu; +Cc: help-gnu-emacs


Am 30.03.2008 um 09:49 schrieb William Xu:
> In info-mode, when I did a `m Emacs RET', i got this in minibuffer:
>
> ,----
> | No such node or anchor: Emacs
> `----


Obviously your INFOPATH setting is wrong and the variable Info- 
directory-list not correct ...

--
Greetings

   Pete

If you're not confused, you're not paying attention.






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

* Re: Info-mode and ido
  2008-03-30  9:12     ` Peter Dyballa
@ 2008-03-30  9:18       ` William Xu
  2008-03-30 16:42         ` Drew Adams
  0 siblings, 1 reply; 13+ messages in thread
From: William Xu @ 2008-03-30  9:18 UTC (permalink / raw)
  To: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Obviously your INFOPATH setting is wrong and the variable Info- 
> directory-list not correct ...

How come? When i turned off icicle, the original Info-menu command just
works fine.  

-- 
William

http://williamxu.net9.org





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

* RE: Info-mode and ido
  2008-03-30  7:49   ` William Xu
  2008-03-30  9:12     ` Peter Dyballa
@ 2008-03-30 16:42     ` Drew Adams
  2008-03-31  0:20       ` William Xu
  1 sibling, 1 reply; 13+ messages in thread
From: Drew Adams @ 2008-03-30 16:42 UTC (permalink / raw)
  To: 'William Xu', help-gnu-emacs

> > I can't answer your ido question, but you might want to try 
> > `icicle-Info-menu' (bound to `m' in Icicle mode) as an
> > alternative.
> 
> Thanks.  I give it a try again.  Download and install via:
> 
>   http://www.emacswiki.org/cgi-bin/wiki/get-icicles.sh  
> 
> In info-mode, when I did a `m Emacs RET', i got this in minibuffer: 
> No such node or anchor: Emacs

Good catch. Please try the latest icicles-cmd.el:
http://www.emacswiki.org/cgi-bin/wiki/icicles-cmd.el

FYI - It worked fine within each manual, but not at the Top (dir) level, where
the menu items are manuals, not nodes.

It should work OK now everywhere, including Top. Thx.





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

* RE: Info-mode and ido
  2008-03-30  9:18       ` William Xu
@ 2008-03-30 16:42         ` Drew Adams
  0 siblings, 0 replies; 13+ messages in thread
From: Drew Adams @ 2008-03-30 16:42 UTC (permalink / raw)
  To: 'William Xu', help-gnu-emacs

> > Obviously your INFOPATH setting is wrong and the variable Info- 
> > directory-list not correct ...
> 
> How come? When i turned off icicle, the original Info-menu 
> command just
> works fine.  

No, the problem was the definition of `icicle-Info-menu'. It expected menu items
that are nodes, and the items at the Top level are manuals, not nodes. Should be
fixed now. Thx.





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

* Re: Info-mode and ido
  2008-03-30 16:42     ` Drew Adams
@ 2008-03-31  0:20       ` William Xu
  2008-03-31  1:29         ` Drew Adams
  0 siblings, 1 reply; 13+ messages in thread
From: William Xu @ 2008-03-31  0:20 UTC (permalink / raw)
  To: help-gnu-emacs

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

> Good catch. Please try the latest icicles-cmd.el:
> http://www.emacswiki.org/cgi-bin/wiki/icicles-cmd.el

Works now.  

Well, in Info-mode, it looks like basically the same as original
Info-menu command.  For example, I usually would type `m ema TAB RET' to
enter emacs info, this seems same in icicles.  If it were ido style, i
only need to type `m ema RET' at most, and if it had some good guess, I
can type even less.  I especially love ido's "reduce matchings while
typing" feature.

-- 
William

http://williamxu.net9.org





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

* RE: Info-mode and ido
  2008-03-31  0:20       ` William Xu
@ 2008-03-31  1:29         ` Drew Adams
  2008-03-31  2:40           ` William Xu
  0 siblings, 1 reply; 13+ messages in thread
From: Drew Adams @ 2008-03-31  1:29 UTC (permalink / raw)
  To: 'William Xu', help-gnu-emacs

> Works now. Well, in Info-mode, it looks like basically
> the same as original Info-menu command.

No, it's not. It's a multi-command. You can cycle among any number of Info
nodes, menu-item destinations, or index-entry destinations in the same
invocation of `g', `m', or `i'. Use `C-down' or (for substring/regexp matching)
`C-next' to cycle.

That's why I said it's an Info browser. (Icicles is also an Imenu browser, an
apropos browser, a tags browser, a key-sequence browser, a doc-string browser,
an options browser, a property-list browser, a search browser, an alist
browser,...)

The set of candidates you can cycle among is always filtered by whatever input
you have typed in the minibuffer, and you can change that input at any time to
get a different set of candidates. That is, the set of completions is updated
incrementally. If you type `em', then only menu items (or nodes or index
entries) matching `em' are candidates.

You don't have to visit nodes when you cycle among their names as completion
candidates. That is, you need not visit all of those that match your input, in
order. This is different from vanilla Emacs cycling, when that is available, as
in M-. M-, M-, M-,... or C-s M-p M-p M-p.... Icicles cycling is not blind - you
can see all of the candidates at once, and you can skip among them to access
only the ones you want.

`down' and `next' cycle among matching candidates without acting on them. Then
`C-RET' acts on the current candidate. And `C-mouse-2' acts on any candidate you
click. You can act on any number of candidates, in any order. RET or `mouse-2'
makes a final choice, acts on it, and exits the command.

http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Multi-Commands

Not only does your current input filter the candidates, but you can use multiple
input patterns to filter them. It is easier to combine several simple patterns
than to come up with a complex regexp to do the same job. This is progressive
completion:

http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Progressive_Completion

You can at the same time match negatively, to remove candidates that match an
input pattern. This is chipping away the non-elephant:

http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Nutshell_View#toc10

It is thus easy to tailor a set of completion candidates for a particular set of
Info nodes that you are interested in. You can save that set for future use, if
you want. 

That gives you a virtual book, chosen from particular nodes of interest to you.
To use such a saved completions set again some other day, just hit a key to
retrieve it as the current set, and start visiting whichever nodes you want. You
can have as many virtual books (Info themes or threads) as you like.

You can do the same thing for any other set of completions - a set of project
files, for instance: save it and reuse it later. 

> For example, I usually would type `m ema TAB RET' to
> enter emacs info, this seems same in icicles.

That's because Icicles has vanilla Emacs completion as a proper subset. If you
don't take advantage of any Icicle features, then you get vanilla Emacs.

But you can type a regexp (such as a substring) instead. And all matches are
then candidates that you can visit, without leaving `m'. There are many
additional advantages to Icicles completion.

> If it were ido style, i only need to type `m ema RET' at most,
> and if it had some good guess, I can type even less.

In ido, you choose without confirming. You can do that in Icicles too, if you
prefer, but it is not the default behavior.
See http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_S-RET.

You are trying to use Icicles as ido, expecting "ido style", without finding out
what Icicles is. For a little comparison, see:
http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Alternative_Libraries

> I especially love ido's "reduce matchings while typing" feature.

Icicles does the same thing: it incrementally updates the completion matches
(candidates) while you type. It can use ordinary prefix matching, regexp
matching, fuzzy matching, or scatter matching (same as ido's "flex" matching).
In all cases, the set of candidates is updated incrementally, while you edit
your input. This always happens (unless you toggle it off).

But you don't see the candidates in the minibuffer, as you do in ido. Icicles is
designed to work well even with very large candidate sets - the minibuffer is
too small for that. Candidates are available in *Completions*, if you want to
see them. By default, *Completions* is shown only on demand (hit TAB or S-TAB),
but you can optionally have it appear as soon as Emacs starts reading your
input.

You might like Icicles or you might not, but don't expect it to be the same as
either vanilla Emacs or ido.






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

* Re: Info-mode and ido
  2008-03-31  1:29         ` Drew Adams
@ 2008-03-31  2:40           ` William Xu
  2008-03-31  3:34             ` Drew Adams
  0 siblings, 1 reply; 13+ messages in thread
From: William Xu @ 2008-03-31  2:40 UTC (permalink / raw)
  To: help-gnu-emacs

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

>> I especially love ido's "reduce matchings while typing" feature.
>
> Icicles does the same thing: it incrementally updates the completion matches
> (candidates) while you type. It can use ordinary prefix matching, regexp
> matching, fuzzy matching, or scatter matching (same as ido's "flex" matching).
> In all cases, the set of candidates is updated incrementally, while you edit
> your input. This always happens (unless you toggle it off).

Ah, i realize it, it's nice.  All the magic happens when the
*Completions* buffer is opened.  

> But you don't see the candidates in the minibuffer, as you do in ido. Icicles is
> designed to work well even with very large candidate sets - the minibuffer is
> too small for that. 

Ido also works well with large candidates, for example, opening some
file under /usr/share: `C-x C-f /usr/share'.  I usually don't
look-first-then-type, instead, just keep typing until I get what I
want(since I know what I'm going to open), so the minibuffer isn't an
issue for me.  

> Candidates are available in *Completions*, if you want to
> see them. By default, *Completions* is shown only on demand (hit TAB or S-TAB),
> but you can optionally have it appear as soon as Emacs starts reading your
> input.

So this is the major UI difference between Icicles and Ido.  One of the
drawbacks of open a separate *Completions* buffer is kind of
distraction, with window creation and destruction.

> You might like Icicles or you might not, but don't expect it to be the same as
> either vanilla Emacs or ido.

I think I'm hopelessly addicted to ido at present.  

-- 
William

http://williamxu.net9.org





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

* RE: Info-mode and ido
  2008-03-31  2:40           ` William Xu
@ 2008-03-31  3:34             ` Drew Adams
  2008-03-31  4:05               ` William Xu
  0 siblings, 1 reply; 13+ messages in thread
From: Drew Adams @ 2008-03-31  3:34 UTC (permalink / raw)
  To: 'William Xu', help-gnu-emacs

> > Candidates are available in *Completions*, if you want to
> > see them. By default, *Completions* is shown only on demand 
> > (hit TAB or S-TAB), but you can optionally have it appear
> > as soon as Emacs starts reading your input.
> 
> So this is the major UI difference between Icicles and Ido. 

No, it's not the major UI difference. I described some of the major differences.

And display of *Completions* is not even a difference, since you can have
Icicles open *Completions* immediately, on demand, or not at all. 

A difference is that Ido shows candidates in the minibuffer and Icicles does
not, but that is not a major UI difference. (And you can use Icicles with
icomplete[+].el.)
 
> One of the drawbacks of open a separate *Completions* buffer is kind of
> distraction, with window creation and destruction.

So don't open it. You never need to show *Completions*. You say that you don't
look at the candidates list in Ido's minibuffer anyway, so you apparently don't
need to see any candidates.

If you start working with sets of candidates (which you can do in Icicles but
not in Ido), then you might want to see them sometimes, at least while defining
a set. But if you are just after a single candidate, then you don't need to show
them at all.

> > You might like Icicles or you might not, but don't expect 
> > it to be the same as either vanilla Emacs or ido.
> 
> I think I'm hopelessly addicted to ido at present.  

There's hope even for the hopeless... but habits can be hard to kick.





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

* Re: Info-mode and ido
  2008-03-31  3:34             ` Drew Adams
@ 2008-03-31  4:05               ` William Xu
  2008-03-31 17:29                 ` Drew Adams
  0 siblings, 1 reply; 13+ messages in thread
From: William Xu @ 2008-03-31  4:05 UTC (permalink / raw)
  To: help-gnu-emacs

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

> A difference is that Ido shows candidates in the minibuffer and Icicles does
> not, but that is not a major UI difference. (And you can use Icicles with
> icomplete[+].el.)

Thanks for pointing out.  (I guess mastering Icicles must be tough...)

That works more like ido, only very slow.  I did some tests with
icy-mode and icomplete-mode on.  It(switching buffers, selecting nodes
in Info-mode) usually takes around 0.5~1 second for the completions to
appear in minibuffer, on a 2.2GHz, Intel Core 2 Due macbook. 

> So don't open it. You never need to show *Completions*. You say that you don't
> look at the candidates list in Ido's minibuffer anyway, so you apparently don't
> need to see any candidates.

Hehe, i'm sorry didn't address it well.  I do look at candidates list in
Ido.  It's still the distraction thing.

-- 
William

http://williamxu.net9.org





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

* RE: Info-mode and ido
  2008-03-31  4:05               ` William Xu
@ 2008-03-31 17:29                 ` Drew Adams
  0 siblings, 0 replies; 13+ messages in thread
From: Drew Adams @ 2008-03-31 17:29 UTC (permalink / raw)
  To: 'William Xu', help-gnu-emacs

> > A difference is that Ido shows candidates in the minibuffer 
> > and Icicles does not, but that is not a major UI difference.
> > (And you can use Icicles with icomplete[+].el.)
> 
> Thanks for pointing out.  (I guess mastering Icicles must be tough...)

Tough why? Because it does not give you "ido-style" out of the box?

You don't need to master Icicles to use it, but if you want non-default behavior
then yes, you need to find out what's available. It's like Emacs: you can get
behavior you are used to in another editor, but you might need to read some doc
to find out how.

> That works more like ido, only very slow.  I did some tests with
> icy-mode and icomplete-mode on.  It(switching buffers, selecting nodes
> in Info-mode) usually takes around 0.5~1 second for the completions to
> appear in minibuffer, on a 2.2GHz, Intel Core 2 Due macbook. 

I don't want to belabor this, but I'll mention it for others:

1. icomplete[+].el is different from Icicles. I mentioned it only because you
like to see candidate feedback in the minibuffer - even if you don't look at it.
;-)

2. By default, Icicles updates the set of completions at each character you
edit. You can turn this incremental completion off as an option or toggle it
off/on using `C-#' in the minibuffer. There are also other options to control
this behavior: a delay and a threshold (number of candidates).

3. Icicles also checks where, in your input, matching fails, and it highlights
that non-matching part (hit `C-M-l' to delete it). (This is similar to the
isearch match-failure highlighting that we added to Emacs recently.) That can
mean multiple checks of parts of your input against the domain of candidates (it
uses binary search to minimize the number of checks).

`C-#' also turns this off/on. There are additional options to control this
behavior: a delay, a threshold, and when to perform it - never, only on demand
(when you hit [S-]TAB), not for lax completion (e.g. file names), not for remote
file names, and so on.

Someone like yourself, who tends not to look at what he types and is concerned
about speed, might want to turn off non-match highlighting for specific contexts
or always.

4. You can complete without displaying *Completions*. That display, which you
find distracting, also takes some time.

5. What seems to be faster is sometimes slower. ;-)

HTH.





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

end of thread, other threads:[~2008-03-31 17:29 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-25 11:32 Info-mode and ido William Xu
2008-03-29 22:02 ` Drew Adams
2008-03-30  7:49   ` William Xu
2008-03-30  9:12     ` Peter Dyballa
2008-03-30  9:18       ` William Xu
2008-03-30 16:42         ` Drew Adams
2008-03-30 16:42     ` Drew Adams
2008-03-31  0:20       ` William Xu
2008-03-31  1:29         ` Drew Adams
2008-03-31  2:40           ` William Xu
2008-03-31  3:34             ` Drew Adams
2008-03-31  4:05               ` William Xu
2008-03-31 17:29                 ` Drew Adams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).