[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
M-x grep: broken buffer with pipes
From: |
Sam Steingold |
Subject: |
M-x grep: broken buffer with pipes |
Date: |
Wed, 30 Dec 2009 15:06:30 -0500 |
User-agent: |
Thunderbird 2.0.0.22 (X11/20090625) |
For specificity, visit the emacs/lisp/grep.el file and do
M-x grep RET 'defvar.*buffer' *.el RET
(I.e., the shell command is "grep -nH -e 'defvar.*buffer' *.el").
the *grep* buffer contains about 50 matches, each clickable,
and a line typically looks like
<file>:<line>:(<defvar foo-buffer>-zot nil
where <file> is green, <line> is reddish, <defvar foo-buffer> is yellow.
Everything is great, clicking on the file name visits the file.
Now, in the same grep.el buffer, do this:
M-x grep RET 'defvar.*buffer' *.el | grep -v '"' RET
(the shell command is "grep -nH -e 'defvar.*buffer' *.el | grep -v '"'")
The *grep* buffer now contains (correctly) about 10% fewer matches, and <file>
and <line> are still good, but the <defvar foo-buffer> part is no longer yellow.
That lack of match highlighting is not a big deal, however, there is a hugely
more horrible problem: one cannot click on the file name to visit the file.
When you click on the file name, the file selection menu appears, with the
default being ^[[K<file> where "^[" stands for the escape character (ESC (27,
#o33, #x1b)) and <file> is the file name you clicked on.
So, where do these 3 spurious characters (ESC [ K) come from?
- M-x grep: broken buffer with pipes,
Sam Steingold <=