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

From: Liu Hui <[email-masked]>
Date: Tue, 2 Sep 2025 12:57:06 +0800

On Mon, Sep 1, 2025 at 6:46 PM Michael Albinus <[email-masked]> wrote:
>
> Liu Hui <[email-masked]> writes:
>
> > Hi,
>
> Hi,
>
> > The recipe is as follows:
> >
> > 1. create a test project on remote server, and install universal-ctags
> >
> > 2. emacs -Q /ssh:remote:~/test_project
> >
> > 3. (setq etags-regen-program "ctags -e"), then M-x etags-regen-mode
> >
> > 4. open a project file, press M-.
> >
> > Then emacs displays the buffer *etags-regen-tags-errors*
> >
> >    ctags: cannot open tag file : No such file or directory
> >
> > and a message:
> >
> >    File /ssh:remote:~/test_project/TAGS does not exist
>
> I don't use etags, but my bet is that you need to change
> etags-regen--choose-tags-file:
>
> --8<---------------cut here---------------start------------->8---
> ...
> (file-local-name (expand-file-name etags-regen-tags-file (project-root proj)))))
> --8<---------------cut here---------------end--------------->8---

Thanks. The error is same if file-local-name is used.

I find etags-regen--tags-generate uses shell-command-on-region to run
the ctags command, but it seems shell-command-on-region doesn't call
the remote command correctly.