Subject: Re: bug#4909: 23.1.50; in emacs -nw `read-char' should return with error when an event is entered.

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 03 Jun 2021 11:33:35 +0200

Thierry Volpiatto <[email-masked]> writes:

> However `read-key' do the right thing, but is not usable in lesser emacs
> versions.
> So i have to use this function to replace `read-key' in not emacs-cvs:
>
> ,----
> | (defun traverse-read-char-or-event (prompt)
> |   "Use `read-char' to read keyboard input, if input is not a char use `read-event' instead."
> |   (let* ((chr (condition-case nil (read-char prompt) (error nil)))
> |          (evt (unless chr (read-event))))
> |     (or chr evt)))
> `----
>
> And i lost the ability of using arrow keys in an emacs -nw because
> `read-char' and `read-event' return the wrong thing.
> However C-n and C-p work fine.

(I'm going through old bug reports that unfortunately got little response at
the time.)

I'm not sure I quite understand this bug report -- read-event/key seems
to return the values described, but the arrow keys work fine for me in
Emacs 28 with -nw (on Debian/bullseye).

So is this a problem that has gone away in the years since this was
reported, or do you still see these issues?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no