GNU bug report logs -
#835
23.0.60; Quick calc is quietly disabled in view-mode
Previous Next
Full log
Message #20 received at 835 <at> emacsbugs.donarmstrong.com (full text, mbox):
martin rudalics <rudalics <at> 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?
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.