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