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: ielm automatic saving of history -- bug 67000 Date: Tue, 15 Oct 2024 15:18:10 +0300 Message-ID: <864j5dsgot.fsf@gnu.org> References: <86v7xwtu3i.fsf@gnu.org> <878qurkxte.fsf@gmail.com> <86r08isrtg.fsf@gnu.org> <20241015.101633.2219948655969771381.enometh@meer.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24231"; mail-complaints-to="usenet@ciao.gmane.io" Cc: arstoffel@gmail.com, simenheg@runbox.com, emacs-devel@gnu.org To: Madhu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 15 14:18: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 1t0gVp-00061P-1M for ged-emacs-devel@m.gmane-mx.org; Tue, 15 Oct 2024 14:18:53 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0gVG-0003Dl-EA; Tue, 15 Oct 2024 08:18:18 -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 1t0gVC-0003DA-Uk for emacs-devel@gnu.org; Tue, 15 Oct 2024 08:18:15 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t0gVB-0001xG-IW; Tue, 15 Oct 2024 08:18:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=A4WeUSEmoIrORT4eklfhXvXIWAgptFEmhG8RpMAC+Us=; b=hlNFI58kutZE6HSzjHPY IC+X6u0QQV5yPc+zqVwGJWQ7A24qje7rGKu6I4KaMNc9cfPCtFn718ehA7eYF0OzI8Vxtb9LJKEHi 69VfiqfFu/8tH4KZdiX1gXcIXVwZh2TQxscprYV2CDp+mNmuk0eQOtjbzuhGk26JtRRq406kEWZzE OSdbZA/yabv3mELPhSHcSRxsYsCuuA96vIrxy7tu0H0Hr2GX9Vb+Of9eO2gEK8CFB6giDI++ExoMN k/Krt4njfTmY/HO5kg194A9jdkUZwkNSY5DZuxJBQmRVPJp6b+jghBk9m2iiaJqoz+Z4bgLpWptXv dJkUmKi0ygcGRQ==; In-Reply-To: <20241015.101633.2219948655969771381.enometh@meer.net> (message from Madhu on Tue, 15 Oct 2024 10:16:33 +0530 (IST)) 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:324594 Archived-At: > Date: Tue, 15 Oct 2024 10:16:33 +0530 (IST) > Cc: arstoffel@gmail.com, simenheg@runbox.com, emacs-devel@gnu.org > From: Madhu > > > * Eli Zaretskii <86r08isrtg.fsf@gnu.org> > Wrote on Mon, 14 Oct 2024 17:05:31 +0300 > >> From: Augusto Stoffel > >> Cc: Madhu , Simen Heggestøyl > >> , > >> emacs-devel@gnu.org > >> Date: Mon, 14 Oct 2024 08:23:09 +0200 > >> I have a different suggestion. I think IELM should use savehist-mode to > >> preserve its history. > >> > >> When loading ielm.el: > >> > >> (cl-pushnew 'ielm-history savehist-minibuffer-history-variables) > >> > >> When starting an IELM buffer: > >> > >> (setq comint-input-ring (make-ring comint-input-ring-size)) > >> (dolist (cmd (take comint-input-ring-size ielm-history)) > >> (ring-insert-at-beginning comint-input-ring cmd)) > >> > >> After each evaluation: > >> > >> (add-to-history 'ielm-history code comint-input-ring-size) > > > > This addresses only some of the issues brought up by Madhu. For > > example, the main bug, the one with encoding the saved history, is not > > addressed, AFAIU. > > I think that part is covered. if you see the top of ~/.emacs.d/history > the coding system is specified, the savehist-coding-system mechanism > takes care of this to you. But I haven't tried this idea out yet (to > see the interactions with comint). The problem, AFAIU, is not the specification of the encoding when the file is written, the problem is to select the right encoding to begin with. utf-8-emacs-unix is how characters are represented in Emacs internally, so it by definition can encode any character in the history; this is not true for any other encoding. I believe this issue was what prevented you from existing Emacs, the issue you described in your original post. Apologies if I misunderstood.