diff options
| author | Stefan Monnier | 2007-10-09 04:26:29 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-10-09 04:26:29 +0000 |
| commit | bbd2296c61cd945470116454a77d0e46277c1e74 (patch) | |
| tree | f75677226a007ce9e3117444135484dbbf71af53 | |
| parent | ed2a19a19337ae26ff6caf6b6306f2325ac8a1e7 (diff) | |
| download | emacs-bbd2296c61cd945470116454a77d0e46277c1e74.tar.gz emacs-bbd2296c61cd945470116454a77d0e46277c1e74.zip | |
(x-alternatives-map): New var.
(x-setup-function-keys): Use it.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/term/x-win.el | 41 |
2 files changed, 28 insertions, 16 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6b12ee26151..87747db0822 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2007-10-09 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2007-10-09 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * term/x-win.el (x-alternatives-map): New var. | ||
| 4 | (x-setup-function-keys): Use it. | ||
| 5 | |||
| 3 | * help-fns.el (describe-variable): Slightly change the layout of | 6 | * help-fns.el (describe-variable): Slightly change the layout of |
| 4 | meta-info to separate it better from the docstring. | 7 | meta-info to separate it better from the docstring. |
| 5 | Standardize insertion of extra empty lines in various circumstances. | 8 | Standardize insertion of extra empty lines in various circumstances. |
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index 84cdf7083b4..7186e46c31a 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el | |||
| @@ -1177,6 +1177,28 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp") | |||
| 1177 | 1177 | ||
| 1178 | ;;;; Function keys | 1178 | ;;;; Function keys |
| 1179 | 1179 | ||
| 1180 | (defvar x-alternatives-map | ||
| 1181 | (let ((map (make-sparse-keymap))) | ||
| 1182 | ;; Map certain keypad keys into ASCII characters that people usually expect. | ||
| 1183 | (define-key map [backspace] [127]) | ||
| 1184 | (define-key map [delete] [127]) | ||
| 1185 | (define-key map [tab] [?\t]) | ||
| 1186 | (define-key map [linefeed] [?\n]) | ||
| 1187 | (define-key map [clear] [?\C-l]) | ||
| 1188 | (define-key map [return] [?\C-m]) | ||
| 1189 | (define-key map [escape] [?\e]) | ||
| 1190 | (define-key map [M-backspace] [?\M-\d]) | ||
| 1191 | (define-key map [M-delete] [?\M-\d]) | ||
| 1192 | (define-key map [M-tab] [?\M-\t]) | ||
| 1193 | (define-key map [M-linefeed] [?\M-\n]) | ||
| 1194 | (define-key map [M-clear] [?\M-\C-l]) | ||
| 1195 | (define-key map [M-return] [?\M-\C-m]) | ||
| 1196 | (define-key map [M-escape] [?\M-\e]) | ||
| 1197 | (define-key map [iso-lefttab] [backtab]) | ||
| 1198 | (define-key map [S-iso-lefttab] [backtab])) | ||
| 1199 | map) | ||
| 1200 | "Keymap of possible alternative meanings for some keys.") | ||
| 1201 | |||
| 1180 | (defun x-setup-function-keys (frame) | 1202 | (defun x-setup-function-keys (frame) |
| 1181 | "Set up `function-key-map' on FRAME for the X window system." | 1203 | "Set up `function-key-map' on FRAME for the X window system." |
| 1182 | ;; Don't do this twice on the same display, or it would break | 1204 | ;; Don't do this twice on the same display, or it would break |
| @@ -1184,22 +1206,9 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp") | |||
| 1184 | (unless (terminal-parameter frame 'x-setup-function-keys) | 1206 | (unless (terminal-parameter frame 'x-setup-function-keys) |
| 1185 | ;; Map certain keypad keys into ASCII characters that people usually expect. | 1207 | ;; Map certain keypad keys into ASCII characters that people usually expect. |
| 1186 | (with-selected-frame frame | 1208 | (with-selected-frame frame |
| 1187 | (define-key local-function-key-map [backspace] [127]) | 1209 | (let ((map (copy-keymap x-alternatives-map))) |
| 1188 | (define-key local-function-key-map [delete] [127]) | 1210 | (set-keymap-parent map (keymap-parent local-function-key-map)) |
| 1189 | (define-key local-function-key-map [tab] [?\t]) | 1211 | (set-keymap-parent local-function-key-map map))) |
| 1190 | (define-key local-function-key-map [linefeed] [?\n]) | ||
| 1191 | (define-key local-function-key-map [clear] [?\C-l]) | ||
| 1192 | (define-key local-function-key-map [return] [?\C-m]) | ||
| 1193 | (define-key local-function-key-map [escape] [?\e]) | ||
| 1194 | (define-key local-function-key-map [M-backspace] [?\M-\d]) | ||
| 1195 | (define-key local-function-key-map [M-delete] [?\M-\d]) | ||
| 1196 | (define-key local-function-key-map [M-tab] [?\M-\t]) | ||
| 1197 | (define-key local-function-key-map [M-linefeed] [?\M-\n]) | ||
| 1198 | (define-key local-function-key-map [M-clear] [?\M-\C-l]) | ||
| 1199 | (define-key local-function-key-map [M-return] [?\M-\C-m]) | ||
| 1200 | (define-key local-function-key-map [M-escape] [?\M-\e]) | ||
| 1201 | (define-key local-function-key-map [iso-lefttab] [backtab]) | ||
| 1202 | (define-key local-function-key-map [S-iso-lefttab] [backtab])) | ||
| 1203 | (set-terminal-parameter frame 'x-setup-function-keys t))) | 1212 | (set-terminal-parameter frame 'x-setup-function-keys t))) |
| 1204 | 1213 | ||
| 1205 | ;; These tell read-char how to convert | 1214 | ;; These tell read-char how to convert |