xref-matches-in-directory: Don't error on "Binary file ... matches"

* lisp/progmodes/xref.el (xref-matches-in-directory):
Consider the "Binary file ... matches" message (bug#80246).
This commit is contained in:
Dmitry Gutov 2026-01-28 21:55:40 +02:00
parent fbe4d649c3
commit d44b855b0c

View file

@ -1900,7 +1900,9 @@ If DELIMITED is `symbol', only select matches that span full symbols."
;; exit with non-zero. "No matches" and "Grep program not found"
;; are all the same to it.
(when (and (/= (point-min) (point-max))
(not (looking-at grep-re)))
(not (looking-at grep-re))
;; See also this check in `xref-matches-in-files'.
(not (looking-at ".*[bB]inary file.* matches")))
(user-error "Search failed with status %d: %s" status (buffer-string)))
(while (re-search-forward grep-re nil t)
(push (list (string-to-number (match-string line-group))