From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#75379: 30.0.93; project-find-regexp expects "C" or "en" locale Date: Wed, 08 Jan 2025 09:48:03 +0200 Organization: LINKOV.NET Message-ID: <87a5c1lpak.fsf@mail.linkov.net> References: <86jzb96qul.fsf@gnu.org> <871pxg3xu5.fsf@mail.linkov.net> <87y0zmjzfn.fsf@mail.linkov.net> <01eae803-0869-4bd3-a089-77c5050b870e@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14190"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) Cc: 75379@debbugs.gnu.org, Eli Zaretskii , Matthias Meulien To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 08 08:49:18 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 1tVQoY-0003Yp-Ad for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 08 Jan 2025 08:49:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tVQoK-0005H0-NS; Wed, 08 Jan 2025 02:49: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 1tVQoI-0005Gl-Vj for bug-gnu-emacs@gnu.org; Wed, 08 Jan 2025 02:49: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 1tVQoI-0001uu-Ix for bug-gnu-emacs@gnu.org; Wed, 08 Jan 2025 02:49:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=gT/5zaUczMkR45lU+DxqXVOthQArqB/PIjfuKzE2hxU=; b=mmNJhjpSC3p/0IQS6Z4bF7GtpWZpv2H1BU337Urb44WARsJwsQRBNaq3OUwXFZH144STwveDi9HMVdOOfgRsgj7ift0rpNK7CRa86oLTQzSKqFdGSpSCKMI6NJd0t9QFimvyw028szK8L8olZD4dBg/M4U+aG91yhc2htJu9k1QCXmtqsuq9zIHW0sVOm4KHGoCec66iyw7oNpujwjugoNCQglqxdgXW6P/b9YBTZGaJRQL6xcFuoicjZgtF/Z+q81wAjpLlpHmMywM2lOZtioHsVFY+GCii5MdgTIm3V+Tjb4MK9ZTib3ezEwzmHN25M3ggJs5A9KCmzhKlGoUuAg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tVQoI-0003uY-DN for bug-gnu-emacs@gnu.org; Wed, 08 Jan 2025 02:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Jan 2025 07:49: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.173632252114990 (code B ref 75379); Wed, 08 Jan 2025 07:49:02 +0000 Original-Received: (at 75379) by debbugs.gnu.org; 8 Jan 2025 07:48:41 +0000 Original-Received: from localhost ([127.0.0.1]:45846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tVQnx-0003ti-4Q for submit@debbugs.gnu.org; Wed, 08 Jan 2025 02:48:41 -0500 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:43407) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tVQnv-0003tS-PG for 75379@debbugs.gnu.org; Wed, 08 Jan 2025 02:48:40 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id B58A61BF208; Wed, 8 Jan 2025 07:48:30 +0000 (UTC) In-Reply-To: <01eae803-0869-4bd3-a089-77c5050b870e@gutov.dev> (Dmitry Gutov's message of "Tue, 7 Jan 2025 21:38:39 +0200") X-GND-Sasl: juri@linkov.net 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:298763 Archived-At: >> This is a known problem. Since the exit status is unreliable, >> this is why 'grep-exit-message' has to use such a trick that >> no output (i.e. '(not (buffer-modified-p))') indicates no matches: > > What about errors, though? Missing programs, unsupported flags, etc. > > Maybe Grep gets by without that due to the explicit probing step in > grep-compute-defaults, but I'm not sure it's worth building up its > counterpart in xref.el. I see no problem with displaying all error messages as is in the xref buffer. >> (if (eq status 'exit) >> ;; This relies on the fact that `compilation-start' >> ;; sets buffer-modified to nil before running the command, >> ;; so the buffer is still unmodified if there is no output. >> (cond ((and (zerop code) (buffer-modified-p)) >> (if (> grep-num-matches-found 0) >> (cons (format (ngettext "finished with %d match found\n" >> "finished with %d matches found\n" >> grep-num-matches-found) >> grep-num-matches-found) >> "matched") >> '("finished with matches found\n" . "matched"))) >> ((not (buffer-modified-p)) >> '("finished with no matches found\n" . "no match")) >> >>> Also, when we know the format of come messages we can parse the file name >>> out of them and create a button in the output buffer. Simply copying any >>> unhandled messages removes that possibility. >> Can we detect a file name in any message, e.g. by matching a path separator? > > We use 'grep --null', so the file name separator is a zero byte. > > We could scan the buffer to see whether there are any zero bytes (and if > none - that would mean no matches), but the "binary file matches" message > doesn't use that separator ¯\_(ツ)_/¯ > > Not does it start with a file name, so we have to have a separate > understanding about that message's structure anyway: > > grep: test/lisp/gnus/mml-sec-resources/pubring.kbx: binary file matches > grep: test/lisp/gnus/mml-sec-resources/secring.gpg: binary file matches > grep: test/lisp/gnus/mml-sec-resources/trustdb.gpg: binary file matches In the worst case there will be no button, and I see no problem with this too.