On 2025-02-16 01:31, Eli Zaretskii wrote: >> Date: Sun, 16 Feb 2025 00:26:02 -0800 >> From: Paul Eggert >> How about if we compile a little .exe file that merely execs etags with >> the --ctags option? That would be the equivalent of the script. > > That'd be fine, thanks. But we will need to invoke etags via > w32_execvp because of the problems explained in emacsclient.c where > that function is defined (which will need to be moved to ntlib.c). I took at shot at doing something along those lines; see revised patch (attached). Since I don't use MS-Windows or compile or test anything on that platform, I quailed a bit at doing nontrivial surgery on ntlib.c. Also, emacsclient.c's w32_execvp has some alternate-editor code specific to emacsclient, and it uses alloca in a potentially-unsafe way, and it mishandles strings longer than INT_MAX bytes, and it appears to mishandle '\t', '\\' and '"' if Microsoft's documentation is to be believed. So the attached patch defines its own w32_execvp_arg_repr function that attempts to be standalone and free of these issues. If needed later, someone with MS-Windows expertise could merge this into ntlib.c and combine it with what's in emacsclient.c.