clj-refactor.el icon indicating copy to clipboard operation
clj-refactor.el copied to clipboard

Friendlier cljr--prompt-user-for

Open vemv opened this issue 5 years ago • 6 comments

When e.g. cljr-slash asks me to disambiguate a libspec, the *Completions* buffer is kinda hidden (you're not aware of it until you hit TAB), so a newbie user may be inclined to type the whole thing by hand.

So, in cljr--prompt-user-for, I'd:

  • Make completing-read a customizable fn, and/or
  • Infer if IDO is loaded, in which case use ido-completing-read.

Sounds good?

Can contribute a PR if you indicate what approach to take.

Cheers - Victor

vemv avatar Sep 19 '18 21:09 vemv

In general this sounds like a good idea.

I'm using a ton of other libraries to make my completion experience better, so this feature is working beautifully for me. When I hit /, and it needs disambiguation, I immediately get a completion popup provided by ido-vertical-mode. It looks very much like the example gif.

What does this look like for you?

expez avatar Sep 20 '18 07:09 expez

Thanks for the reply!

What does this look like for you?

By default it looks like this to me:

image

After M-x ido-everywhere I don't get an improvement either. I also use https://github.com/katspaugh/ido-at-point , no luck.

vemv avatar Sep 20 '18 16:09 vemv

I think it's an anti-pattern to use directly any functions from a completion package. Most of them tweak completing-read directly and by not using it, you're damaging the compatibility with the different completion packages. E.g. - I use ivy and it doesn't require any special functions to be used.

bbatsov avatar Sep 20 '18 19:09 bbatsov

Interesting. What would be a proper IDO setup under that guideline?

Maybe the only thing I haven't tried in depth is https://github.com/DarwinAwardWinner/ido-completing-read-plus.

But it'd seem weird to me that an external package was needed to properly setup IDO. Also 1200 LOC / 567 commits seems scary for something which should be simple.

vemv avatar Sep 20 '18 21:09 vemv

Yep, that's exactly what you need to be using. Unfortunately the core of ido is old and for some reason it doesn't implement the ability to hook into completing-read (it can only do this for buffer and filenames). See https://github.com/DarwinAwardWinner/ido-completing-read-plus/issues/63 for details. I used this package for many years before I decided to replace ido with ivy, so I can vouch that it's solid.

bbatsov avatar Sep 21 '18 04:09 bbatsov

Then perhaps the only actionable item would be to expand the README?

vemv avatar Oct 02 '18 05:10 vemv