Subject: Re: bug#70329: 29.3; etags-regen-mode fails in projects that have spaces in their root path elements
From: Dmitry Gutov <[email-masked]>
To: Eli Zaretskii <[email-masked]>, Magiel Bruntink <[email-masked]>
Cc: [email-masked]
Date: Thu, 11 Apr 2024 20:10:55 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Eli and Magiel,

On 11/04/2024 10:29, Eli Zaretskii wrote:
>> Date: Wed, 10 Apr 2024 21:32:57 +0200
>> From:  Magiel Bruntink via "Bug reports for GNU Emacs,
>>   the Swiss army knife of text editors"<[email-masked]>
>>
>> I wanted to try to the new etags-regen-mode and loaded its lisp manually.
>>
>> There is an issue with how the new mode deals with paths containing spaces,
>> however.
>>
>> Running the etags--xref-backend through eg. xref-find-definitions
>> within a file in a project that has spaces in its path elements,
>> eg. "c:/temp/test project/test.c" will cause an error.
>>
>> Messages seen are:
>> Generating new tags table...
>> (Shell command failed with code 1 and some error output)
>> visit-tags-table-buffer: File c:/temp/test project/TAGS does not exist
>>
>> Error message in the etags-regen-tags-errors* buffer:
>> c:/temp/test: Permission denied
> Stab in the dark: does the patch below fix the problem?
> 
> If not, please repeat your recipe with debug-on-error non-nil, and
> post the backtrace here.
> 
> diff --git a/lisp/progmodes/etags-regen.el b/lisp/progmodes/etags-regen.el
> index 6cd78d3..02d666c 100644
> --- a/lisp/progmodes/etags-regen.el
> +++ b/lisp/progmodes/etags-regen.el
> @@ -279,7 +279,7 @@ etags-regen--tags-generate
>                                        " ")
>                             ;; ctags's etags requires '-L' for stdin input.
>                             (if ctags-p "-L" "")
> -                          tags-file)))
> +                          (shell-quote-argument tags-file))))
>       (with-temp-buffer
>         (mapc (lambda (f)
>                 (insert f "\n"))

Thank you, looks good, pushed to master.