all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Madhu <enometh@meer.net>
To: eliz@gnu.org
Cc: arstoffel@gmail.com, simenheg@runbox.com, emacs-devel@gnu.org
Subject: Re: ielm automatic saving of history -- bug 67000
Date: Tue, 15 Oct 2024 23:00:11 +0530 (IST)	[thread overview]
Message-ID: <20241015.230011.595343732756221115.enometh@meer.net> (raw)
In-Reply-To: <864j5dsgot.fsf@gnu.org>

*  Eli Zaretskii <eliz@gnu.org> <864j5dsgot.fsf@gnu.org>
Wrote on Tue, 15 Oct 2024 15:18:10 +0300
>> Date: Tue, 15 Oct 2024 10:16:33 +0530 (IST)
>> From: Madhu <enometh@meer.net>
[re:  savehist for ielm history]

>> 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.


The point I wanted to make was that savehist-save binds
coding-system-for-write (to 'utf-8-unix) and this seems to work
without throwing a "coding system error".

my ~/.ielm-history (which gets read into comint-input-ring) has this
line (but with raw characters)

```
(rfc2047-encode-string "foo \303\200 bar")
```

(funcall ielm--exit) in the ielm buffer causes the coding system warning:

"These default coding systems were tried to encode the
following[...].. utf-8-unix"

However

```
(let ((coding-system-for-write 'utf-8-unix)) (funcall ielm--exit))
```

saves the history according to the code in ielm--exit without the
coding system error.

but coding-system-for-write is still 'utf-8-unix and not
'utf-8-emacs-unix so I think I still need an explanation, please.

(Also I think I forgot to mention the code in ielm-mode presently sets
kill-buffer-hook to a function rather than adding the function to the
hook variable)



  reply	other threads:[~2024-10-15 17:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-13  4:17 ielm automatic saving of history -- bug 67000 Madhu
2024-10-13  6:06 ` Eli Zaretskii
2024-10-13  9:49   ` Madhu
2024-10-14  6:23   ` Augusto Stoffel
2024-10-14 14:05     ` Eli Zaretskii
2024-10-15  4:46       ` Madhu
2024-10-15 12:18         ` Eli Zaretskii
2024-10-15 17:30           ` Madhu [this message]
2024-10-15 18:23             ` Eli Zaretskii
2024-10-16  4:25               ` Madhu
2024-10-16  6:04                 ` Eli Zaretskii
2024-10-16  9:03                   ` Madhu
2024-10-16 18:36                     ` Eli Zaretskii
2024-10-16 17:02   ` Simen Heggestøyl
2024-10-17  2:04     ` Madhu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241015.230011.595343732756221115.enometh@meer.net \
    --to=enometh@meer.net \
    --cc=arstoffel@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=simenheg@runbox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.