Mercurial > hg > xemacs-beta
comparison lisp/prim/keydefs.el @ 0:376386a54a3c r19-14
Import from CVS: tag r19-14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:45:50 +0200 |
parents | |
children | 0293115a14e9 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:376386a54a3c |
---|---|
1 ;; Define standard keybindings. | |
2 ;; Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. | |
3 | |
4 ;; This file is part of XEmacs. | |
5 | |
6 ;; XEmacs is free software; you can redistribute it and/or modify it | |
7 ;; under the terms of the GNU General Public License as published by | |
8 ;; the Free Software Foundation; either version 2, or (at your option) | |
9 ;; any later version. | |
10 | |
11 ;; XEmacs is distributed in the hope that it will be useful, but | |
12 ;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 ;; General Public License for more details. | |
15 | |
16 ;; You should have received a copy of the GNU General Public License | |
17 ;; along with XEmacs; see the file COPYING. If not, write to the Free | |
18 ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
19 | |
20 ;; All the global bindings should be here so that one can reload things | |
21 ;; like files.el without trashing one's personal bindings. | |
22 | |
23 ;;; Synched up with: Not synched with FSF. | |
24 | |
25 ;; created by C code | |
26 (defvar global-map (current-global-map) "\ | |
27 Default global keymap mapping XEmacs keyboard input into commands. | |
28 The value is a keymap which is usually (but not necessarily) XEmacs's | |
29 global map.") | |
30 | |
31 ;; created by C code | |
32 (defvar esc-map (symbol-function 'ESC-prefix) "\ | |
33 Default keymap for ESC (meta) commands. | |
34 The normal global definition of the character ESC indirects to this keymap.") | |
35 | |
36 (set-keymap-name global-map 'global-map) | |
37 (set-keymap-name esc-map 'ESC-prefix) | |
38 | |
39 (define-prefix-command 'Control-X-prefix t) | |
40 (defvar ctl-x-map (symbol-function 'Control-X-prefix) "\ | |
41 Default keymap for C-x commands. | |
42 The normal global definition of the character C-x indirects to this keymap.") | |
43 (define-key global-map "\C-x" 'Control-X-prefix) | |
44 | |
45 (define-prefix-command 'ctl-x-4-prefix t) | |
46 (defvar ctl-x-4-map (symbol-function 'ctl-x-4-prefix) "\ | |
47 Keymap for subcommands of C-x 4") | |
48 (define-key global-map "\C-x4" 'ctl-x-4-prefix) | |
49 | |
50 (define-prefix-command 'ctl-x-5-prefix t) | |
51 (defvar ctl-x-5-map (symbol-function 'ctl-x-5-prefix) "\ | |
52 Keymap for subcommands of C-x 5") | |
53 (define-key global-map "\C-x5" 'ctl-x-5-prefix) | |
54 | |
55 (define-prefix-command 'mode-specific-command-prefix t) | |
56 (defvar mode-specific-map (symbol-function 'mode-specific-command-prefix) "\ | |
57 Keymap for characters following C-c.") | |
58 (define-key global-map "\C-c" 'mode-specific-command-prefix) | |
59 | |
60 ;; FSFmacs buffer.c | |
61 | |
62 (define-key global-map "\C-xb" 'switch-to-buffer) | |
63 (define-key global-map "\C-xk" 'kill-buffer) | |
64 (define-key global-map "\C-x\C-b" 'list-buffers) | |
65 (put 'erase-buffer 'disabled t) ;from buffer.c | |
66 | |
67 ;; FSFmacs casefiddle.c | |
68 | |
69 (define-key global-map "\C-x\C-u" 'upcase-region) | |
70 (put 'upcase-region 'disabled t) | |
71 (define-key global-map "\C-x\C-l" 'downcase-region) | |
72 (put 'downcase-region 'disabled t) | |
73 (define-key global-map "\M-u" 'upcase-region-or-word) | |
74 (define-key global-map "\M-l" 'downcase-region-or-word) | |
75 (define-key global-map "\M-c" 'capitalize-region-or-word) | |
76 | |
77 ;; FSFmacs cmds.c | |
78 | |
79 (let ((n 33)) | |
80 (while (<= n 255) | |
81 (if (not (= n 127)) | |
82 (define-key global-map n 'self-insert-command)) | |
83 (setq n (1+ n)))) | |
84 (define-key global-map " " 'self-insert-command) | |
85 | |
86 (define-key global-map "\C-a" 'beginning-of-line) | |
87 (define-key global-map "\C-b" 'backward-char) | |
88 (define-key global-map "\C-e" 'end-of-line) | |
89 (define-key global-map "\C-f" 'forward-char) | |
90 (define-key global-map "\C-d" 'delete-char) | |
91 (define-key global-map "\177" 'delete-backward-char) | |
92 | |
93 ;; FSFmacs files.el | |
94 | |
95 (define-key global-map "\C-x\C-f" 'find-file) | |
96 (define-key global-map "\C-x\C-q" 'toggle-read-only) | |
97 (define-key global-map "\C-x\C-r" 'find-file-read-only) | |
98 (define-key global-map "\C-x\C-v" 'find-alternate-file) | |
99 (define-key global-map "\C-x\C-s" 'save-buffer) | |
100 (define-key global-map "\C-xs" 'save-some-buffers) | |
101 (define-key global-map "\C-x\C-w" 'write-file) | |
102 (define-key global-map "\C-xi" 'insert-file) | |
103 (define-key global-map "\M-~" 'not-modified) | |
104 (define-key global-map "\C-x\C-d" 'list-directory) | |
105 (define-key global-map "\C-x\C-c" 'save-buffers-kill-emacs) | |
106 | |
107 (define-key global-map "\C-x4f" 'find-file-other-window) | |
108 (define-key global-map "\C-x4r" 'find-file-read-only-other-window) | |
109 (define-key global-map "\C-x4\C-f" 'find-file-other-window) | |
110 (define-key global-map "\C-x4b" 'switch-to-buffer-other-window) | |
111 (define-key global-map "\C-x4\C-o" 'display-buffer) | |
112 | |
113 (define-key global-map "\C-x5b" 'switch-to-buffer-other-frame) | |
114 (define-key global-map "\C-x5f" 'find-file-other-frame) | |
115 (define-key global-map "\C-x5\C-f" 'find-file-other-frame) | |
116 (define-key global-map "\C-x5r" 'find-file-read-only-other-frame) | |
117 | |
118 ;; FSFmacs frame.c | |
119 ;FSFmacs has these. It's probably a good idea to provide ways of hooking | |
120 ;these events, but it's unlikely that it's a good idea to do it this way. | |
121 ;Just provide a hook, like the existing `select-frame-hook', | |
122 ;`deselect-frame-hook', `map-frame-hook', and `unmap-frame-hook'. | |
123 ;#### ergo need hooks for delete-frame and iconify-frame | |
124 ;(define-key global-map 'switch-frame 'handle-switch-frame) | |
125 ;(define-key global-map 'delete-frame 'handle-delete-frame) | |
126 ;(define-key global-map 'iconify-frame 'ignore-event) | |
127 ;(define-key global-map 'make-frame-visible 'ignore-event) | |
128 | |
129 ;; FSFmacs frame.el | |
130 | |
131 ;; New FSF19 bindings: C-x 5 as prefix for window commands | |
132 (define-key global-map "\C-x52" 'make-frame) | |
133 (define-key global-map "\C-x50" 'delete-frame) | |
134 (define-key global-map "\C-x5o" 'other-frame) | |
135 ;; XEmacs addition: | |
136 (define-key global-map "\C-x5m" 'mail-other-frame) | |
137 | |
138 ;; FSFmacs help.el | |
139 | |
140 (let ((ch help-char)) | |
141 (if (or (characterp ch) (integerp ch)) | |
142 (setq ch (char-to-string ch))) | |
143 (define-key global-map ch 'help-command)) | |
144 (define-key global-map 'help 'help-command) | |
145 (define-key global-map 'f1 'help-command) | |
146 | |
147 ;; FSFmacs indent.el | |
148 | |
149 ;;(define-key global-map "\t" 'self-insert-command) | |
150 (define-key global-map "\t" 'indent-for-tab-command) | |
151 (define-key global-map "\M-\C-\\" 'indent-region) | |
152 (define-key global-map "\C-x\t" 'indent-rigidly) | |
153 (define-key global-map "\M-i" 'tab-to-tab-stop) | |
154 ;; XEmacs addition: | |
155 (define-key global-map [(shift tab)] 'tab-to-tab-stop) | |
156 | |
157 ;; FSFmacs isearch.el | |
158 | |
159 (define-key global-map "\C-s" 'isearch-forward) | |
160 (define-key global-map "\C-r" 'isearch-backward) | |
161 (define-key global-map "\M-\C-s" 'isearch-forward-regexp) | |
162 (define-key global-map "\M-\C-r" 'isearch-backward-regexp) | |
163 | |
164 ;; FSFmacs keyboard.c | |
165 | |
166 (define-key global-map "\C-z" 'suspend-or-iconify-emacs) | |
167 (define-key global-map "\C-x\C-z" 'suspend-or-iconify-emacs) | |
168 | |
169 ;; FSFmacs loaddefs.el | |
170 | |
171 ;; New FSF19 bindings: C-x n as a prefix for narrowing commands. | |
172 (define-key global-map "\C-xn" (let ((map (make-sparse-keymap))) | |
173 (set-keymap-name map 'narrowing-prefix) | |
174 map)) | |
175 (put 'narrow-to-region 'disabled t) | |
176 (define-key global-map "\C-xnn" 'narrow-to-region) | |
177 (define-key global-map "\C-xnw" 'widen) | |
178 ;; Old v18 bindings | |
179 ;(define-key global-map "\C-xn" 'narrow-to-region) | |
180 ;(define-key global-map "\C-xw" 'widen) | |
181 | |
182 (define-key global-map "\C-j" 'newline-and-indent) | |
183 (define-key global-map "\C-m" 'newline) | |
184 (define-key global-map "\C-o" 'open-line) | |
185 (define-key global-map "\M-\C-o" 'split-line) | |
186 (define-key global-map "\C-q" 'quoted-insert) | |
187 (define-key global-map "\M-^" 'delete-indentation) | |
188 (define-key global-map "\M-\\" 'delete-horizontal-space) | |
189 (define-key global-map "\M-m" 'back-to-indentation) | |
190 (define-key global-map "\C-x\C-o" 'delete-blank-lines) | |
191 (define-key global-map "\M- " 'just-one-space) | |
192 (define-key global-map "\M-z" 'zap-to-char) | |
193 (define-key global-map "\M-=" 'count-lines-region) | |
194 (define-key global-map "\C-x=" 'what-cursor-position) | |
195 (define-key global-map "\M-:" 'eval-expression) | |
196 ;; Define ESC ESC : like ESC : for people who type ESC ESC out of habit. | |
197 (define-key global-map "\M-\e:" 'eval-expression) | |
198 ;(define-key global-map "\M-\e" 'eval-expression) | |
199 (put 'eval-expression 'disabled t) | |
200 ;; Changed from C-x ESC so that function keys work following C-x. | |
201 (define-key global-map "\C-x\e\e" 'repeat-complex-command) | |
202 ;(define-key global-map "\C-x\e" 'repeat-complex-command) | |
203 (define-key global-map "\C-xu" 'advertised-undo) | |
204 ;; Many people are used to typing C-/ on X terminals and getting C-_. | |
205 (define-key global-map '(control /) 'undo) | |
206 (define-key global-map "\C-_" 'undo) | |
207 (define-key global-map "\M-!" 'shell-command) | |
208 (define-key global-map "\M-|" 'shell-command-on-region) | |
209 | |
210 (define-key global-map "\C-u" 'universal-argument) | |
211 ;; Make Control-0 - Control-9 set the prefix argument, like Meta-0. | |
212 (let ((i ?0)) | |
213 (while (<= i ?9) | |
214 (define-key global-map (list 'meta i) 'digit-argument) | |
215 (define-key global-map (list 'control i) 'digit-argument) | |
216 (define-key global-map (list 'control 'meta i) 'digit-argument) | |
217 (setq i (1+ i)))) | |
218 (define-key global-map '(meta -) 'negative-argument) | |
219 (define-key global-map '(control -) 'negative-argument) | |
220 (define-key global-map '(control meta -) 'negative-argument) | |
221 | |
222 (define-key global-map "\C-k" 'kill-line) | |
223 (define-key global-map "\C-w" 'kill-region) | |
224 (define-key global-map "\M-w" 'kill-ring-save) | |
225 (define-key global-map "\M-\C-w" 'append-next-kill) | |
226 (define-key global-map "\C-y" 'yank) | |
227 (define-key global-map "\M-y" 'yank-pop) | |
228 | |
229 ;; Old v18 binding | |
230 ;(define-key global-map "\C-xa" 'append-to-buffer) | |
231 | |
232 (define-key global-map "\C-@" 'set-mark-command) | |
233 ;; Many people are used to typing C-SPC and getting C-@. | |
234 (define-key global-map '(control ? ) 'set-mark-command) | |
235 (define-key global-map "\C-x\C-x" 'exchange-point-and-mark) | |
236 (define-key global-map "\C-x\C-@" 'pop-global-mark) | |
237 (define-key global-map [(control x) (control ? )] 'pop-global-mark) | |
238 | |
239 (define-key global-map "\C-n" 'next-line) | |
240 (define-key global-map "\C-p" 'previous-line) | |
241 (define-key global-map "\C-x\C-n" 'set-goal-column) | |
242 ;; XEmacs: | |
243 ;;; Many people have said they rarely use this feature, and often type | |
244 ;;; it by accident. Maybe it shouldn't even be on a key. | |
245 (put 'set-goal-column 'disabled t) | |
246 | |
247 (define-key global-map [menu] 'execute-extended-command) | |
248 (define-key global-map [find] 'search-forward) | |
249 | |
250 (define-key global-map "\C-t" 'transpose-chars) | |
251 (define-key global-map "\M-t" 'transpose-words) | |
252 (define-key global-map "\M-\C-t" 'transpose-sexps) | |
253 (define-key global-map "\C-x\C-t" 'transpose-lines) | |
254 | |
255 (define-key global-map "\M-;" 'indent-for-comment) | |
256 (define-key global-map "\M-j" 'indent-new-comment-line) | |
257 (define-key global-map "\M-\C-j" 'indent-new-comment-line) | |
258 (define-key global-map "\C-x;" 'set-comment-column) | |
259 (define-key global-map "\C-xf" 'set-fill-column) | |
260 (define-key global-map "\C-x$" 'set-selective-display) | |
261 | |
262 (define-key global-map "\M-@" 'mark-word) | |
263 (define-key global-map "\M-f" 'forward-word) | |
264 (define-key global-map "\M-b" 'backward-word) | |
265 (define-key global-map "\M-d" 'kill-word) | |
266 (define-key global-map "\M-\177" 'backward-kill-word) | |
267 | |
268 (define-key global-map "\M-<" 'beginning-of-buffer) | |
269 (define-key global-map "\M->" 'end-of-buffer) | |
270 (define-key global-map "\C-xh" 'mark-whole-buffer) | |
271 (define-key global-map "\M-\\" 'delete-horizontal-space) | |
272 | |
273 (define-key global-map "\M-\C-f" 'forward-sexp) | |
274 (define-key global-map "\M-\C-b" 'backward-sexp) | |
275 (define-key global-map "\M-\C-u" 'backward-up-list) | |
276 (define-key global-map "\M-\C-@" 'mark-sexp) | |
277 (define-key global-map "\M-\C-d" 'down-list) | |
278 (define-key global-map "\M-\C-k" 'kill-sexp) | |
279 (define-key global-map "\M-\C-n" 'forward-list) | |
280 (define-key global-map "\M-\C-p" 'backward-list) | |
281 (define-key global-map "\M-\C-a" 'beginning-of-defun) | |
282 (define-key global-map "\M-\C-e" 'end-of-defun) | |
283 (define-key global-map "\M-\C-h" 'mark-defun) | |
284 (define-key global-map "\M-\(" 'insert-parentheses) | |
285 (define-key global-map "\M-\)" 'move-past-close-and-reindent) | |
286 (define-key global-map "\M-\t" 'lisp-complete-symbol) | |
287 | |
288 (define-key global-map '(control meta delete) 'backward-kill-sexp) | |
289 | |
290 | |
291 (define-key global-map "\C-x/" 'point-to-register) | |
292 (define-key global-map "\C-xj" 'jump-to-register) | |
293 (define-key global-map "\C-xx" 'copy-to-register) | |
294 (define-key global-map "\C-xg" 'insert-register) | |
295 ;; Old v18 binding | |
296 ;(define-key global-map "\C-xr" 'copy-rectangle-to-register) | |
297 | |
298 ;; New FSF19 bindings: C-x r as a prefix for register commands | |
299 (define-key global-map "\C-xr" (let ((map (make-sparse-keymap))) | |
300 (set-keymap-name map 'rectangle-prefix) | |
301 map)) | |
302 (define-key global-map "\C-xr\C-@" 'point-to-register) | |
303 (define-key global-map "\C-xr " 'point-to-register) | |
304 (define-key global-map "\C-xrj" 'jump-to-register) | |
305 (define-key global-map "\C-xrs" 'copy-to-register) | |
306 (define-key global-map "\C-xrx" 'copy-to-register) | |
307 (define-key global-map "\C-xri" 'insert-register) | |
308 (define-key global-map "\C-xrg" 'insert-register) | |
309 (define-key global-map "\C-xrr" 'copy-rectangle-to-register) | |
310 (define-key global-map "\C-xrc" 'clear-rectangle) | |
311 (define-key global-map "\C-xrk" 'kill-rectangle) | |
312 (define-key global-map "\C-xry" 'yank-rectangle) | |
313 (define-key global-map "\C-xro" 'open-rectangle) | |
314 (define-key global-map "\C-xrt" 'string-rectangle) | |
315 (define-key global-map "\C-xrw" 'window-configuration-to-register) | |
316 ;(define-key global-map "\C-xrf" 'frame-configuration-to-register) | |
317 | |
318 (define-key global-map "\M-q" 'fill-paragraph-or-region) | |
319 ;(define-key global-map "\M-q" 'fill-paragraph) | |
320 ;(define-key global-map "\M-g" 'fill-region) ;now bound to goto-line | |
321 (define-key global-map "\C-x." 'set-fill-prefix) | |
322 | |
323 ; Using {} instead of [] is 1) FSF compatible and 2) allows function | |
324 ; keys to work on ttys. M-[ is the beginning of most the function key | |
325 ; sequences. | |
326 (define-key global-map "\M-{" 'backward-paragraph) | |
327 (define-key global-map "\M-}" 'forward-paragraph) | |
328 (define-key global-map "\M-h" 'mark-paragraph) | |
329 (define-key global-map "\M-a" 'backward-sentence) | |
330 (define-key global-map "\M-e" 'forward-sentence) | |
331 (define-key global-map "\M-k" 'kill-sentence) | |
332 (define-key global-map "\C-x\177" 'backward-kill-sentence) | |
333 | |
334 (define-key global-map "\C-x[" 'backward-page) | |
335 (define-key global-map "\C-x]" 'forward-page) | |
336 (define-key global-map "\C-x\C-p" 'mark-page) | |
337 (define-key global-map "\C-xl" 'count-lines-page) | |
338 (define-key global-map "\C-xnp" 'narrow-to-page) | |
339 ;; Old v18 bindings | |
340 ;(define-key global-map "\C-xp" 'narrow-to-page) | |
341 (put 'narrow-to-page 'disabled t) | |
342 | |
343 ;; Old v18 bindings | |
344 ;(define-key global-map "\C-x\C-a" 'add-mode-abbrev) | |
345 ;(define-key global-map "\C-x+" 'add-global-abbrev) | |
346 ;(define-key global-map "\C-x\C-h" 'inverse-add-mode-abbrev) | |
347 ;(define-key global-map "\C-x-" 'inverse-add-global-abbrev) | |
348 | |
349 (define-key global-map "\M-'" 'abbrev-prefix-mark) | |
350 (define-key global-map "\C-x'" 'expand-abbrev) | |
351 | |
352 ;; New FSF19 bindings: C-x a as a prefix for abbrev commands | |
353 (define-key global-map "\C-xal" 'add-mode-abbrev) | |
354 (define-key global-map "\C-xa\C-a" 'add-mode-abbrev) | |
355 (define-key global-map "\C-xag" 'add-global-abbrev) | |
356 (define-key global-map "\C-xa+" 'add-mode-abbrev) | |
357 (define-key global-map "\C-xaig" 'inverse-add-global-abbrev) | |
358 (define-key global-map "\C-xail" 'inverse-add-mode-abbrev) | |
359 (define-key global-map "\C-xa-" 'inverse-add-global-abbrev) | |
360 (define-key global-map "\C-xae" 'expand-abbrev) | |
361 (define-key global-map "\C-xa'" 'expand-abbrev) | |
362 | |
363 (define-key global-map "\M-\C-l" 'switch-to-other-buffer) | |
364 | |
365 ;; Default binding of "Backspace" is the same as delete. | |
366 ;; Default binding of "Control-h" is help. | |
367 (define-key global-map 'backspace '[delete]) | |
368 (define-key global-map '(meta backspace) '[(meta delete)]) | |
369 (define-key global-map '(control backspace) '[(control delete)]) | |
370 (define-key global-map '(control meta backspace) '[(control meta delete)]) | |
371 | |
372 (define-key global-map "\M-\C-z" 'activate-region) | |
373 | |
374 ;; FSFmacs macros.c | |
375 | |
376 (define-key global-map "\C-xe" 'call-last-kbd-macro) | |
377 (define-key global-map "\C-x\(" 'start-kbd-macro) | |
378 (define-key global-map "\C-x\)" 'end-kbd-macro) | |
379 | |
380 ;; FSFmacs macros.el | |
381 | |
382 (define-key global-map "\C-xq" 'kbd-macro-query) | |
383 | |
384 | |
385 ;; FSFmacs minibuffer.c | |
386 ; see also minibuf.el | |
387 | |
388 (define-key global-map "\M-\C-c" 'exit-recursive-edit) | |
389 (define-key global-map "\C-]" 'abort-recursive-edit) | |
390 (define-key global-map "\M-x" 'execute-extended-command) | |
391 | |
392 ;; FSFmacs window.c | |
393 | |
394 (define-key global-map "\C-x0" 'delete-window) | |
395 (define-key global-map "\C-x1" 'delete-other-windows) | |
396 (define-key global-map "\C-x2" 'split-window-vertically) | |
397 (define-key global-map "\C-x3" 'split-window-horizontally) | |
398 ;; Old XEmacs binding | |
399 ;;(define-key global-map "\C-x5" 'split-window-horizontally) | |
400 (define-key global-map "\C-xo" 'other-window) | |
401 (define-key global-map "\C-x^" 'enlarge-window) | |
402 (define-key global-map "\C-x<" 'scroll-left) | |
403 (define-key global-map "\C-x>" 'scroll-right) | |
404 | |
405 (define-key global-map "\C-v" 'scroll-up) | |
406 (define-key global-map "\M-v" 'scroll-down) | |
407 (define-key global-map "\M-\C-v" 'scroll-other-window) | |
408 ; meta-shift-V, that is. | |
409 (define-key global-map '(meta V) 'scroll-other-window-down) | |
410 | |
411 (define-key global-map "\C-l" 'recenter) | |
412 (define-key global-map "\M-r" 'move-to-window-line) | |
413 | |
414 ;; FSFmacs window.el | |
415 | |
416 (define-key global-map "\C-x6" 'window-configuration-to-register) | |
417 ;(define-key global-map "\C-x7" 'jump-to-register);ie register-to-window-config | |
418 (define-key global-map "\C-x}" 'enlarge-window-horizontally) | |
419 (define-key global-map "\C-x{" 'shrink-window-horizontally) | |
420 ;; New FSF19 bindings | |
421 (define-key global-map "\C-x-" 'shrink-window-if-larger-than-buffer) | |
422 (define-key global-map "\C-x+" 'balance-windows) | |
423 | |
424 | |
425 ;;(define-key global-map "\C-g" 'keyboard-quit) | |
426 (let ((ch (quit-char))) | |
427 (if (or (characterp ch) (integerp ch)) | |
428 (setq ch (char-to-string ch))) | |
429 (define-key global-map ch 'keyboard-quit)) | |
430 (define-key global-map "\e\e\e" 'keyboard-escape-quit) | |
431 | |
432 | |
433 | |
434 | |
435 | |
436 | |
437 (define-key global-map "\M-%" 'query-replace) | |
438 | |
439 | |
440 ; autoloaded | |
441 ;(define-key global-map "\C-x4a" 'add-change-log-entry-other-window) | |
442 | |
443 ; autoloaded | |
444 ;(define-key global-map "\C-x`" 'next-error) | |
445 | |
446 ; autoloaded | |
447 ;(define-key global-map "\M-/" 'dabbrev-expand) | |
448 | |
449 ; autoloaded | |
450 ;(define-key global-map "\C-xd" 'dired) | |
451 | |
452 ; autoloaded | |
453 ;(define-key global-map "\C-x4d" 'dired-other-window) | |
454 | |
455 (define-key global-map "\M-$" 'ispell-word) | |
456 | |
457 (define-key global-map "\C-x4m" 'mail-other-window) | |
458 | |
459 (define-key global-map "\C-xm" 'mail) | |
460 | |
461 (define-key global-map "\M-." 'find-tag) | |
462 | |
463 (define-key global-map "\C-x4." 'find-tag-other-window) | |
464 | |
465 (define-key global-map "\M-," 'tags-loop-continue) | |
466 | |
467 | |
468 (define-key global-map '(control <) 'mark-beginning-of-buffer) | |
469 (define-key global-map '(control >) 'mark-end-of-buffer) | |
470 | |
471 (define-key global-map "\C-x\C-e" 'eval-last-sexp) ;bogus! | |
472 | |
473 | |
474 (define-key global-map "\M-g" 'goto-line) | |
475 | |
476 ;; Keypad type things | |
477 | |
478 ;; I removed all the fkey crap, because where-is is now smart enough | |
479 ;; to show all bindings. --ben | |
480 | |
481 ;;; These aren't bound to kbd macros like "\C-b" so that they have the | |
482 ;; expected behavior even in, for example, vi-mode. | |
483 | |
484 ;; We use here symbolic names, assuming that the corresponding keys will | |
485 ;; generate these keysyms. This is not true on Suns, but x-win-sun.el | |
486 ;; fixes that. If it turns out that the semantics of these keys should | |
487 ;; differ from server to server, this should be moved into server-specific | |
488 ;; files, but these appear to be the standard Motif and PC bindings. | |
489 | |
490 ;; movement by units | |
491 (define-key global-map 'left 'backward-char) | |
492 (define-key global-map 'up 'previous-line) | |
493 (define-key global-map 'right 'forward-char) | |
494 (define-key global-map 'down 'next-line) | |
495 | |
496 ;; movement by pages | |
497 (define-key global-map 'prior 'scroll-down) | |
498 (define-key global-map 'next 'scroll-up) | |
499 | |
500 ;; movement to the limits | |
501 (define-key global-map 'home 'beginning-of-line) | |
502 (define-key global-map 'end 'end-of-line) | |
503 | |
504 ;;; Miscellaneous key bindings | |
505 (define-key global-map 'again 'repeat-complex-command) | |
506 (define-key global-map 'insert 'overwrite-mode) | |
507 | |
508 ;;; These aren't bound to kbd macros like "\C-b" so that they have the | |
509 ;; expected behavior even in, for example, vi-mode. | |
510 | |
511 ;; We use here symbolic names, assuming that the corresponding keys will | |
512 ;; generate these keysyms. This is not true on Suns, but x-win-sun.el | |
513 ;; fixes that. If it turns out that the semantics of these keys should | |
514 ;; differ from server to server, this should be moved into server-specific | |
515 ;; files, but these appear to be the standard Motif and PC bindings. | |
516 | |
517 ;; potential R6isms | |
518 (define-key global-map 'kp_left 'backward-char) | |
519 (define-key global-map 'kp_up 'previous-line) | |
520 (define-key global-map 'kp_right 'forward-char) | |
521 (define-key global-map 'kp_down 'next-line) | |
522 | |
523 | |
524 ;; movement by larger blocks | |
525 (define-key global-map '(control left) 'backward-word) | |
526 (define-key global-map '(control up) #'(lambda () | |
527 (interactive "_") | |
528 (forward-line -6))) | |
529 (define-key global-map '(control right) 'forward-word) | |
530 (define-key global-map '(control down) #'(lambda () | |
531 (interactive "_") | |
532 (forward-line 6))) | |
533 | |
534 ;; context-sensitive movement | |
535 (define-key global-map '(meta left) 'backward-sexp) | |
536 (define-key global-map '(meta right) 'forward-sexp) | |
537 (define-key global-map '(meta up) 'backward-paragraph) | |
538 (define-key global-map '(meta down) 'forward-paragraph) | |
539 | |
540 ;; movement by pages | |
541 (define-key global-map '(control prior) 'scroll-right) | |
542 (define-key global-map '(control next) 'scroll-left) | |
543 ;; potential R6isms | |
544 (define-key global-map 'kp_prior 'scroll-down) | |
545 (define-key global-map 'kp_next 'scroll-up) | |
546 (define-key global-map '(control kp_prior) 'scroll-right) | |
547 (define-key global-map '(control kp_next) 'scroll-left) | |
548 | |
549 | |
550 ;; movement to the limits | |
551 (define-key global-map '(control home) 'beginning-of-buffer) | |
552 (define-key global-map '(control end) 'end-of-buffer) | |
553 (define-key global-map 'begin 'beginning-of-line) | |
554 (define-key global-map '(control begin) 'beginning-of-buffer) | |
555 ;; potential R6isms | |
556 (define-key global-map 'kp_home 'beginning-of-line) | |
557 (define-key global-map '(control kp_home) 'beginning-of-buffer) | |
558 (define-key global-map 'kp_end 'end-of-line) | |
559 (define-key global-map '(control kp_end) 'end-of-buffer) | |
560 | |
561 ;; movement between windows | |
562 (define-key global-map '(control tab) 'other-window) | |
563 (define-key global-map '(control shift tab) 'backward-other-window) | |
564 | |
565 ;; movement in other windows | |
566 (define-key global-map '(meta next) 'scroll-other-window) | |
567 (define-key global-map '(meta prior) 'scroll-other-window-down) | |
568 (define-key global-map '(meta home) 'beginning-of-buffer-other-window) | |
569 (define-key global-map '(meta end) 'end-of-buffer-other-window) | |
570 ;; potential R6isms | |
571 (define-key global-map '(meta kp_next) 'scroll-other-window) | |
572 (define-key global-map '(meta kp_prior) 'scroll-other-window-down) | |
573 (define-key global-map '(meta kp_home) 'beginning-of-buffer-other-window) | |
574 (define-key global-map '(meta kp_end) 'end-of-buffer-other-window) | |
575 | |
576 ;; potential R6isms | |
577 (define-key global-map 'redo 'repeat-complex-command) | |
578 (define-key global-map 'kp_insert 'overwrite-mode) | |
579 (define-key global-map 'kp_delete 'backward-delete-char-untabify) | |
580 | |
581 (define-key global-map 'kp_enter [return]) ; do whatever RET does now | |
582 (define-key global-map 'kp_tab [tab]) | |
583 | |
584 (define-key global-map 'undo 'undo) | |
585 (define-key global-map 'help 'help-for-help) | |
586 | |
587 (define-key global-map 'kp_space 'self-insert-command) | |
588 (define-key global-map 'kp_equal 'self-insert-command) | |
589 (define-key global-map 'kp_multiply 'self-insert-command) | |
590 (define-key global-map 'kp_add 'self-insert-command) | |
591 (define-key global-map 'kp_separator 'self-insert-command) | |
592 (define-key global-map 'kp_subtract 'self-insert-command) | |
593 (define-key global-map 'kp_decimal 'self-insert-command) | |
594 (define-key global-map 'kp_divide 'self-insert-command) | |
595 | |
596 (define-key global-map 'kp_0 'self-insert-command) | |
597 (define-key global-map 'kp_1 'self-insert-command) | |
598 (define-key global-map 'kp_2 'self-insert-command) | |
599 (define-key global-map 'kp_3 'self-insert-command) | |
600 (define-key global-map 'kp_4 'self-insert-command) | |
601 (define-key global-map 'kp_5 'self-insert-command) | |
602 (define-key global-map 'kp_6 'self-insert-command) | |
603 (define-key global-map 'kp_7 'self-insert-command) | |
604 (define-key global-map 'kp_8 'self-insert-command) | |
605 (define-key global-map 'kp_9 'self-insert-command) | |
606 | |
607 (define-key global-map 'select 'function-key-error) | |
608 (define-key global-map 'print 'function-key-error) | |
609 (define-key global-map 'execute 'execute-extended-command) | |
610 (define-key global-map 'clearline 'function-key-error) | |
611 (define-key global-map 'insertline 'open-line) | |
612 (define-key global-map 'deleteline 'kill-line) | |
613 (define-key global-map 'insertchar 'function-key-error) | |
614 (define-key global-map 'deletechar 'delete-char) |