counsel-etags icon indicating copy to clipboard operation
counsel-etags copied to clipboard

Custom callback if tag is not found

Open Opioid opened this issue 6 years ago • 4 comments

Is it possible to add an optional, custom callback for cases when no tag is found? For me, this typically happens when I try to look up a local variable and it that case I would find it most useful to simply use swiper or something in the current file.

Opioid avatar Nov 05 '18 09:11 Opioid

You could just setup ~/.ctags, add more regular expression to extra local variable.

redguardtoo avatar Nov 05 '18 10:11 redguardtoo

I didn't think about that. But that would also give me results from different files, right?

I already have a key that does "swiper-at-point", which I use very often to track the usage of local variables in a single file. Admittedly it is a different functionality, but it in my workflow they are closely related, which is why it would feel lika a natural fallback for me personally.

(The idea actually came to me because the counsel-etags-grep fallback never seems to work, although ripgrep is working for other commands in emacs (e.g. projectile). Maybe that is an issue with rg not being in the cygwin folder...)

Opioid avatar Nov 05 '18 11:11 Opioid

I would like this too, as this would make it easier to register counsel-etags with smart-jump

sandinmyjoints avatar Aug 20 '19 17:08 sandinmyjoints

See counsel-etags-fallback-grep-function whose default value is counsel-etags-grep

redguardtoo avatar Oct 07 '20 01:10 redguardtoo