bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#4751: 23.1; `read-char' inserts accented chars when you use `M-' mod


From: Drew Adams
Subject: bug#4751: 23.1; `read-char' inserts accented chars when you use `M-' modifier
Date: Mon, 19 Oct 2009 14:42:22 -0700

I guess you're saying that there is no bug here (for `read-char').

What about this?

(characterp ?\M-t) -> nil

Seems like that would mean that `read-char' should raise an error saying that
it's not a char, and that `read-char-exclusive' should ignore it.

?\M-t -> 134217844, which is beyond the limit of 4194303 for string/buffer
chars. Which means I guess it is a keyboard-only char ((elisp)Character Type).

But the doc of `characterp' doesn't say anything about being limited to
string/buffer chars. Is this a doc bug? Is it correct for `characterp' to return
nil here?

(read-char "a: "), then hit `M-t' -> 244

So the "character" read by `read-char' does not correspond to the non-characterp
integer (presumably a keyboard char) returned by ?\M-t, although the latter is
the Lisp reader syntax for a character. And the Elisp manual (node Meta-Char
Syntax) says that ?\M-t represents the meta version of ASCII `t'. So what is
`read-char' coming up with, and why?

I'm still confused. Understanding welcome.

Seems like the doc also needs a little clarification wrt which types of
"character" are intended in each of these contexts.

Apparently, for instance, the `?' character read syntax allows use of
non-string/buffer chars, such as M-t. That's not stated and not obvious. And
`read-char' interprets the key `M-t' differently, returning a different integer
from what ?\M-t returns and from what "\M-t" means when the string is used for a
key. And nowhere is it said what `characterp' tests, apart from being a
character - why it considers ?\M-t not to be a char, for instance.

And the info seems spread around a bit too much. You need to get to node
`Nonprinting Characters', for instance, to learn that "strings cannot hold meta
characters", but that, when used to represent a key, "\M-" in a string
represents the meta version of the ASCII char.

The `read-char' behavior still seems like a bug, to me, but I do want to
understand it. Why does it return 244 - what's the relation between that
integer/char (o circumflex) and the meta version of ASCII `t'?






reply via email to

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