Change display of helm grep results?

8 views
Skip to first unread message

Christian Wittern

unread,
Mar 3, 2017, 4:57:35 AM3/3/17
to emacs-helm
Hi there,

I am just starting to develop with helm and am hitting some roadblocks. Here is what I want to do:

For a package aimed at non-technical users I am developing, I would like to display grep results in a less intimidating way.  Specifically, I want to change the filename display to show only the filename, not the path, hide the line numbers and clean up the rest of the line to hide a few markup characters. What would be the best way to achieve this? Should I try to dig into the helm internals to come up with a way to modify helm-grep?  Or should I set it up as a new source and parse the grep result buffer myself, then feeding them to helm as candidates?

Essentially, what I want to do is let the users run a grep and then filter the results based on patterns, in a visually pleasing way.

Any help or pointers to examples are appreciated,

Christian

Thierry Volpiatto

unread,
Mar 3, 2017, 7:48:45 AM3/3/17
to emacs...@googlegroups.com

Christian Wittern <cwit...@gmail.com> writes:

> Hi there,
>
> I am just starting to develop with helm and am hitting some roadblocks. Here is what I want to do:
>
> For a package aimed at non-technical users I am developing, I would
> like to display grep results in a less intimidating way. Specifically,
> I want to change the filename display to show only the filename, not
> the path, hide the line numbers and clean up the rest of the line to
> hide a few markup characters.

You will have to modify the regexp in charge to split candidates in
`helm-grep-split-line` (at least) according to what your grep command
output.
You may have problems elsewhere I have not in head right now, helm-grep
code is quite tricky, let me know if something else is not working.

--
Thierry

Christian Wittern

unread,
Mar 3, 2017, 5:36:11 PM3/3/17
to emacs-helm


On Friday, March 3, 2017 at 9:48:45 PM UTC+9, thierry v wrote:


You will have to modify the regexp in charge to split candidates in
`helm-grep-split-line` (at least) according to what your grep command
output.
You may have problems elsewhere I have not in head right now, helm-grep
code is quite tricky, let me know if something else is not working.

--
Thierry

Dear Thierry,

Thanks for the heads up. I tried this, but then I realized I need an alist for the candidates, so I guess I will have to create a custom source for this.

All the best,

Christian
Reply all
Reply to author
Forward
0 new messages