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