From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Madhu Newsgroups: gmane.emacs.devel Subject: Re: ielm automatic saving of history -- bug 67000 Date: Wed, 16 Oct 2024 14:33:59 +0530 (IST) Message-ID: <20241016.143359.2067752235306528118.enometh@meer.net> References: <86jze9ql81.fsf@gnu.org> <20241016.095542.548863482055227550.enometh@meer.net> <865xpsr3b0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24437"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: eliz@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Oct 16 11:04:54 2024 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 1t0zxd-0006GE-Cs for ged-emacs-devel@m.gmane-mx.org; Wed, 16 Oct 2024 11:04:53 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0zwo-0002Jl-Hq; Wed, 16 Oct 2024 05:04:02 -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 1t0zwm-0002JM-Ig for emacs-devel@gnu.org; Wed, 16 Oct 2024 05:04:00 -0400 Original-Received: from smtp7.ctinetworks.com ([205.166.61.237]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t0zwl-0007zz-6e; Wed, 16 Oct 2024 05:04:00 -0400 X-ctinetworks-Watermark: 1729933433.81122@JTjVE//W9GAKZKQpt0r4Rw X-ctinetworks-Envelope-From: enometh@meer.net X-ctinetworks-VirusCheck: Found to be clean X-ctinetworks-Message-ID: C43FDE9B6.A6C4C Original-Received: from localhost (unknown [117.254.36.122]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: enometh@meer.net) by smtp7.ctinetworks.com (Postfix) with ESMTPSA id C43FDE9B6; Wed, 16 Oct 2024 05:03:51 -0400 (EDT) In-Reply-To: <865xpsr3b0.fsf@gnu.org> X-Mailer: Mew version 6.9 on Emacs 31.0.50 Received-SPF: pass client-ip=205.166.61.237; envelope-from=enometh@meer.net; helo=smtp7.ctinetworks.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:324608 Archived-At: * Eli Zaretskii <865xpsr3b0.fsf@gnu.org> Wrote on Wed, 16 Oct 2024 09:04:51 +0300 >> Apparently using utf-8-unix >> is sufficient to encode the contents of the buffer beings saved >> without any loss of data. > > It is not. It can only safely encode characters that are inside the > Unicode codepoint space, and raw bytes are outside that range. > >> The file written is identical to the file which was read. > > I don't understand what you mean. AFAIU, IELM history records what > you typed, so what file was read here? the ielm-history file from which the comint-input-ring is initalized If I copy my ~/.ielm-history.el to /dev/shm/2.txt.binary and run ``` (let ((comint-input-ring-file-name "/dev/shm/2.txt.binary")) (comint-read-input-ring)) ``` it initializes the input-ring from the history. emacs apparently reads this in raw-text-unix. ``` (let ((comint-input-ring-file-name "/dev/shm/2.txt.out")) (comint-write-output-ring)) ``` Here I am prompted with the coding system warning . If i go ahead and qchoose utf-8-unix, it goes ahead and saves it. I can compare 2.txt.binary and 2.txt.out to see that utf-8-unix has not resulted in any data loss. Hence all the claims in my previous message.