diff options
| author | Juri Linkov | 2013-12-11 02:45:10 +0200 |
|---|---|---|
| committer | Juri Linkov | 2013-12-11 02:45:10 +0200 |
| commit | c1916ff5b866bf33c93aa821f496e5e92f22b5cd (patch) | |
| tree | 3e1a79d894020bd92fa7ebec597f0298bd9c101b /lisp | |
| parent | 26ec2ce909d55c1d52f84fc0511cb561cdd77785 (diff) | |
| download | emacs-c1916ff5b866bf33c93aa821f496e5e92f22b5cd.tar.gz emacs-c1916ff5b866bf33c93aa821f496e5e92f22b5cd.zip | |
* lisp/bindings.el: Map kp keys to non-kp keys systematically
with basic modifiers control, meta and shift.
Fixes: debbugs:14397
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/bindings.el | 64 |
2 files changed, 34 insertions, 35 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ae68a2e4bad..96e2f57d6f6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-12-11 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | * bindings.el: Map kp keys to non-kp keys systematically | ||
| 4 | with basic modifiers control, meta and shift. (Bug#14397) | ||
| 5 | |||
| 1 | 2013-12-11 Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com> (tiny change) | 6 | 2013-12-11 Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com> (tiny change) |
| 2 | 7 | ||
| 3 | * net/eww.el (eww-mode-map): Instead of "Quit" show "Exit" and | 8 | * net/eww.el (eww-mode-map): Instead of "Quit" show "Exit" and |
diff --git a/lisp/bindings.el b/lisp/bindings.el index b3b4f76b555..c159f44eecd 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el | |||
| @@ -1056,36 +1056,30 @@ if `inhibit-field-text-motion' is non-nil." | |||
| 1056 | ;; FIXME: rather than list such mappings for every modifier-combination, | 1056 | ;; FIXME: rather than list such mappings for every modifier-combination, |
| 1057 | ;; we should come up with a way to do it generically, something like | 1057 | ;; we should come up with a way to do it generically, something like |
| 1058 | ;; (define-key function-key-map [*-kp-home] [*-home]) | 1058 | ;; (define-key function-key-map [*-kp-home] [*-home]) |
| 1059 | (define-key function-key-map [kp-home] [home]) | 1059 | ;; Currently we add keypad key combinations with basic modifiers |
| 1060 | (define-key function-key-map [kp-left] [left]) | 1060 | ;; (to complement plain bindings in "Keypad support" section in simple.el) |
| 1061 | (define-key function-key-map [kp-up] [up]) | 1061 | ;; Until [*-kp-home] is implemented, for more modifiers we could also use: |
| 1062 | (define-key function-key-map [kp-right] [right]) | 1062 | ;; (todo-powerset '(control meta shift hyper super alt)) (Bug#14397) |
| 1063 | (define-key function-key-map [kp-down] [down]) | 1063 | (let ((modifiers '(nil (control) (meta) (control meta) (shift) |
| 1064 | (define-key function-key-map [kp-prior] [prior]) | 1064 | (control shift) (meta shift) (control meta shift))) |
| 1065 | (define-key function-key-map [kp-next] [next]) | 1065 | (keys '((kp-delete delete) (kp-insert insert) |
| 1066 | (define-key function-key-map [M-kp-next] [M-next]) | 1066 | (kp-end end) (kp-down down) (kp-next next) |
| 1067 | (define-key function-key-map [kp-end] [end]) | 1067 | (kp-left left) (kp-begin begin) (kp-right right) |
| 1068 | (define-key function-key-map [kp-begin] [begin]) | 1068 | (kp-home home) (kp-up up) (kp-prior prior) |
| 1069 | (define-key function-key-map [kp-insert] [insert]) | 1069 | (kp-enter enter) (kp-decimal ?.) |
| 1070 | (kp-0 ?0) (kp-1 ?1) (kp-2 ?2) (kp-3 ?3) (kp-4 ?4) | ||
| 1071 | (kp-5 ?5) (kp-6 ?6) (kp-7 ?7) (kp-8 ?8) (kp-9 ?9) | ||
| 1072 | (kp-add +) (kp-subtract -) (kp-multiply *) (kp-divide /)))) | ||
| 1073 | (dolist (pair keys) | ||
| 1074 | (dolist (mod modifiers) | ||
| 1075 | (define-key function-key-map | ||
| 1076 | (vector (append mod (list (nth 0 pair)))) | ||
| 1077 | (vector (append mod (list (nth 1 pair)))))))) | ||
| 1078 | |||
| 1070 | (define-key function-key-map [backspace] [?\C-?]) | 1079 | (define-key function-key-map [backspace] [?\C-?]) |
| 1071 | (define-key function-key-map [delete] [?\C-?]) | 1080 | (define-key function-key-map [delete] [?\C-?]) |
| 1072 | (define-key function-key-map [kp-delete] [?\C-?]) | 1081 | (define-key function-key-map [kp-delete] [?\C-?]) |
| 1073 | (define-key function-key-map [S-kp-end] [S-end]) | 1082 | |
| 1074 | (define-key function-key-map [S-kp-down] [S-down]) | ||
| 1075 | (define-key function-key-map [S-kp-next] [S-next]) | ||
| 1076 | (define-key function-key-map [S-kp-left] [S-left]) | ||
| 1077 | (define-key function-key-map [S-kp-right] [S-right]) | ||
| 1078 | (define-key function-key-map [S-kp-home] [S-home]) | ||
| 1079 | (define-key function-key-map [S-kp-up] [S-up]) | ||
| 1080 | (define-key function-key-map [S-kp-prior] [S-prior]) | ||
| 1081 | (define-key function-key-map [C-S-kp-end] [C-S-end]) | ||
| 1082 | (define-key function-key-map [C-S-kp-down] [C-S-down]) | ||
| 1083 | (define-key function-key-map [C-S-kp-next] [C-S-next]) | ||
| 1084 | (define-key function-key-map [C-S-kp-left] [C-S-left]) | ||
| 1085 | (define-key function-key-map [C-S-kp-right] [C-S-right]) | ||
| 1086 | (define-key function-key-map [C-S-kp-home] [C-S-home]) | ||
| 1087 | (define-key function-key-map [C-S-kp-up] [C-S-up]) | ||
| 1088 | (define-key function-key-map [C-S-kp-prior] [C-S-prior]) | ||
| 1089 | ;; Don't bind shifted keypad numeric keys, they reportedly | 1083 | ;; Don't bind shifted keypad numeric keys, they reportedly |
| 1090 | ;; interfere with the feature of some keyboards to produce | 1084 | ;; interfere with the feature of some keyboards to produce |
| 1091 | ;; numbers when NumLock is off. | 1085 | ;; numbers when NumLock is off. |
| @@ -1097,14 +1091,14 @@ if `inhibit-field-text-motion' is non-nil." | |||
| 1097 | ;(define-key function-key-map [S-kp-7] [S-home]) | 1091 | ;(define-key function-key-map [S-kp-7] [S-home]) |
| 1098 | ;(define-key function-key-map [S-kp-8] [S-up]) | 1092 | ;(define-key function-key-map [S-kp-8] [S-up]) |
| 1099 | ;(define-key function-key-map [S-kp-9] [S-prior]) | 1093 | ;(define-key function-key-map [S-kp-9] [S-prior]) |
| 1100 | (define-key function-key-map [C-S-kp-1] [C-S-end]) | 1094 | ;(define-key function-key-map [C-S-kp-1] [C-S-end]) |
| 1101 | (define-key function-key-map [C-S-kp-2] [C-S-down]) | 1095 | ;(define-key function-key-map [C-S-kp-2] [C-S-down]) |
| 1102 | (define-key function-key-map [C-S-kp-3] [C-S-next]) | 1096 | ;(define-key function-key-map [C-S-kp-3] [C-S-next]) |
| 1103 | (define-key function-key-map [C-S-kp-4] [C-S-left]) | 1097 | ;(define-key function-key-map [C-S-kp-4] [C-S-left]) |
| 1104 | (define-key function-key-map [C-S-kp-6] [C-S-right]) | 1098 | ;(define-key function-key-map [C-S-kp-6] [C-S-right]) |
| 1105 | (define-key function-key-map [C-S-kp-7] [C-S-home]) | 1099 | ;(define-key function-key-map [C-S-kp-7] [C-S-home]) |
| 1106 | (define-key function-key-map [C-S-kp-8] [C-S-up]) | 1100 | ;(define-key function-key-map [C-S-kp-8] [C-S-up]) |
| 1107 | (define-key function-key-map [C-S-kp-9] [C-S-prior]) | 1101 | ;(define-key function-key-map [C-S-kp-9] [C-S-prior]) |
| 1108 | 1102 | ||
| 1109 | ;; Hitting C-SPC on text terminals, usually sends the ascii code 0 (aka C-@), | 1103 | ;; Hitting C-SPC on text terminals, usually sends the ascii code 0 (aka C-@), |
| 1110 | ;; so we can't distinguish those two keys, but usually we consider C-SPC | 1104 | ;; so we can't distinguish those two keys, but usually we consider C-SPC |