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