Subject: bug#55247: closed (Re: bug#55247: [29.0.50; TRAMP] Tramp Always Thinks Buffer Changed On Disk After Edit -> Save)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 06 May 2022 11:23:01 +0000

Your bug report

#55247: [29.0.50; TRAMP] Tramp Always Thinks Buffer Changed On Disk After Edit -> Save

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
55247: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55247
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#55247: [29.0.50; TRAMP] Tramp Always Thinks Buffer Changed On Disk After Edit -> Save
From: Michael Albinus <[email-masked]>
To: Manuel Giraud <[email-masked]>
Cc: [email-masked], Lars Ingebrigtsen <[email-masked]>, Jacob Faibussowitsch <[email-masked]>
Date: Fri, 06 May 2022 13:22:50 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 29.1

Manuel Giraud <[email-masked]> writes:

Hi Manuel,

> Sorry my bad. It works after a "make bootstrap". Thanks Michael!

Thanks for confirmation, I'm closing the bug.

> But how come emacs does not install the new .elc for a freshly patch .el
> with a classical "make && make install"?

I've patched tramp-skeleton-write-region, a macro in tramp.el. This file
has been recompiled.

However, in your use case the function tramp-sh-handle-write-region of
file tramp-sh.el is called, which uses that macro. Since tramp-sh.el
hasn't been recompiled, the old (erroneous) macro definition was still
used.

Best regards, Michael.

Subject: [29.0.50; TRAMP] Tramp Always Thinks Buffer Changed On Disk After Edit -> Save
From: Jacob Faibussowitsch <[email-masked]>
To: [email-masked]
Date: Tue, 3 May 2022 11:55:40 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

Note: anything between angled brackets “< >” is not literal, but rather a description.

Problem:

Any time I edit and save a remote buffer over tramp, I get

```
<file name> changed on disk; really edit the buffer? (y, n, r or C-h)
```

The next time I try to edit the file. I know for a fact that the file has not changed, as I have compared copies of the file:

1. 
```
$ cp remote/file.c remote/file_tmp.c
```
2. Make a change in `file.c`, save, revert it, and save again (prompted each time with “buffer changed on disk”).
3. 
```
$ diff file.c file_tmp.c
```

And they are identical.

Reproduce:

1. 
```
$ emacs -Q /ssh:<ssh alias>:path/to/file
```
2. Change something
3. C-x C-s
4. Try to change something else
5.
```
<file name> changed on disk; really edit the buffer? (y, n, r or C-h)
```

Best regards,

Jacob Faibussowitsch
(Jacob Fai - booss - oh - vitch)