bug#32562: 26; `read-char(-exclusive)' and `characterp'

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#32562: 26; `read-char(-exclusive)' and `characterp'

Eli Zaretskii
> Date: Mon, 10 Sep 2018 12:48:22 -0700 (PDT)
> From: Drew Adams <[hidden email]>
> Cc: [hidden email], [hidden email]
>
> > > > A character with modifiers doesn't satisfy characterp, but it is still a
> > > > character (which read-char can return).
> > >
> > > Yes, well, that's what I found a bit confusing wrt the
> > > doc and function names. It wasn't (isn't?) too clear
> > > just what we mean by "character", in that case.
> >
> > I made the documentation say "character event" where it matters.
>
> I imagine that you made it clearer (I don't have the new doc).

I hope so.

> But see what I replied to Andreas. It seems like we talk in some
> places about reading a character even if what gets read might
> not be `characterp'. "Character event" doesn't clarify that, for me.
>
> Seems like the doc (but I don't have time now to search it)
> doesn't distinguish "character" meaning something that is
> `characterp' from other meanings of it (not sure what those
> are, but apparently `read-char' can return such things).

The changes I made can be seen here:

  http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-26&id=5cf282d65f10f59f7efa63359dfd2b2e124943da

Please read them (in their context of surrounding manual text, of
course), and then see if something is still unclear.  Otherwise, this
discussion is too theoretical to be useful.

> It's not clear to me, at least. Why isn't `chararcterp' necessary
> and sufficient for testing whether something is a character?

It is.  But it is not sufficient for testing whether something is a
character input event, because an input event can include modifiers,
and valid character codepoints don't include modifiers.



Reply | Threaded
Open this post in threaded view
|

bug#32562: 26; `read-char(-exclusive)' and `characterp'

Drew Adams
> The changes I made can be seen here:
>
>   https://urldefense.proofpoint.com/v2/url?u=http-
> 3A__git.savannah.gnu.org_cgit_emacs.git_commit_-3Fh-3Demacs-2D26-26id-
> 3D5cf282d65f10f59f7efa63359dfd2b2e124943da&d=DwIBAg&c=RoP1YumCXCg
> aWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=kI3P6ljGv6CTHIKju0jqInF6AOwMCYR
> DQUmqX22rJ98&m=jioWGqzV72URRu3VKa5ldIhRy-
> eUITHjY2CjCiAMVEw&s=gVdGs2AlmqeIsl7dbZM0_9ulTQ_PPe0vAnT5MUx8AN
> M&e=

Thanks, that helps.

> Please read them (in their context of surrounding manual text, of
> course), and then see if something is still unclear.  

I can't easily read them in the context of the surrounding material,
but I read the diff, at least.

I see "character event" referred to but not explicitly defined, as
such. The inline explanation is clear enough, I think. Why not
treat the first occurrence of "character event" as a defined term
(however that's done in texinfo, so that it ends up in Info quoted,
as "character event"), and create an index entry for it (plus an
entry "event, character")? (Perhaps you did that; I can't tell.)

I think this might be the right occurrence to treat as defining
"character event":

+keys, and function keys.  Ordinary keys correspond to (possibly
+modified) characters; the events they generate are represented in Lisp
+as characters.  The event type of a character event is the character
                                     ^^^^^^^^^^^^^^^
+itself (an integer), which might have some modifier bits set; see

> > It's not clear to me, at least. Why isn't `chararcterp' necessary
> > and sufficient for testing whether something is a character?
>
> It is.  But it is not sufficient for testing whether something is a
> character input event, because an input event can include modifiers,
> and valid character codepoints don't include modifiers.

Got it. Thx.



Reply | Threaded
Open this post in threaded view
|

bug#32562: 26; `read-char(-exclusive)' and `characterp'

Eli Zaretskii
> Date: Tue, 11 Sep 2018 08:30:56 -0700 (PDT)
> From: Drew Adams <[hidden email]>
> Cc: [hidden email]
>
> I can't easily read them in the context of the surrounding material,
> but I read the diff, at least.

The context is given by the corresponding *.texi files.

> I see "character event" referred to but not explicitly defined, as
> such. The inline explanation is clear enough, I think. Why not
> treat the first occurrence of "character event" as a defined term
> (however that's done in texinfo, so that it ends up in Info quoted,
> as "character event"), and create an index entry for it (plus an
> entry "event, character")? (Perhaps you did that; I can't tell.)
>
> I think this might be the right occurrence to treat as defining
> "character event":
>
> +keys, and function keys.  Ordinary keys correspond to (possibly
> +modified) characters; the events they generate are represented in Lisp
> +as characters.  The event type of a character event is the character
>                                      ^^^^^^^^^^^^^^^
> +itself (an integer), which might have some modifier bits set; see

That's the definition you wanted, right there: it says that events can
represent characters, and then talks about "character events" thus
defined.