Subject: Re: bug#64164: 29.0.92; buffer-file-coding-system changes unexpectedly after saving

From: [email-masked]
Date: Tue, 20 Jun 2023 12:22:22 +0300

On 2023-06-20 01:29, miranda kastemaa wrote:
> 19 Jun 2023 20.36.06 Michael Albinus <[email-masked]>:
>> Well, if Tramp detects a remote macOS system, it converts the coding
>> system to `utf-8-hfs-mac', see function
>> `tramp-open-connection-setup-interactive-shell'. This heuristic works
>> for many years w/o complaints from users.
> 
> thank you for pointing me towards this function. it is late here but
> this will help me do some more digging tomorrow.

after looking at `tramp-open-connection-setup-interactive-shell` a 
little, i wonder whether the coding system here is the relevant one. if 
i understand correctly, this seems to be setting the coding system for 
the connection process, rather than the individual file buffers. on both 
29.0.92 and 28.2, the Tramp debug output here is:

> tramp-open-connection-setup-interactive-shell (5) # Setting coding 
> system to ‘utf-8-hfs’ and ‘utf-8-hfs-mac’

neither of which is a -unix coding system as (initially) reported by 
`buffer-file-coding-system`.

opening files produces more debug output, but i failed to find any more 
salient info in it (i tried searching for "coding", "utf", "-unix", 
"-mac" etc).

let me know if you have any further suggestions for debugging.

best,
miranda