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: Tue, 15 Oct 2024 10:16:33 +0530 (IST) Message-ID: <20241015.101633.2219948655969771381.enometh@meer.net> References: <86v7xwtu3i.fsf@gnu.org> <878qurkxte.fsf@gmail.com> <86r08isrtg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17360"; mail-complaints-to="usenet@ciao.gmane.io" Cc: arstoffel@gmail.com, simenheg@runbox.com, emacs-devel@gnu.org To: eliz@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 15 06:47:43 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 1t0ZTD-0004Me-2w for ged-emacs-devel@m.gmane-mx.org; Tue, 15 Oct 2024 06:47:43 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0ZSO-0004SX-0e; Tue, 15 Oct 2024 00:46:52 -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 1t0ZSM-0004SL-CD for emacs-devel@gnu.org; Tue, 15 Oct 2024 00:46:50 -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 1t0ZSK-0008R2-W7; Tue, 15 Oct 2024 00:46:50 -0400 X-ctinetworks-Watermark: 1729831603.89638@6MlEzl9EH0EIpbmWVs4AEQ X-ctinetworks-Envelope-From: enometh@meer.net X-ctinetworks-VirusCheck: Found to be clean X-ctinetworks-Message-ID: 9D560ECB1.A6360 Original-Received: from localhost (unknown [117.254.36.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: enometh@meer.net) by smtp7.ctinetworks.com (Postfix) with ESMTPSA id 9D560ECB1; Tue, 15 Oct 2024 00:46:40 -0400 (EDT) In-Reply-To: <86r08isrtg.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:324586 Archived-At: * Eli Zaretskii <86r08isrtg.fsf@gnu.org> Wrote on Mon, 14 Oct 2024 17:05:31 +0300 >> From: Augusto Stoffel >> Cc: Madhu , Simen Heggest=F8yl >> , >> emacs-devel@gnu.org >> Date: Mon, 14 Oct 2024 08:23:09 +0200 >> I have a different suggestion. I think IELM should use savehist-mod= e 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 no= t > 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).