Subject: Re: bug#79358: etags-regen-mode doesn't work for remote projects

From: Michael Albinus <[email-masked]>
Date: Wed, 03 Sep 2025 15:59:40 +0200

Liu Hui <[email-masked]> writes:

Hi,

As said I don't use etags.el (and I haven't installed a tags program),
but comment from cursory reading:

> -                          (shell-quote-argument tags-file))))
> +                          (shell-quote-argument (if remote
> +                                                    (file-local-name tags-file)
> +                                                  tags-file))))

file-local-name returns always a proper result, for both remote and
local files. So don't check with file-remote-p.

> +         (tempfile (make-temp-file "etags-regen"))
> +         (error-file (make-temp-file "etags-regen-err")))
>      (with-temp-buffer
>        (mapc (lambda (f)
> -              (insert f "\n"))
> +              (insert (if remote (file-local-name f) f) "\n"))
>              files)
> -      (shell-command-on-region (point-min) (point-max) command
> -                               nil nil etags-regen--errors-buffer-name t))
> +      (write-region nil nil tempfile))
> +    (process-file-shell-command command tempfile (list nil error-file))

tmpfile and error-file are local files, because created with
make-temp-file. Why do you call process-file-shell-command then?
call-process-shell-command would do the job.

Best regards, Michael.