unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: miranda kastemaa <miranda@pulusound.fi>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: 64164@debbugs.gnu.org
Subject: bug#64164: 29.0.92; buffer-file-coding-system changes unexpectedly after saving
Date: Tue, 20 Jun 2023 01:29:37 +0300 (GMT+03:00)	[thread overview]
Message-ID: <24e2cd85-0f23-40a9-838a-3eb7e2c1877f@pulusound.fi> (raw)
In-Reply-To: <87y1kf2w3k.fsf@gmx.de>

19 Jun 2023 20.36.06 Michael Albinus <michael.albinus@gmx.de>:

> miranda@pulusound.fi writes:
>
> Hi Miranda,
>
>> i am trying to edit remote files on another macOS system, using
>> Tramp's ssh: method. i am running `emacs -Q`.
>>
>> when i open any file on this remote system, the initial value of
>> `buffer-file-coding-system` is what i would expect,
>> i.e. undecided-unix or utf-8-unix, depending on whether the file
>> contains non-ASCII characters.
>>
>> however, after saving the file, `buffer-file-coding-system` suddenly
>> changes to utf-8-hfs-mac. any subsequent save then changes all the
>> line endings to CR, which i have not actively used since 2001 or
>> so... :-)
>
> 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.

> We could suppress this. However, Tramp needs an indication when to
> suppress. Do you have somthing like this?

without knowing anything about how the current logic came to be, it seems to me that -mac should never be the default on Darwin-based macOS, as the CR file endings fell out of use with the discontinuation of the "classic" Mac OS that predated Darwin.

it is perhaps worth reiterating that the files i have been editing already contain LF file endings exclusively (and thus far Emacs has always created these by default, both locally and over Tramp), so the sudden unprompted change to CR is quite disruptive. even if CR were a reasonable default, i believe Emacs is meant to respect the existing coding system of files, so this definitely seems like a bug.

>> Emacs 28.2 works as expected.
>
> This surprises me. I don't remember we have changed something here in
> Tramp (but I might be wrong).
>
>> best,
>> miranda
> > Best regards, Michael.

best,
miranda





  reply	other threads:[~2023-06-19 22:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-19  9:57 bug#64164: 29.0.92; buffer-file-coding-system changes unexpectedly after saving miranda
2023-06-19 16:55 ` Eli Zaretskii
2023-06-19 20:46   ` miranda kastemaa
2023-06-19 17:35 ` Michael Albinus
2023-06-19 22:29   ` miranda kastemaa [this message]
2023-06-20  9:22     ` miranda
2023-08-03 15:04       ` Michael Albinus
2023-08-28 11:03         ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24e2cd85-0f23-40a9-838a-3eb7e2c1877f@pulusound.fi \
    --to=miranda@pulusound.fi \
    --cc=64164@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).