GNU bug report logs - #1042
23.0.60; read-char can evaluate to non-character

Previous Next

Package: emacs;

Reported by: Markus Triska <markus.triska <at> gmx.at>

Date: Sun, 28 Sep 2008 05:15:02 UTC

Severity: minor

Merged with 13599, 32562

Found in version 24.2

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #15 received at 1042 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Markus Triska <markus.triska <at> gmx.at>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 1042 <at> debbugs.gnu.org
Subject: Re: bug#1042: 23.0.60; read-char can evaluate to non-character
Date: Sun, 28 Sep 2008 14:14:55 +0200
martin rudalics <rudalics <at> gmx.at> writes:

> The doc-string of `read-char' says

C-SPC (= 0) is different from C-0: (characterp 0) is t, and
(char-to-string 0) evaluates to a string; i.e., it is a character.

> Do you have a particular use case that calls for throwing an error
> here?

I relied on `read-char' evaluating to a character in ediprolog:

   http://www.logic.at/prolog/ediprolog/ediprolog.html

On l.352, I read a character from the user and use `char-to-string' to
send it to the Prolog process as string. If the user generates an event
that is not a character, it should not be sent to the Prolog process,
and a usage note is displayed instead.

Thus, I can work around the current behaviour of `read-char' by also
guarding `char-to-string' against errors, or using the now obsolete
`char-valid-p' for Emacs 22, and `characterp' for later versions.
However, it would be nice if `read-char' always yielded a character.





This bug report was last modified 6 years and 255 days ago.

Previous Next


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