GNU bug report logs -
#61667
29.0.60; Failure to redisplay
Previous Next
Full log
View this message in rfc822 format
On 17/04/2023 05:27, Eli Zaretskii wrote:
>> Date: Mon, 17 Apr 2023 00:17:45 +0300
>> Cc: luangruo <at> yahoo.com, 61667 <at> debbugs.gnu.org, gregory <at> heytings.org
>> From: Dmitry Gutov <dgutov <at> yandex.ru>
>>
>> I was kind of expecting xargs to know MS-Windows' command line limits,
>> i.e. from its manual:
>>
>> The largest allowed
>> value is system-dependent, and is calculated as
>> the argument length limit for exec, less the size of your environment,
>> less 2048 bytes of headroom. ... xargs automatically adapts to tighter
>> constraints.
>
> Suggest to take this up with the developers of GNU Findutils.
I imagine they'd prefer a report from somebody using the platform, who
can follow up with details and so on.
Anyway, if the bug is there, we can of course work around it.
Does this work?
BTW, it seems like grep-compute-defaults should also insert '-s 10000'
somewhere when xargs is used. Or is it usually not used on Windows?
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index d77024136d0..10b32fa629d 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -1820,16 +1820,22 @@ xref-matches-in-directory
;; Ripgrep gets jumbled output, though, even with --line-buffered.
;; But Grep seems to be stable. Even without --line-buffered.
(defcustom xref-search-program-alist
- '((grep
- .
- ;; '-s' because 'git ls-files' can output broken symlinks.
- "xargs -0 grep <C> --null -snHE -e <R>")
- (ripgrep
- .
- ;; '!*/' is there to filter out dirs (e.g. submodules).
- "xargs -0 rg <C> --null -nH --no-heading --no-messages -g '!*/' -e
<R>"
- )
- (ugrep . "xargs -0 ugrep <C> --null -ns -e <R>"))
+ (let ((xargs-max-chars
+ (and (memq system-type '(windows-nt ms-dos))
+ "-s 10000 ")))
+ `((grep
+ .
+ ;; '-s' because 'git ls-files' can output broken symlinks.
+ ,(concat "xargs -0 " xargs-max-chars "grep <C> --null -snHE -e
<R>"))
+ (ripgrep
+ .
+ ;; '!*/' is there to filter out dirs (e.g. submodules).
+ ,(concat "xargs -0 "
+ xargs-max-chars
+ "rg <C> --null -nH --no-heading --no-messages -g '!*/'
-e <R>"))
+ (ugrep
+ .
+ ,(concat "xargs -0 " xargs-max-chars "ugrep <C> --null -ns -e
<R>"))))
"Association list mapping program identifiers to command templates.
Program identifier should be a symbol, named after the search program.
This bug report was last modified 1 year and 63 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.