Subject: Re: bug#835: 23.0.60; Quick calc is quietly disabled in view-mode

From: Chong Yidong <[email-masked]>
Date: Mon, 01 Sep 2008 17:50:58 -0400

martin rudalics <[email-masked]> writes:

>> ! (define-key map (char-to-string (- (car x) ?a -1)) (cdr x)))
> [...]
>> ! (define-key map (upcase (char-to-string (car x))) (cdr x)))
>
>> What the original code does is the following: for a character such as
>> "n", it adds "C-n" to the keymap as well (it's a hack that relies on
>> the specific properties of the ASCII table, and needs at least a
>> comment).  That's not what the patched code does: it adds "N" to the
>> keymap.  Martin, what's the reason for this change?
>
> That was my intention: AFAICT `view-mode' took `Q' (and, for example,
> `E') away from calc and I simply tried to give it back to calc.  But
> maybe this part of the code really intended to add a "C-" ...

Yeah, it's somewhat opaque code.  The way the ASCII table is set up is
that character 1 is the character ^A, character 2 is the character ^B,
and so forth, until character 65 is the unmodified character A.  Hence
(char-to-string (- ?n ?a -1)) gives 14 == ^N.  (Also, ASCII control
characters are case insensitive: there's no separate ^n character.)

I suppose this means we have to find a separate fix for the original
bug...