Subject: Re: bug#74352: 29.4; emerge-files with tramp + local file fails

From: Jörg Sommer <[email-masked]>
Date: Thu, 14 Nov 2024 18:27:39 +0100

Eli Zaretskii schrieb am Do 14. Nov, 09:05 (+0200):
> > Date: Wed, 13 Nov 2024 20:11:10 +0100
> > From: Jörg Sommer <[email-masked]>
> > 
> > when running `emerge-files` with `/ssh:remote:file` and `~/local-file` I get
> > the buffer `*emerge-diff-errors*` with:
> > 
> > ```
> > diff: /tmp/tramp.wlcRNL: No such file or directory
> > diff: /home/joerg/local-file: No such file or directory
> > ```
> > 
> > This change solves the problem:
> > 
> > ```diff
> > diff --git lisp/vc/emerge.el lisp/vc/emerge.el
> > index ca48f2f3c7b..562041e4232 100644
> > --- lisp/vc/emerge.el
> > +++ lisp/vc/emerge.el
> > @@ -581,6 +581,7 @@ emerge-make-diff-list
> >    (setq emerge-diff-buffer (get-buffer-create "*emerge-diff*"))
> >    (with-current-buffer
> >        emerge-diff-buffer
> > +    (setq default-directory (file-name-directory file-A))
> 
> Thanks, but why file-A?  Isn't the problem symmetric wrt the two
> files?  Or what am I missing?

In *emerge-setup* above is this code:

```
	 ;; create the merge buffer from buffer A, so it inherits buffer A's
	 ;; default directory, etc.
	 (merge-buffer (with-current-buffer
			   buffer-A
			 (get-buffer-create merge-buffer-name))))
```

But I think it doesn't matter if A or B. The problem is that
emerge-diff-buffer has the remote directory and shell command tries to
execute the command on the remote side even through file-A and file-B were
copied to local side in *emerge-files-internal*.

Kind regards, Jörg

-- 
Die am Lautesten reden, haben stets am wenigsten zu sagen.