Subject: bug#71321: 30.0.50; M-x grep: not recognizing well files with colon

From: Jim Porter <[email-masked]>
Date: Sun, 2 Jun 2024 21:17:02 -0700

On 6/2/2024 3:02 AM, Eli Zaretskii wrote:
>> From: Jean Louis <[email-masked]>
>> Date: Thu, 30 May 2024 13:03:31 +0300
>>
>> I have files like:
>>
>> ~/tmp/2024-05-17-10:39:33-RCD TEMPORARY BUFFER.txt
>>
>> and if I do M-x grep on those files, I get results such as:
[snip]
>> Where by when I try to click on the file, it is attempting to find wrong
>> file "2024-05-17-10" instead of "2024-05-17-10:39:33-RCD TEMPORARY
>> BUFFER.txt" so I guess that regular expression of finding the file in
>> *grep* temporary buffer shall be improved.

Jean: could you show the actual "grep" command that you're using here, 
and the output of "grep --version"? That would help narrow down what's 
going on here.

On 6/2/2024 3:02 AM, Eli Zaretskii wrote:
> Improved how?  Can you suggest how to distinguish between ":39:" and
> ":13:" in the Grep output, when searching where the file name ends and
> the line number and the following test starts?

M-x grep and friends should already be doing the right thing: when 
supported, it passes "--null" to "grep", which changes the output so 
that it separates the file name from the line number using a NUL 
character. The regexps in grep.el can then detect that output and parse 
it correctly.

I tried using a file name like the above, and it all works just fine for 
me. (I'm using GNU grep 3.4.)