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

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

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


From: Chong Yidong
Subject: bug#835: 23.0.60; Quick calc is quietly disabled in view-mode
Date: Mon, 01 Sep 2008 14:53:30 -0400

martin rudalics <rudalics@gmx.at> wrote:

> Any objections against the attached patch?

*** calc/calc.el.~1.115.~       2008-08-23 09:41:44.515625000 +0200
--- calc/calc.el                2008-09-01 19:43:05.515625000 +0200
***************
*** 1097,1105 ****
    (let ((map (make-keymap)))
      (mapc (lambda (x)
              (define-key map (char-to-string (car x)) (cdr x))
!             (when (string-match "abcdefhijklnopqrstuwxyz"
                                  (char-to-string (car x)))
!               (define-key map (char-to-string (- (car x) ?a -1)) (cdr
x)))
              (define-key map (format "\e%c" (car x)) (cdr x)))
            '( ( ?a . calc-embedded-activate )
               ( ?b . calc-big-or-small )
--- 1097,1105 ----
    (let ((map (make-keymap)))
      (mapc (lambda (x)
              (define-key map (char-to-string (car x)) (cdr x))
!             (when (string-match "[abcdefhijklnopqrstuwxyz]"
                                  (char-to-string (car x)))
!               (define-key map (upcase (char-to-string (car x))) (cdr
x)))
              (define-key map (format "\e%c" (car x)) (cdr x)))
            '( ( ?a . calc-embedded-activate )
               ( ?b . calc-big-or-small )

Indeed, the argument to string-match in the original code looks like a
typo (fixed by the first line of the patch).

The second part of the patch is not clear to me.  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?






reply via email to

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