[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#63828: 29.0.90; project-query-replace-regexp tries to find-and-repla
From: |
Eli Zaretskii |
Subject: |
bug#63828: 29.0.90; project-query-replace-regexp tries to find-and-replace in binary files |
Date: |
Fri, 02 Jun 2023 09:08:16 +0300 |
> From: Spencer Baugh <sbaugh@janestreet.com>
> Date: Thu, 01 Jun 2023 16:16:03 -0400
>
>
> 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?
Either user option or prefix argument, IMO. And this should be
documented with the caveat that a VCS can decide that a file is binary
even when it is not. For example, I've seen Git treating very large
parser.c files in tree-sitter grammar repositories as binary files for
some reason. Another example is CVS on MS-Windows: best practice is
to checkout all the files with the -kb switch, so that the client
doesn't attempt to convert EOLs to the Windows CR-LF format (which
ruins some files).