unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dmitry@gutov.dev>
To: Juri Linkov <juri@linkov.net>
Cc: 75379@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>,
	Matthias Meulien <orontee@gmail.com>
Subject: bug#75379: 30.0.93; project-find-regexp expects "C" or "en" locale
Date: Tue, 7 Jan 2025 21:38:39 +0200	[thread overview]
Message-ID: <01eae803-0869-4bd3-a089-77c5050b870e@gutov.dev> (raw)
In-Reply-To: <87y0zmjzfn.fsf@mail.linkov.net>

On 07/01/2025 19:39, Juri Linkov wrote:
> 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.

>    (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





  reply	other threads:[~2025-01-07 19:38 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-05 10:35 bug#75379: 30.0.93; project-find-regexp expects "C" or "en" locale Matthias Meulien
2025-01-05 18:03 ` Dmitry Gutov
2025-01-05 18:46   ` Eli Zaretskii
2025-01-05 19:35     ` Dmitry Gutov
2025-01-05 20:16       ` Eli Zaretskii
2025-01-07 14:17         ` Dmitry Gutov
2025-01-07 14:23           ` Eli Zaretskii
2025-01-07 14:26             ` Dmitry Gutov
2025-01-07 14:50               ` Eli Zaretskii
2025-01-05 21:22     ` Matthias Meulien
2025-01-05 21:29       ` Matthias Meulien
2025-01-06 13:03         ` Eli Zaretskii
2025-01-06  1:55       ` Dmitry Gutov
2025-01-06 12:36         ` Matthias Meulien
2025-01-06 12:42           ` Matthias Meulien
2025-01-06 14:13             ` Dmitry Gutov
2025-01-06 14:11           ` Dmitry Gutov
2025-01-07  5:42             ` Matthias Meulien
2025-01-07 12:45               ` Eli Zaretskii
2025-01-07 14:24               ` Dmitry Gutov
2025-01-06 17:36         ` Juri Linkov
2025-01-06 20:33           ` Dmitry Gutov
2025-01-07 17:39             ` Juri Linkov
2025-01-07 19:38               ` Dmitry Gutov [this message]
2025-01-08  7:48                 ` Juri Linkov
2025-01-06 13:02       ` Eli Zaretskii
2025-01-06 14:13         ` Dmitry Gutov
2025-01-05 21:10   ` Matthias Meulien
2025-01-06  1:32     ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=01eae803-0869-4bd3-a089-77c5050b870e@gutov.dev \
    --to=dmitry@gutov.dev \
    --cc=75379@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=juri@linkov.net \
    --cc=orontee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).