GNU bug report logs - #4909
23.1.50; in emacs -nw `read-char' should return with error when an event is entered.

Previous Next

Package: emacs;

Reported by: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>

Date: Thu, 12 Nov 2009 10:50:04 UTC

Severity: normal

Tags: moreinfo

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 4909 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
Cc: 4909 <at> debbugs.gnu.org
Subject: Re: bug#4909: 23.1.50; in emacs -nw `read-char' should return with
 error when an event is entered.
Date: Thu, 03 Jun 2021 11:33:35 +0200
Thierry Volpiatto <thierry.volpiatto <at> gmail.com> 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




This bug report was last modified 3 years and 326 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.