From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <83y1l2bdm7.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30207"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63828@debbugs.gnu.org To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 02 08:08:23 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q4xxX-0007eS-8n for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 02 Jun 2023 08:08:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4xxE-0006oG-9b; Fri, 02 Jun 2023 02:08:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4xxC-0006o5-7h for bug-gnu-emacs@gnu.org; Fri, 02 Jun 2023 02:08:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q4xxB-0006jj-Ug for bug-gnu-emacs@gnu.org; Fri, 02 Jun 2023 02:08:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q4xxB-0006ZU-Pf for bug-gnu-emacs@gnu.org; Fri, 02 Jun 2023 02:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Jun 2023 06:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63828 X-GNU-PR-Package: emacs Original-Received: via spool by 63828-submit@debbugs.gnu.org id=B63828.168568606425235 (code B ref 63828); Fri, 02 Jun 2023 06:08:01 +0000 Original-Received: (at 63828) by debbugs.gnu.org; 2 Jun 2023 06:07:44 +0000 Original-Received: from localhost ([127.0.0.1]:38965 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4xwu-0006Yw-EM for submit@debbugs.gnu.org; Fri, 02 Jun 2023 02:07:44 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4xwp-0006Yd-0W for 63828@debbugs.gnu.org; Fri, 02 Jun 2023 02:07:42 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4xwj-0006dL-Iw; Fri, 02 Jun 2023 02:07:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=clXSdPL0soVor/EEwQZXo0jJzhMbmntE21nJLlAQ5dY=; b=MYB8Wtv8lD8h uxzWAQ3s0dYrBZ6RlhMyQsncLtjblbTfNEFhYqaIJKdUD9PXCbbxfit1yJkwh5gTP9VKG+w7l0oVE vSTQSCKSyodt99weybqz2QzMr5IjGNBiTJEnUviwGMDaNUxFU7t0ygm88n5Yq2SSkzYoQilwE/At7 eKVSYW6BdpfTFSIc3XZVSW+E7GnKXsBU5QjD+NiskZ6GJqrUHVoU4RqRPmtU0M9qB02iz1Ts6svKM 41PpU/qmDJUWcOBPkIPgmJpKrNmFB0vkCIH4MzsjCw3M3C03hcxu3uqQ3ogWPiCgcDKDjjH5MnyjM B+1QrEpj5c5ru67dpG23qA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4xwe-0004bM-Em; Fri, 02 Jun 2023 02:07:33 -0400 In-Reply-To: (message from Spencer Baugh on Thu, 01 Jun 2023 16:16:03 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:262732 Archived-At: > From: Spencer Baugh > 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).