You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LLREAD: Add character names One, Two... for digits 0, 1 ... (#2060)
Currently, (CHARCODE 1) produces 49, just like (CHARCODE a) produces 97.
That's because CHARCODE.DECODE interprets a single character (that is
not also defined as a cHARACTERNAME) input as exactly that character,
and gets its character code.
But a character name in the charset,charnum format is treated in a
different way. If either part of the name is a number, it is interpreted
as an octal number, to make it easier to match against the XCCS
specifications. So (CHARCODE Meta,1) does not map to the position of
digit 1 in the Meta (currently 1) character set (= 256+49=305), it maps
to 256+1=257. In order to get 305, you have to specify Meta,61 (where 61
is the octal equivalent of 49).
That's rather opaque, and I found that TEDITKEY had a workaround based
on the obscure fact that CHARCODE.DECODE adds 128 for each # it sees in
the beginning of a character name. So ##1 adds 2*128 to 49 to get 305,
corresponding to digit 1 in the Meta character set. But that depends on
the fact that Meta is currently defined as charset 1, it won't work when
we move Meta up to the Unicode/XCCS undefined region of the code space.
This PR adds (Zero 48) (One 49)...(Nine 57) to the initial value of
CHARACTERNAMES in LLREAD, so that 305 for example can be specified as
Meta,One. This is more obvious than Meta,61 and will remain valid when
Meta is moved, unlike the ## hack..
0 commit comments