reddit / emacs

Why is counsel find file forwarded to find file and how can I make it work?

fabianmg · 2022-03-22 16:20
When I do `M-x counsel-find-file` redirects to find-file and I get no extra information ( like `counsel-describe-functions` or `counsel-describe-variables` ). I haven't forwarded it myself or at least knowingly, how can I get that extra info there?. `M-x coun...` https://preview.redd.it/54h8hknhnyo81.png?width=1408&format=png&auto=webp&s=1e09aa0e063e154ade05a2411aef93f87fee4d37 `M-x counsel-find-file` https://preview.redd.it/cq29iddqnyo81.png?width=1412&format=png&auto=webp&s=f6965531952712748e9421d32f87ebb461d5501d ​ **Uptate:** Ok, I think I narrowed the problem to Ivy Rich, if I disable and enable again Ivy Rich then it does shows that extra info I was talking about. Same init file and packages, the only difference between the image above and the image below is enabling and disabling the ivy-rich-mode with M-x ​ https://preview.redd.it/3kya56j9sop81.png?width=1342&format=png&auto=webp&s=97ccb6e00bda1a954e68c9e99fbe0fde0107732d I tried adding and `:after ivy` or `:after counsel` to the Ivy Rich package, but no luck so far. I already tried starting with a minimal `init.el` file with `use-package`, `ivy`, `ivy-rich` and `counsel` and nothing else. The funny thing is that ivy rich works perfectly without that enable/disable process on the rest of the counsel tools, `counsel-describe-symbol`, `counsel-describe-function`, `counsel-describe-variable`, etc.. it just doesn't work on the `counsel-find-file` ​ **2nd Update:** Ok, this is very weird. If I delay the initialize of ivy-rich **after** emacs finish the startup process then it works perfectly. `(add-hook 'emacs-startup-hook(lambda () (interactive "") (ivy-rich-mode 1))))` I'll keep removing parts of my config file, it has to be something that messes with ivy-rich after I init the package. Thanks
Alan_Shutko · 2022-03-22 21:28
What you are seeing is actually the first line of the doc string for counsel-find-file. You can see the whole thing with C-h f counsel-find-file but there isn’t much there.
fabianmg · 2022-03-23 11:33
`C-h f` is binded to `counsel-describe-function` I'm afraid.
Alan_Shutko · 2022-03-23 16:49
I may not understand your problem. counsel-describe-function will still show the help info for counsel-find-file. There's just not a lot of info there to be shown. counsel-find-file is an autoloaded interactive compiled Lisp function in ‘counsel.el’. It is bound to C-x C-f, <open>, <menu-bar> <file> <new-file>. (counsel-find-file &optional INITIAL-INPUT INITIAL-DIRECTORY) Forward to ‘find-file’. When INITIAL-INPUT is non-nil, use it in the minibuffer during completion.
oantolin · 2022-03-24 02:21
That is just how counsel describes the functionality of counsel-find-file. Is there anything about the behavior of counsel-find-file you'd like to change?
[deleted] · 2022-03-24 10:46
[deleted]
fabianmg · 2022-03-24 10:46
My bad, I though that the counsel find file would show more info ( sizes, type of file, etc... ) like the rest of the counsel modes ( describe-variable, describe-function, etc.. ).
oantolin · 2022-03-24 14:14
Oh, I understand what you wanted now! To get that extra information for files you can install the Marginalia package I co-wrote with Daniel Mendler and activate `marginalia-mode`.
fabianmg · 2022-03-26 08:08
I had the Marginalia package in my mind for future testing, I saw Protesilaos vídeo and it looks awesome with vertico and embark. But for now I'm trying to make Ivy, Ivy-Rich and Counsel work. I think I narrowed the problem to Ivy Rich, if I disable and enable again Ivy Rich then it does shows that extra info I was talking about. ( check the updated post images and info )
fabianmg · 2022-03-26 08:19
I think I narrowed the problem to Ivy Rich, if I disable and enable again Ivy Rich then it does shows that extra info I was talking about. ( check the updated post images and info )
oantolin · 2022-03-26 09:33
Well, if you can't get ivy-rich to work, I just want to point out that to use Marginalia you don't have to switch to Vertico: Marginalia also supports Ivy! :P That's the point of the family of completion-related packages Daniel and I maintain: they are plug and play.
fabianmg · 2022-03-26 10:29
I didn't know that Marginalia works with Ivy!, awesome!. I'll give it a try then, I checked some screenshots and some videos ( from Protesilaos and System Crafters ) and it looks pretty nice. Thank you for your work on Marginalia.
fabianmg · 2022-03-26 15:33
Same problem with the Marginalia package, it works everywhere but on find-file, I have to check because it has to be a problem with something in my config file. Time to take it apart piece by piece. Thank you for your help!
oantolin · 2022-03-26 16:41
That is strange! I hope you figure it out.