emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: commands to remove commented lines from grep output


From: Drew Adams
Subject: RE: commands to remove commented lines from grep output
Date: Mon, 2 Jul 2007 15:58:11 -0700

>     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.

Do you mean, for example, automatically tweaking the regexp supplied to
grep, so that commented lines are not included? That would be good,
especially if it could handle lines commented between /* and */ (for C). It
would still be good to supply a toggle for this automatic removal.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]