From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matthias Meulien Newsgroups: gmane.emacs.bugs Subject: bug#75379: 30.0.93; project-find-regexp expects "C" or "en" locale Date: Mon, 6 Jan 2025 13:36:18 +0100 Message-ID: References: <86jzb96qul.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000bddc2e062b08e062" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37024"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 75379@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 06 13:37:25 2025 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 1tUmMH-0009Sm-Di for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Jan 2025 13:37:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUmLy-0004VR-Gt; Mon, 06 Jan 2025 07:37:06 -0500 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 1tUmLv-0004Ue-A1 for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 07:37:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tUmLv-0005LW-1i for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 07:37:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=Mahd4JaKRX/NxL4szc9G6VcKiJIHhiDO3g4yWV8eY2Q=; b=QPi8a4XlxkFZy2/LgtphxI+MSFkpMnLQXZbAhkKVXuW/kvq2t/z/RPt77bqY4NV7vkYmr6FNLVUe8ZaCxqbQ9XD3obGCZeGDddlX18c+MK9/O4K3o7TmWIYZeB/qLHv/546F/1fY8ZU6eTtMOZ6gNqlWyBjTqHD5ASuPeZET5Eyg52k8jVcs/NNWle1p1BAePijMapR0EEhGT+0wGfOttqQHcpI2AnV+Hw3nGx5XZw8ZfhUeJjMtucrsE2FfKhi/ro8ebfMW3+MEkYyNff2Sef9nNxB9BpHB+DEBaWwV4ZjbG/sDNGULqx+cUOcReM1ORArbbpaBluLUpFAP253iFQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUmLu-0001PV-Tl for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 07:37:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Matthias Meulien Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Jan 2025 12:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75379 X-GNU-PR-Package: emacs Original-Received: via spool by 75379-submit@debbugs.gnu.org id=B75379.17361669955362 (code B ref 75379); Mon, 06 Jan 2025 12:37:02 +0000 Original-Received: (at 75379) by debbugs.gnu.org; 6 Jan 2025 12:36:35 +0000 Original-Received: from localhost ([127.0.0.1]:37106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUmLT-0001OP-C2 for submit@debbugs.gnu.org; Mon, 06 Jan 2025 07:36:35 -0500 Original-Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]:44408) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tUmLQ-0001OD-2f for 75379@debbugs.gnu.org; Mon, 06 Jan 2025 07:36:33 -0500 Original-Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-aa6c0d1833eso2984293866b.1 for <75379@debbugs.gnu.org>; Mon, 06 Jan 2025 04:36:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736166991; x=1736771791; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Mahd4JaKRX/NxL4szc9G6VcKiJIHhiDO3g4yWV8eY2Q=; b=PBS0muuS5FdIDDbv8TpyJeiLQhIYRihTM08lbwE7Nx1ABUkq7r8ehIxCW3V9Atkj4A Q3kFo14hGAXmm4ktMjiCXv0gW8MYKkM0dajGokRsBulOrjQh+r5jFuucQ2Vde3MIqusv TsqdInRm48X/92ra2yIu2fRN21mm8Xs0UJlmoUrcJgQ+Vd9LXqz9fdBqLH7UayzOznQK 1/37jYni4fG2vzxjiLtmlUcXsdaJxXGSiW7V06otVm14EqlGvYxRVwq0QMzDbDZHwZKc dBpzi/n8xcExMY1so4hDDtqzG+3jQLoEYDNdLgKfPhtnEygMpzIUP5qk0Z+L+RZebir4 YCWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736166991; x=1736771791; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Mahd4JaKRX/NxL4szc9G6VcKiJIHhiDO3g4yWV8eY2Q=; b=iOR33S6oFsHu5YyQnzEEKTGrDiWS2cJjLaZnFTat076OpvTFxr/aMje8+AnrxpYpfI oP1BTuIUsvInthQ7+05llsqpjs6uHPC1KKWc8IZ9z5LGoqU+ssJt7G2KyXnj6iEE87Id fXbJnY1BnvRvft8Dp14DgXGNsjOJzMEoCykDn/OSjNCayt6e7cjZQVTk5N9bvt7ELFBP GxgvU7jr6wIAO/92ExoxVso1x+cuO5U3gyoy/Gaz0rrOLZOmI1VoHQdQ78VKeHsSTOrA LNxlEmKEHhb3z/efCUOaOaiQgkbDlNeIp3+j6EhokqtHfuYWgvqlDYCcRHTmHfd3M07/ AJBQ== X-Forwarded-Encrypted: i=1; AJvYcCWn3eKbhhvFzUSMF56vwfeGtn/0KOWn7LnSiepfjWRJ4Mws+xlif7FlXiwvtjRA4n4XIKteNw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyqJJXcTAHJPs0l8Xlk03rps/Q6RkxckXr2GVMZWbuad/27rtJf lJPOrgyIvLy+6DPp6dmqlSCzaju5tqKA6DcD11EPr3OlUrcNUJ5TKvBjYhyB0p/ZZ1Mcjsz593Y yAXUp+GPMnE4BTWb8HBeO14DdvnI= X-Gm-Gg: ASbGncszCqt75tQC19facmtVlfuF5Ca2ZQZO2UIX709bx/LCPV87nyg7mBbSd7YKg6D 0CfpjNTcEdyo5t1t77Q7kVUP1ZuZkIAooqlsMF8y/UCfDO0OmIEOZAisyHeJaNWKwxDj06w== X-Google-Smtp-Source: AGHT+IEm8K1Y/sxlEMletda4IrvLsDEWG1VzHQgGa/vBaG4gFOqwR1XnyehbIPc7mG05zNOMc6D2PH7eoT8GhZNeGGs= X-Received: by 2002:a17:907:7a85:b0:aae:8491:bab5 with SMTP id a640c23a62f3a-aae8492b8d1mr4370706066b.26.1736166990532; Mon, 06 Jan 2025 04:36:30 -0800 (PST) In-Reply-To: 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:298648 Archived-At: --000000000000bddc2e062b08e062 Content-Type: text/plain; charset="UTF-8" > > Thanks, this is a solid proposal, but as per comment: > > ;; TODO: Show these matches as well somehow? > > we would probably want to print these weird matches as well, in the > future. As you mention, search programs have a flag which avoids > printing these matches, but in certain rare cases it might happen that a > mostly text file is detected as binary - and then it seems preferable to > print all of such matches in the buffer rather than ignore them. (Unless > people disagree?) > > And yeah, it's an old comment, so this improvement is not high on the > list, but whenever we (I/you/anybody else) get around to implementing > it, What would be the "right thing to do"? Should we call grep and ugrep with "--binary-files=text" (and ripgrep has the equivalent "-a") and then ask Emacs to guess whether each match is "compatible" with the process encoding system and based on that decide whether to display the match or print a warning like "match found among unprintable binary data" nearby the file name? -- Matthias --000000000000bddc2e062b08e062 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks, this is a solid proposal, but as per comment:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; TODO: Sho= w these matches as well somehow?

we would probably want to print these weird matches as well, in the
future. As you mention, search programs have a flag which avoids
printing these matches, but in certain rare cases it might happen that a mostly text file is detected as binary - and then it seems preferable to print all of such matches in the buffer rather than ignore them. (Unless people disagree?)

And yeah, it's an old comment, so this improvement is not high on the <= br> list, but whenever we (I/you/anybody else) get around to implementing
it,

What would be the "right thing to = do"? Should we call grep and ugrep with "--binary-files=3Dtext&qu= ot; (and ripgrep has the equivalent "-a") and then ask Emacs to g= uess whether each match is "compatible" with the process encoding= system and based on that decide whether to display the match or print a wa= rning like "match found among unprintable binary data" nearby the= file name?
--
=
Matthias
--000000000000bddc2e062b08e062--