GNU bug report logs - #63828
29.0.90; project-query-replace-regexp tries to find-and-replace in binary files

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Thu, 1 Jun 2023 20:17:02 UTC

Severity: normal

Found in version 29.0.90

Full log


Message #11 received at 63828 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Spencer Baugh <sbaugh <at> janestreet.com>, 63828 <at> debbugs.gnu.org
Subject: Re: bug#63828: 29.0.90; project-query-replace-regexp tries to
 find-and-replace in binary files
Date: Sat, 3 Jun 2023 04:47:02 +0300
On 01/06/2023 23:16, Spencer Baugh wrote:
> 1. emacs -Q
> 2. Open a git repository which has some binary files committed, or any
> other project that has binary files.
> 3. C-x p r foo bar
> 4. query-replace will enter the binary files
> 
> Perhaps it should not do this?  Perhaps fileloop-initialize-replace
> should skip binary files?  Perhaps by some customization?

It would be useful if you compare to what project-find-regexp does in 
such project: does it produce the matches in said binary files?

If it behaves better (from your POV), one solution could be to 
pre-filter the list of project files using the same search, before 
passing them to project-query-replace-regexp. It can have benefits in 
performance as well.

(BTW JFYI, you can press 'r' inside the project-find-regexp output 
buffer instead of using 'project-query-replace-regexp'.)




This bug report was last modified 2 years and 13 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.