Fork me on GitHub
#emacs
<
2022-07-15
>
Benjamin08:07:54

using vertico, consult and embark. Do you have a way to narrow down in completing-read-multiple and then just say "everything I just narrowed down"

Benjamin08:07:55

(completing-read-multiple "fo: " '("foo" "bar" "fofo"))
I like to just type fo and then get "foo" and "fofo"

Benjamin08:07:22

sort of a legendary flow for me would be to export with embark, then mark what I want in the export buffer and then be able to continue the completing-read-multiple call.

mpenet08:07:29

you can somewhat do that

mpenet08:07:06

you can embark-export, then use consult-line on the export buffer and export again etc etc

mpenet08:07:21

well it's not marking

mpenet08:07:54

and what I am suggesting works better with narrowing actually, so not sure it makes sense

mpenet09:07:08

heh in short ignore me 🙂

Benjamin09:07:19

I realized for my use case, multi occur; I already have the legendary flow by doing consult-buffer -> export with embark and using ibuffer occur on the export buff.

djm09:07:15

If I try consult-buffer + embark-export, and then run ibuffuer-do-occur, I get “Assertion failed: (derived-mode-p ’ibuffer-mode)“. Am I doing something different to you?

Benjamin09:07:04

you probably export with a mix of completion "kinds" and don't get an ibuffer buffer. By default in consult you can do b space to only get buffer completions, then embark export will make an ibuffer export buffffer

djm09:07:23

Yes, that was it. multi-occur-in-matching-buffers seems like a quicker way of doing roughly the same thing though

👀 1
otfrom10:07:16

these are sounding like good modern emacs configs. Do you have them shared anywhere?

otfrom10:07:34

I'm trying to make the move to vertico/consult/embark in my latest config

otfrom10:07:57

and with an install script ❤️

mpenet10:07:13

The install script is for emacs itself

👍 1
djm14:07:13

https://github.com/benjamin-asdf/dotfiles/blob/master/mememacs/.emacs-mememacs.d/lisp/init-project.el#L38= consult commands never seemed to work properly with project.el for me, although it’s been a while since I tried

Benjamin14:07:45

it works nicely, maybe they fixed something. Also I use consult-project-extra it's great

djm14:07:30

consult-ripgrep seems to work now 🤷

mpenet14:07:31

works for me as well, I just had to set a consult-project-root-function, but I am not even sure that's still necessary

djm14:07:11

My project root function combines project.el and perspective, so e.g. if I’m looking at a scratch buffer, it still knows what the project is

djm14:07:05

Interesting - consult-ripgrep and consult-project-extra-find work fine when switching projects, but consult-buffer doesn’t get the project root, and so doesn’t show project buffers/files.

Benjamin14:07:20

consult-buffer is for me for all buffers, consult-project-extra-find is for buffers and files in current project

djm14:07:18

If you run consult-buffer, and then type “p “, what happens?

Benjamin14:07:41

didn't know that was a feature 😛

djm14:07:47

Oh, I thought it would narrow to project buffers and files: https://github.com/minad/consult#virtual-buffers=

djm14:07:00

Works on my machine 😁

🎉 1
Benjamin14:07:21

consult--default-project-function does the right thing though

djm14:07:17

Are you in a project? Do “f ” and “b ” work?

Benjamin14:07:38

yes they work

djm14:07:13

Given all of the stuff consult-buffer does around this, I’ve never been sure what consult-project-extra provides that consult-buffer doesn’t, although I do have it installed.

djm14:07:32

But now that I know it works nicely with project switching, I finally have a use for it 😁

djm14:07:58

I spent ages in the past trying to get consult-buffer working with project.el, so this is a nice win!

Benjamin14:07:04

yea you might be right that consult buffer has the power already (with "p ")

djm14:07:07

I setup consult-buffer to be automatically narrowed to project (+ perspective) files and buffers

djm14:07:34

Maybe my version is does more though, as it combines perspective buffers and project files. Now I understand why consult-project-extra exists - it’s solving the same problem in a different way.

solf14:07:30

Is there something like cider-inspector for emacs-lisp?