From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Tramp and conversion of \r\n into \n Date: Thu, 05 Aug 2021 09:16:22 +0300 Message-ID: <83sfzoju15.fsf@gnu.org> References: <193e76e900f64f01a39893b12cf7c4ff@3ds.com> <871rfw900w.fsf@gmx.de> <87sg8c7i5w.fsf@gmx.de> <4f2b42e36d924f83883e120e601d40f7@3ds.com> <87tuslzrw1.fsf@gmx.de> <7135a39a200c4f8397c8bddb9da8d3fc@3ds.com> <8736014u95.fsf@gmx.de> <3474731f-eada-8185-1a21-f337fd55b38b@thomasross.io> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31444"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, michael.albinus@gmx.de, yyoncho@gmail.com, Martin.APEL@3ds.com To: Thomas Ross Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 05 08:17:26 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mBWh3-0007xL-Jx for ged-emacs-devel@m.gmane-mx.org; Thu, 05 Aug 2021 08:17:25 +0200 Original-Received: from localhost ([::1]:41872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBWh2-0002CR-5v for ged-emacs-devel@m.gmane-mx.org; Thu, 05 Aug 2021 02:17:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBWg8-000187-Ht for emacs-devel@gnu.org; Thu, 05 Aug 2021 02:16:28 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:56288) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBWg6-0008DD-TS; Thu, 05 Aug 2021 02:16:26 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4897 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBWg6-0004a2-G0; Thu, 05 Aug 2021 02:16:26 -0400 In-Reply-To: <3474731f-eada-8185-1a21-f337fd55b38b@thomasross.io> (message from Thomas Ross on Wed, 4 Aug 2021 21:46:02 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:272072 Archived-At: > From: Thomas Ross > Date: Wed, 4 Aug 2021 21:46:02 -0400 > Cc: APEL Martin , > "emacs-devel@gnu.org" > > > (make-process :name "hexdump" :command '("hexdump" "-v" "-e" "/1 \"%02X\n\"") :buffer "hexdump") > > (process-send-string "hexdump" "abc\r\n") > > on my system (Linux, Emacs 27.1): > > > 61 > > 62 > > 63 > > 0A > > 0A > > Note that there's 61 ("a"), 62 ("b"), 62 ("c"), and two 0As (LF). The > first 0A should really be a 0D (CR). I believe this conversion is likely > done by the call to encode_coding_object inside send_process > (process.c), but I might be wrong. I would need to sit down and step > through the code with gdb to confirm. Is this in "emacs -Q"? If so, such conversion should not happen, on any OS. Emacs converts CR on input, not on output, and process-send-string does the latter. > > Content-Length: 2134 > > > > {<...JSON here...>} > > Emacs replaces the CRs with LFs, which confuses clangd: Again, this conversion can only happen on input, but you seem to be talking about output. It is possible that some Tramp magic causes this bytestream to be input into Emacs at some point, as some temporary measure; in that case, you should look for the problem at that point, where Emacs reads these bytes, and disable decoding there.