From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: miranda kastemaa Newsgroups: gmane.emacs.bugs 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) Message-ID: <24e2cd85-0f23-40a9-838a-3eb7e2c1877f@pulusound.fi> References: <87y1kf2w3k.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3408"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64164@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 20 07:23:05 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qBTpY-0000Wn-QD for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Jun 2023 07:23:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qBTmh-00078m-DQ; Tue, 20 Jun 2023 01:20:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qBTmd-00074N-9w for bug-gnu-emacs@gnu.org; Tue, 20 Jun 2023 01:20:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qBTmd-0004mK-02 for bug-gnu-emacs@gnu.org; Tue, 20 Jun 2023 01:20:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qBTmc-0000z6-Rn for bug-gnu-emacs@gnu.org; Tue, 20 Jun 2023 01:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: miranda kastemaa Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Jun 2023 05:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64164 X-GNU-PR-Package: emacs Original-Received: via spool by 64164-submit@debbugs.gnu.org id=B64164.16872383943737 (code B ref 64164); Tue, 20 Jun 2023 05:20:02 +0000 Original-Received: (at 64164) by debbugs.gnu.org; 20 Jun 2023 05:19:54 +0000 Original-Received: from localhost ([127.0.0.1]:57747 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBTmT-0000y7-2n for submit@debbugs.gnu.org; Tue, 20 Jun 2023 01:19:53 -0400 Original-Received: from fly.ash.relay.mailchannels.net ([23.83.222.61]:31594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBNNg-0006HK-A0 for 64164@debbugs.gnu.org; Mon, 19 Jun 2023 18:29:54 -0400 X-Sender-Id: dreamhost|x-authsender|miranda@pulusound.fi Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 1DCAF5C14B1; Mon, 19 Jun 2023 22:29:46 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a216.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 4995D5C1494; Mon, 19 Jun 2023 22:29:43 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1687213783; a=rsa-sha256; cv=none; b=cWQZi8CzmgAKGBpDiH8GNm8J7J+3y5tkRNxUFDNYFSk5OWSxYzDltmgr7E8IPaUFYoU9wv XAZI0o/bJTrjGn/t6//kzFv/aAXpC2i+xIKIKBWWmGLWmedJ7y4/Bz2ceMIPJ9G8V19d8T 7DKUtbezkKT8muu6JVJomkxuSmKe8ar56lQMMI75wnfdNn2b7fne30wKvNbLymiKTX17DM dZkIp1VywDPcdSUSgZC0+hvOHsFOEK0nitBlZ2rY+vY5goR6OboOdpd36G6sAJMvZ4naqs tpy95KkrqrcMzt+jI2r1y5VH6+DdZYD597yF0dWCJBFxixOKAsduJLHKwmFo4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1687213783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=YJXkEh2mRgRhsoDAcOa8vuF7uBBN599ULtCPuA1wNCw=; b=QjjJH+PrUtQQiS0F0qWyz4LeslCXkLMnLt1Y51ez4E+EN2nFKjSlGrc4KcMJH6o/U15zNz 2zv5OSJTfplQSvQ5Hr0SPL5MQ3ZEeRkjeI46CgUUS1DTCzk5Dahscrc2VP0wzi3Zb6+3eB hSIyEcLkR3V5W3um68gBodRqpbG6THCcknCtidGXul+J8iFVJnmivLXp3RX9gyCRRu8ufw zSMU57XBxLoW7PMClSpbOkUB1miGa0zaZhrCsLWsVDaxKvWP0vmhfGWy09nNjkA7cTlYQL Wzs9uY0Dud2NwI0GEQXSFbtchBK+yH44TVw9gzIw3ll8VcGu9UnLNb4OsO/Prw== ARC-Authentication-Results: i=1; rspamd-85899d6fcc-rwzts; auth=pass smtp.auth=dreamhost smtp.mailfrom=miranda@pulusound.fi X-Sender-Id: dreamhost|x-authsender|miranda@pulusound.fi X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|miranda@pulusound.fi X-MailChannels-Auth-Id: dreamhost X-Oafish-Attack: 3e40d6831f7af05b_1687213785656_4000809406 X-MC-Loop-Signature: 1687213785656:1812518061 X-MC-Ingress-Time: 1687213785656 Original-Received: from pdx1-sub0-mail-a216.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.123.193.136 (trex/6.9.1); Mon, 19 Jun 2023 22:29:45 +0000 Original-Received: from dummy.faircode.eu (89-27-5-155.bb.dnainternet.fi [89.27.5.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: miranda@pulusound.fi) by pdx1-sub0-mail-a216.dreamhost.com (Postfix) with ESMTPSA id 4QlPZt3q7cz2D; Mon, 19 Jun 2023 15:29:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pulusound.fi; s=dreamhost; t=1687213783; bh=YJXkEh2mRgRhsoDAcOa8vuF7uBBN599ULtCPuA1wNCw=; h=Date:From:To:Cc:Subject:Content-Type:Content-Transfer-Encoding; b=pK3pQjD4YP525oFe0XJaBxIYiBQm5Fin0uXjtXB9eAhesQ4uu6K6WldFK4N7YzGqM 9F9OEi1eKFN4wsqMejrKeKdMJXbpme+1npPlXrmaKTNj3fUdsF/KiGb+0jVg5PNkRe m5POH0+96VB0H6pNbwmvpC1Pn7tbWjaNFCBREeyMu+fb1NLlzT0yxsC4u0l0LAxHNZ dbv5wSF/fv5WUdIdDKVjTeS/HPxjNkeh2SFbnY1fbI/JuzYDsM/KGnrs3mnELbkRNv 6sUuZNJuQZfssCglNFOt6wgdb7kZjkBJBNrhGaYmNLxOPcHPHqXF0NVDW/LYPYI9ip 25HpuWYj8vjvw== In-Reply-To: <87y1kf2w3k.fsf@gmx.de> X-Correlation-ID: <24e2cd85-0f23-40a9-838a-3eb7e2c1877f@pulusound.fi> X-Mailman-Approved-At: Tue, 20 Jun 2023 01:19:50 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:263734 Archived-At: 19 Jun 2023 20.36.06 Michael Albinus : > 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