minad / consult

:mag: consult.el - Consulting completing-read
GNU General Public License v3.0
1.12k stars 98 forks source link

Need a recipe for annotating `consult-line` ( `consult-grep` etc) with `which-function` #992

Closed emacksnotes closed 1 month ago

emacksnotes commented 1 month ago

Provide which-function (= "context of the hit") as an annotation to the search hits.

Even without preview turned on, simply having the which-function in completions buffer (either as marginalia annotation or "in place" annotation) would help a lot.

See screenshot for where I imagine the which-function annotation will be displayed. I don't look at the line numbers, and I would be happy if the line numbers of the hits are elided, and which-function is displayed inside.

Recipe for annotating consult-line ( consult-grep etc) with which-function

2024-04-09_08-35