Commit 8d676b63 authored by Martin Rudalics's avatar Martin Rudalics
Browse files

(calc-dispatch-map): Fix handling of upcased and

control-prefixed keys.  (Bug #835)
parent 7a3cddef
2008-09-02 Martin Rudalics <rudalics@gmx.at>
* calc/calc.el (calc-dispatch-map): Fix handling of upcased and
control-prefixed keys. (Bug #835)
2008-09-02 Chong Yidong <cyd@stupidchicken.com> 2008-09-02 Chong Yidong <cyd@stupidchicken.com>
* image-mode.el (image-mode): Fix 2008-07-19 change. * image-mode.el (image-mode): Fix 2008-07-19 change.
......
...@@ -1026,7 +1026,7 @@ Used by `calc-user-invocation'.") ...@@ -1026,7 +1026,7 @@ Used by `calc-user-invocation'.")
(define-key map "\C-j" 'calc-over) (define-key map "\C-j" 'calc-over)
(define-key map "\C-y" 'calc-yank) (define-key map "\C-y" 'calc-yank)
(define-key map [mouse-2] 'calc-yank) (define-key map [mouse-2] 'calc-yank)
(mapc (lambda (x) (define-key map (char-to-string x) 'undefined)) (mapc (lambda (x) (define-key map (char-to-string x) 'undefined))
"lOW") "lOW")
(mapc (lambda (x) (define-key map (char-to-string x) 'calc-missing-key)) (mapc (lambda (x) (define-key map (char-to-string x) 'calc-missing-key))
...@@ -1096,11 +1096,17 @@ Used by `calc-user-invocation'.") ...@@ -1096,11 +1096,17 @@ Used by `calc-user-invocation'.")
(defvar calc-dispatch-map (defvar calc-dispatch-map
(let ((map (make-keymap))) (let ((map (make-keymap)))
(mapc (lambda (x) (mapc (lambda (x)
(define-key map (char-to-string (car x)) (cdr x)) (let* ((x-chr (car x))
(when (string-match "abcdefhijklnopqrstuwxyz" (x-str (char-to-string x-chr))
(char-to-string (car x))) (x-def (cdr x)))
(define-key map (char-to-string (- (car x) ?a -1)) (cdr x))) (define-key map x-str x-def)
(define-key map (format "\e%c" (car x)) (cdr x))) (when (string-match "[a-z]" x-str)
;; Map upper case char to same definition.
(define-key map (upcase x-str) x-def)
(unless (string-match "[gmv]" x-str)
;; Map control prefixed char to same definition.
(define-key map (vector (list 'control x-chr)) x-def)))
(define-key map (format "\e%c" x-chr) x-def)))
'( ( ?a . calc-embedded-activate ) '( ( ?a . calc-embedded-activate )
( ?b . calc-big-or-small ) ( ?b . calc-big-or-small )
( ?c . calc ) ( ?c . calc )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment