Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project Grep Buffer Filled With Cruft #34

Closed
trishume opened this issue Oct 25, 2014 · 8 comments
Closed

Project Grep Buffer Filled With Cruft #34

trishume opened this issue Oct 25, 2014 · 8 comments

Comments

@trishume
Copy link
Contributor

When using projectile grep (SPC p g) it creates a grep buffer that includes a 10 line find grep pipeline, which means you can't see any results unless you scroll down. That brings me to the second problem: the buffer isn't focused by default, so you have to switch to it before you can scroll down.

Ideally the find command should be hidden and the buffer should be selected by default. I'll try to fix this myself if this is something that you never use.

Here's the cruft that is printed, except the one long line wraps into around 20 lines:

-*- mode: grep; default-directory: "~/Box/Dev/Projects/MacRanger/" -*-
Grep started at Fri Oct 24 20:52:11

find . -type d \( -path \*/.eunit -o -path \*/.git -o -path \*/.hg -o -path \*/.fslckout -o -path \*/.bzr -o -path \*/_darcs -o -path \*/.tox -o -path \*/.svn -o -path \*/build -o -path \*/SCCS -o -path \*/RCS -o -path \*/CVS -o -path \*/MCVS -o -path \*/_MTN -o -path \*/\{arch\} \) -prune -o \! -type d \( -name TAGS -o -name .\#\* -o -name \*.beam -o -name \*.vee -o -name \*.jam -o -name \*.o -o -name \*\~ -o -name \*.bin -o -name \*.lbin -o -name \*.so -o -name \*.a -o -name \*.ln -o -name \*.blg -o -name \*.bbl -o -name \*.elc -o -name \*.lof -o -name \*.glo -o -name \*.idx -o -name \*.lot -o -name \*.fmt -o -name \*.tfm -o -name \*.class -o -name \*.fas -o -name \*.lib -o -name \*.mem -o -name \*.x86f -o -name \*.sparcf -o -name \*.dfsl -o -name \*.pfsl -o -name \*.d64fsl -o -name \*.p64fsl -o -name \*.lx64fsl -o -name \*.lx32fsl -o -name \*.dx64fsl -o -name \*.dx32fsl -o -name \*.fx64fsl -o -name \*.fx32fsl -o -name \*.sx64fsl -o -name \*.sx32fsl -o -name \*.wx64fsl -o -name \*.wx32fsl -o -name \*.fasl -o -name \*.ufsl -o -name \*.fsl -o -name \*.dxl -o -name \*.lo -o -name \*.la -o -name \*.gmo -o -name \*.mo -o -name \*.toc -o -name \*.aux -o -name \*.cp -o -name \*.fn -o -name \*.ky -o -name \*.pg -o -name \*.tp -o -name \*.vr -o -name \*.cps -o -name \*.fns -o -name \*.kys -o -name \*.pgs -o -name \*.tps -o -name \*.vrs -o -name \*.pyc -o -name \*.pyo \) -prune -o  -type f \( -iname \* -o -iname .\* \) -exec grep -i -nH -e resize {} +
@syl20bnr
Copy link
Owner

It would be a great improvement!

I do use it with <SPC> e n (next error) to go to the next occurence and switch explicitly to the window with <SPC> windows num if I want to browse the occurence without going to each location. If nothing is useful I close the popup with <SPC> w p (window popup), you can also use <SPC> w u to "undo" the layout and go back to the previous one.

There is a caveat, when the grep buffer is selected and I hit enter to go to a specific occurence, a new window is opened instead of reusing a current window. It annoys me a lot. This behavior does not appear with <SPC> n e which may be a good pointer to find a solution to this.

@syl20bnr
Copy link
Owner

Indeed, autofocus with reuse of opened window would be a lot better.

I wonder if there is a mode to get the results in a helm buffer.

@tuhdo
Copy link
Contributor

tuhdo commented Nov 4, 2014

I created PR for adding helm-projectile-grep/ack/ag in Projectile. You can have a look here. It could be a better alternative.

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 4, 2014

@Thudo very interesting, I will watch this. We have also to be sure that Windows users can still be able to find files in their projects.

@tuhdo
Copy link
Contributor

tuhdo commented Nov 4, 2014

@syl20bnr (helm-)projectile-find-file works fine on Windows. As for grepping, I can confirm it works properly if you setup cygwin/mingw correctly that Emacs can use proper Linux utilities.

@syl20bnr
Copy link
Owner

syl20bnr commented Nov 4, 2014

Great news!

@tuhdo
Copy link
Contributor

tuhdo commented Nov 5, 2014

Fyi, the change has been merged.

@syl20bnr
Copy link
Owner

I consider this a non-issue now we have better solutions than grep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants