From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#75379: 30.0.93; project-find-regexp expects "C" or "en" locale Date: Sun, 5 Jan 2025 20:03:34 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36774"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: Matthias Meulien , 75379@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 05 19:04:22 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 1tUUz6-0009Qf-RP for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Jan 2025 19:04:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUUyq-000138-Fv; Sun, 05 Jan 2025 13:04:04 -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 1tUUyo-000125-Bm for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 13:04:02 -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 1tUUyo-0000BH-2p for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 13:04:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:From:References:MIME-Version:Date:To:Subject; bh=351eHcJjjzbgmbSzEkjnsroGdrGoRt4qDZeXQfWrinw=; b=MwS5Yg8Pa2WtaEm8t9oqLLIDk8I61sqoLNv0DPb3bxsw8wDmQudF3NXFfg1WveNvJhmYdl+E71s+b54V6B4Pg6nionJvm9G43DptxYSGY2mepFQs//6fe4XFn2wlZE+uxtTND8crrFzOnNoErx561hWIY+itBfTDLgXohQD6DOdmTZ/zCXmVbxoIcmIlqZIC8g61keeGhd2G0aopx5nlO0OQd10L3dU1Wiq4FcHQhiY0+gTO4+pMZ7RjKVedGZtkpvpFtDN6aicubCVJ1xZ0BNE3VTfcLWeNVclIefCwHJ8VNkT6Q2v9ICXXk464cmxtUJLuac8NXDWo/VS0OBugUg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUUyn-0000OC-Pj for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 13:04:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Jan 2025 18:04:01 +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.17361002271450 (code B ref 75379); Sun, 05 Jan 2025 18:04:01 +0000 Original-Received: (at 75379) by debbugs.gnu.org; 5 Jan 2025 18:03:47 +0000 Original-Received: from localhost ([127.0.0.1]:35096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUUyZ-0000NK-FY for submit@debbugs.gnu.org; Sun, 05 Jan 2025 13:03:47 -0500 Original-Received: from fhigh-b8-smtp.messagingengine.com ([202.12.124.159]:37965) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tUUyW-0000Mz-QA for 75379@debbugs.gnu.org; Sun, 05 Jan 2025 13:03:45 -0500 Original-Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.stl.internal (Postfix) with ESMTP id E4E33254012F; Sun, 5 Jan 2025 13:03:38 -0500 (EST) Original-Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Sun, 05 Jan 2025 13:03:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1736100218; x=1736186618; bh=351eHcJjjzbgmbSzEkjnsroGdrGoRt4qDZeXQfWrinw=; b= Xs4hMhgEXOUs7myLXyDKdbTSJ8klrJkw824UwfCnrRR5eskpJFeSGkdarigxzb3H RSRaOn3nLorPS8hmI2xeBCyEYNyYzLCuq9A7r3AtaVk9QQ5htkM/FrCCcdJ/uQtY 6NP4S3shsceAcXEf1rDsqPZrSeIe0K+Q+mdYP7FkRYwLzeAui4plld3FpN2lUJ+r 5n7NlKskLVVXtXygW/4A3mM9Xw16gRlHvsCArHTJrk7Yvatw+Lp6lim1vrNZL6tC MsNCeoB0hJ3kzG5+bvtzTdKzTw78JAfOqLjU42mmmpdOWOq19GYNy/g7pvDTQsTQ 42K72EQJFIdegEVx5DavRQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1736100218; x=1736186618; bh=3 51eHcJjjzbgmbSzEkjnsroGdrGoRt4qDZeXQfWrinw=; b=jOQhpcGy+yG7ZtzJf h5LFbputxIMQTnOfcsn65Lkf+SbxkzPS4jLnBGTjreVl/wFcupAo5k9YxFGuzSWM +b9q+mjNgjPYo1t6vu/jT2pCxCl/xIWNHXw1CGmr42bwfQsdIDojTW94V0I7EemZ EmDtiTmjpYcLQzRZHAHbIk0gOVWICMUptVn6lrajXRm95CufNekCEovyzoDz7Dr8 TL1BSH61dYfD6bbOKJNXtfU+oFa0Snvrpqbu1jwMtQPohYXj962D8BdTz6xuwqtI pbdMBvjwwEygRO0e0XLQjMuVUbKWvKx4dUMwysF2fSCJXdukHbBMzqqDtwvqlFoz U8FJA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudefkedguddtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgg gfuffvfhfhjggtgfesthekredttddvjeenucfhrhhomhepffhmihhtrhihucfiuhhtohhv uceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtthgvrhhnpeehkeeftd evteekheehffektdffveefffeileelhffggeeuhfdtkeefueeviedugfenucffohhmrghi nhepghhithhhuhgsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthho pedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehorhhonhhtvggvsehgmhgrih hlrdgtohhmpdhrtghpthhtohepjeehfeejleesuggvsggsuhhgshdrghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 5 Jan 2025 13:03:37 -0500 (EST) Content-Language: en-US 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:298580 Archived-At: Hi! On 05/01/2025 12:35, Matthias Meulien wrote: > 1. Make sure you have a Git repository with binary files containing say >   the "copyright" word; One can clone > https://github.com/orontee/lesmotsdugene/ lesmotsdugene/> for example. > > 2. Start Emacs using a locale different from "C" or other English based > locales, for example "fr_FR.UTF8": > >    LANG=fr_FR.UTF8 emacs -Q > > 3. Then call `project-find-regexp' in the the Git repository identified >   in step 1, and search for the word "copyright"; There's no results but >   the following error message: > >   xref-matches-in-files: Search failed with status 0: grep: content/ > images/planche_1.png : fichiers binaires correspondent > > If Emacs is started with "C" locale, then there are results! Thanks for the detailed report. > The problem comes from `xref-matches-in-files', precisely this block > where `grep' output has been hardcoded even if depending on the locale: > >   (when (and (/= (point-min) (point-max)) >                    (not (looking-at grep-re)) >                    ;; TODO: Show these matches as well somehow? >                    ;; Matching both Grep's and Ripgrep 13's messages. >                    (not (looking-at ".*[bB]inary file.* matches"))) >           (user-error "Search failed with status %d: %s" status >                       (buffer-substring (point-min) (line-end-position)))) > > As quick fix one cas use: > > (map-do (lambda (key val) >  (map-put xref-search-program-alist >   key (concat "LANG=C " val))) > xref-search-program-alist) Overriding the language seems indeed the way to go here. About using LANG specifically, any chance that it might interfere with the system's configured encoding, e.g. UTF-8 vs other? In your example, does searching for accented characters work as well? IIUC we can try LC_MESSAGES as the more specialized var. Does LC_MESSAGES=en work as well?