emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ielm automatic saving of history -- bug 67000


From: Eli Zaretskii
Subject: Re: ielm automatic saving of history -- bug 67000
Date: Tue, 15 Oct 2024 15:18:10 +0300

> Date: Tue, 15 Oct 2024 10:16:33 +0530 (IST)
> Cc: arstoffel@gmail.com, simenheg@runbox.com, emacs-devel@gnu.org
> From: Madhu <enometh@meer.net>
> 
> 
> *  Eli Zaretskii <eliz@gnu.org> <86r08isrtg.fsf@gnu.org>
> Wrote on Mon, 14 Oct 2024 17:05:31 +0300
> >> From: Augusto Stoffel <arstoffel@gmail.com>
> >> Cc: Madhu <enometh@meer.net>,  Simen Heggestøyl
> >>  <simenheg@runbox.com>,
> >>   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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]