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