GNU bug report logs - #835
23.0.60; Quick calc is quietly disabled in view-mode

Previous Next

Package: emacs;

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

Date: Sun, 31 Aug 2008 09:15:04 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


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

From: Chong Yidong <cyd <at> stupidchicken.com>
To: martin rudalics <rudalics <at> gmx.at>
Cc: Jay Belanger <jay.p.belanger <at> gmail.com>, 835 <at> debbugs.gnu.org
Subject: Re: bug#835: 23.0.60; Quick calc is quietly disabled in view-mode
Date: Mon, 01 Sep 2008 17:50:58 -0400
martin rudalics <rudalics <at> gmx.at> 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...




This bug report was last modified 16 years and 260 days ago.

Previous Next


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