abo-abo / swiper

Ivy - a generic completion frontend for Emacs, Swiper - isearch with an overview, and more. Oh, man!
https://oremacs.com/swiper/
2.31k stars 338 forks source link

can't goto other info file when `M-x Info-goto-node` with ivy-mode enabled #1597

Open whatacold opened 6 years ago

whatacold commented 6 years ago

Hi,

Recently I enables ivy-mode globally with (ivy-mode 1), then I noticed that it failed to goto other info file in Info-mode.

For example,

  1. I am browsing randomly in some info doc, say (ivy)
  2. then after some time I want to see some doc about elisp, M-x Info-goto-node will pop up candidates of current file only, so I have no way to go to elisp.

    I roughly read the ivy doc and searched the web, but failed to find any helpful. And a few days ago I encountered a similar problem with org-refile, and managed to solved it by setting (setq org-outline-path-complete-in-steps nil).

    So is there a way to solve it in ivy? Thanks.

whatacold commented 6 years ago

A workaround I can think of is to define a before advice for Info-goto-node, but it is Info-mode specific. It will be perfect if there is a general way.

basil-conto commented 6 years ago

Just to be clear, here's a MWE. Compare:

  1. emacs -Q
  2. C-hi
  3. memacsRET
  4. g(elisp)NumberTAB
    • Completes to "Numbered Backups" and "Numbers"

with:

  1. make plain
  2. Steps 2-3 as before
  3. g(elisp)
    • No completions
  4. TAB
    • Nothing happens
  5. TAB
    • Prompt changes to Go to node (match required):
basil-conto commented 6 years ago

Possibly relates to #946, #1524, and #1556.

xtifr commented 5 years ago

Note that default completion (without ivy) works fine here. In a random info node in the emacs manual, you can press 'g ( e TAB' and it will show all the manuals whose name start with 'e', such as the elisp manual. However, if you turn on ivy-mode, you can't see those other manuals, and you can't get to those other manuals. This is a pretty severe reduction in functionality!

This also means that someone with ivy installed and enabled won't be able to get all the way through the info manual itself. They will get stuck at the node "(info)Go to node".

abo-abo commented 5 years ago

Here's how Ivy works with Info:

  1. g works only within the current manual
  2. to switch manuals, press dg.
xtifr commented 5 years ago

Hmm, maybe ivy's version of 'g' could include a message to that effect somehow? For the sake, if nothing else, of the poor newbs trying to get through the info manual itself?

Also: wishlist: maybe figure out some way of combining the two commands?

basil-conto commented 5 years ago

Also: wishlist: maybe figure out some way of combining the two commands?

The best way to do that would be to support programmed completion.

abo-abo commented 5 years ago

I'm open to improvements. But let's not pretend that the built-in programmed completion does it in the best (or even in a good) way.

With default completion, suppose I'm in (emacs). I press TAB, and I get all candidates for (emacs). No mention that (elisp) or (ccmode) also exist. However, when I input ( and press TAB, suddenly they are offered as completion candidates, along with all files in the current directory.

For Ivy, I would prefer a more consistent and discoverable interface. Although, we do hide the dotfiles for counsel-find-file, which is similar. And the /ssh: or /sudo:: switches in counsel-find-file are not very visible :). So there are still improvements to be made.

The best way to do that would be to support programmed completion.

Programmed completion is basically :dynamic-collection. We could just hand everything over to Info-read-node-name-1 and programmed completion. But then (I think) we lose regex builders, which I would like to avoid.

I can't recall more built-in cases where we don't have access to the full collection, other than Info-read-node-name-1 and read-file-name-internal, which are the use cases for programmed completion. Both can be solved by multi-stage completion where each stage has access to the full collection, just like what counsel-find-file does.

basil-conto commented 5 years ago

But let's not pretend that the built-in programmed completion does it in the best (or even in a good) way.

There's nothing wrong with programmed completion per se; it's how it's used that may not be the most elegant, or in this case compatible with Ivy's UI.

For Ivy, I would prefer a more consistent and discoverable interface.

If Ivy did something similar to the built-in completion, where the extra programmed completions don't appear until I pressed TAB or similar, I wouldn't personally find this inconsistent, and it'd be no less discoverable than the current situation. I'm not sure if this approach would always work, though.