Mercurial > emacs
changeset 97949:e763543ca817
(calc-dispatch-map): Fix handling of upcased and
control-prefixed keys. (Bug #835)
author | Martin Rudalics <rudalics@gmx.at> |
---|---|
date | Tue, 02 Sep 2008 08:49:01 +0000 |
parents | 9d28724e2c52 |
children | 992028ae0d48 |
files | lisp/calc/calc.el |
diffstat | 1 files changed, 12 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/calc/calc.el Tue Sep 02 08:13:20 2008 +0000 +++ b/lisp/calc/calc.el Tue Sep 02 08:49:01 2008 +0000 @@ -1026,7 +1026,7 @@ (define-key map "\C-j" 'calc-over) (define-key map "\C-y" 'calc-yank) (define-key map [mouse-2] 'calc-yank) - + (mapc (lambda (x) (define-key map (char-to-string x) 'undefined)) "lOW") (mapc (lambda (x) (define-key map (char-to-string x) 'calc-missing-key)) @@ -1096,11 +1096,17 @@ (defvar calc-dispatch-map (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))) + (let* ((x-chr (car x)) + (x-str (char-to-string x-chr)) + (x-def (cdr x))) + (define-key map x-str x-def) + (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 ) ( ?b . calc-big-or-small ) ( ?c . calc )