[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: commands to remove commented lines from grep output
From: |
Richard Stallman |
Subject: |
Re: commands to remove commented lines from grep output |
Date: |
Mon, 02 Jul 2007 18:40:23 -0400 |
I sometimes want to see grep matches only for lines of code that are not
commented out. At least for the simple case of single line comment syntax,
such as `;' in Lisp and `//' in C++, this is easy to do with `flush-lines'.
As a general feature, it seems useful.
To make this a little more convenient, I bind a more specific command that
does this to `;' in *grep* buffers. Another command, bound to `M-;', toggles
automatic removal of such commented lines.
I am not sure I like that interface for it. Also, it doesn't work for C.
It could be made to work for C with more code, which would involve
reading the source files and checking whether the lines found are
inside comments.
It seems to me that a new grep option might be a better approach.