Mercurial > hg > xemacs-beta
comparison lisp/keydefs.el @ 404:2f8bb876ab1d r21-2-32
Import from CVS: tag r21-2-32
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:16:07 +0200 |
parents | 6240c7796c7a |
children | 501cfd01ee6d |
comparison
equal
deleted
inserted
replaced
403:9f011ab08d48 | 404:2f8bb876ab1d |
---|---|
1 ;;; keydefs.el --- Define standard keybindings. | 1 ;;; keydefs.el --- Define standard keybindings. |
2 | 2 |
3 ;; Copyright (C) 1992-4, 1997 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1992-4, 1997 Free Software Foundation, Inc. |
4 ;; Copyright (C) 2000 Ben Wing. | |
4 | 5 |
5 ;; Maintainer: XEmacs Development Team | 6 ;; Maintainer: XEmacs Development Team |
6 ;; Keywords: internal, dumped | 7 ;; Keywords: internal, dumped |
7 | 8 |
8 ;; This file is part of XEmacs. | 9 ;; This file is part of XEmacs. |
104 (define-key global-map "\C-a" 'beginning-of-line) | 105 (define-key global-map "\C-a" 'beginning-of-line) |
105 (define-key global-map "\C-b" 'backward-char-command) | 106 (define-key global-map "\C-b" 'backward-char-command) |
106 (define-key global-map "\C-e" 'end-of-line) | 107 (define-key global-map "\C-e" 'end-of-line) |
107 (define-key global-map "\C-f" 'forward-char-command) | 108 (define-key global-map "\C-f" 'forward-char-command) |
108 (define-key global-map "\C-d" 'delete-char) | 109 (define-key global-map "\C-d" 'delete-char) |
109 (define-key global-map 'delete 'backward-or-forward-delete-char) | |
110 (define-key global-map '(meta delete) 'backward-or-forward-kill-word) | |
111 (define-key global-map [(control x) (delete)] 'backward-or-forward-kill-sentence) | |
112 | 110 |
113 ;; FSFmacs files.el | 111 ;; FSFmacs files.el |
114 | 112 |
115 (define-key global-map "\C-x\C-f" 'find-file) | 113 (define-key global-map "\C-x\C-f" 'find-file) |
116 (define-key global-map "\C-x\C-q" 'toggle-read-only) | 114 (define-key global-map "\C-x\C-q" 'toggle-read-only) |
238 (define-key global-map '(meta -) 'negative-argument) | 236 (define-key global-map '(meta -) 'negative-argument) |
239 (define-key global-map '(control -) 'negative-argument) | 237 (define-key global-map '(control -) 'negative-argument) |
240 (define-key global-map '(control meta -) 'negative-argument) | 238 (define-key global-map '(control meta -) 'negative-argument) |
241 | 239 |
242 (define-key global-map "\C-k" 'kill-line) | 240 (define-key global-map "\C-k" 'kill-line) |
241 (define-key global-map '(control K) 'historical-kill-line) | |
243 (define-key global-map "\C-w" 'kill-region) | 242 (define-key global-map "\C-w" 'kill-region) |
244 (define-key global-map "\M-w" 'kill-ring-save) | 243 (define-key global-map "\M-w" 'kill-ring-save) |
245 (define-key global-map "\M-\C-w" 'append-next-kill) | 244 (define-key global-map "\M-\C-w" 'append-next-kill) |
246 (define-key global-map "\C-y" 'yank) | 245 (define-key global-map "\C-y" 'yank) |
247 (define-key global-map "\M-y" 'yank-pop) | 246 (define-key global-map "\M-y" 'yank-pop) |
302 (define-key global-map "\M-\C-e" 'end-of-defun) | 301 (define-key global-map "\M-\C-e" 'end-of-defun) |
303 (define-key global-map "\M-\C-h" 'mark-defun) | 302 (define-key global-map "\M-\C-h" 'mark-defun) |
304 (define-key global-map "\M-\(" 'insert-parentheses) | 303 (define-key global-map "\M-\(" 'insert-parentheses) |
305 (define-key global-map "\M-\)" 'move-past-close-and-reindent) | 304 (define-key global-map "\M-\)" 'move-past-close-and-reindent) |
306 (define-key global-map "\M-\t" 'lisp-complete-symbol) | 305 (define-key global-map "\M-\t" 'lisp-complete-symbol) |
307 | |
308 (define-key global-map '(control meta backspace) 'backward-kill-sexp) | |
309 (define-key global-map '(control meta delete) 'backward-or-forward-kill-sexp) | |
310 | 306 |
311 | 307 |
312 (define-key global-map "\C-x/" 'point-to-register) | 308 (define-key global-map "\C-x/" 'point-to-register) |
313 (define-key global-map "\C-xj" 'jump-to-register) | 309 (define-key global-map "\C-xj" 'jump-to-register) |
314 (define-key global-map "\C-xx" 'copy-to-register) | 310 (define-key global-map "\C-xx" 'copy-to-register) |
508 ;; differ from server to server, this should be moved into server-specific | 504 ;; differ from server to server, this should be moved into server-specific |
509 ;; files, but these appear to be the standard Motif and PC bindings. | 505 ;; files, but these appear to be the standard Motif and PC bindings. |
510 | 506 |
511 ;; movement by units | 507 ;; movement by units |
512 (define-key global-map 'left 'backward-char-command) | 508 (define-key global-map 'left 'backward-char-command) |
509 (define-key global-map 'right 'forward-char-command) | |
513 (define-key global-map 'up 'previous-line) | 510 (define-key global-map 'up 'previous-line) |
514 (define-key global-map 'right 'forward-char-command) | |
515 (define-key global-map 'down 'next-line) | 511 (define-key global-map 'down 'next-line) |
512 (define-key global-map 'kp-left 'backward-char-command) | |
513 (define-key global-map 'kp-right 'forward-char-command) | |
514 (define-key global-map 'kp-up 'previous-line) | |
515 (define-key global-map 'kp-down 'next-line) | |
516 | 516 |
517 ;; movement by pages | 517 ;; movement by pages |
518 (define-key global-map 'prior 'scroll-down-command) | 518 (define-key global-map 'prior 'scroll-down-command) |
519 (define-key global-map 'next 'scroll-up-command) | 519 (define-key global-map 'next 'scroll-up-command) |
520 | |
521 ;; movement to the limits | |
522 (define-key global-map 'home 'beginning-of-line) | |
523 (define-key global-map 'end 'end-of-line) | |
524 | |
525 ;;; Miscellaneous key bindings | |
526 (define-key global-map 'again 'repeat-complex-command) | |
527 (define-key global-map 'insert 'overwrite-mode) | |
528 | |
529 ;;; These aren't bound to kbd macros like "\C-b" so that they have the | |
530 ;; expected behavior even in, for example, vi-mode. | |
531 | |
532 ;; We use here symbolic names, assuming that the corresponding keys will | |
533 ;; generate these keysyms. This is not true on Suns, but x-win-sun.el | |
534 ;; fixes that. If it turns out that the semantics of these keys should | |
535 ;; differ from server to server, this should be moved into server-specific | |
536 ;; files, but these appear to be the standard Motif and PC bindings. | |
537 | |
538 ;; potential R6isms | |
539 (define-key global-map 'kp-left 'backward-char-command) | |
540 (define-key global-map 'kp-up 'previous-line) | |
541 (define-key global-map 'kp-right 'forward-char-command) | |
542 (define-key global-map 'kp-down 'next-line) | |
543 | |
544 | |
545 ;; movement by larger blocks | |
546 (define-key global-map '(control left) 'backward-word) | |
547 (define-key global-map '(control up) #'(lambda () | |
548 (interactive "_") | |
549 (forward-line -6))) | |
550 (define-key global-map '(control right) 'forward-word) | |
551 (define-key global-map '(control down) #'(lambda () | |
552 (interactive "_") | |
553 (forward-line 6))) | |
554 | |
555 ;; context-sensitive movement | |
556 (define-key global-map '(meta left) 'backward-sexp) | |
557 (define-key global-map '(meta right) 'forward-sexp) | |
558 (define-key global-map '(meta up) 'backward-paragraph) | |
559 (define-key global-map '(meta down) 'forward-paragraph) | |
560 | |
561 ;; movement by pages | |
562 (define-key global-map '(control prior) 'scroll-right) | 520 (define-key global-map '(control prior) 'scroll-right) |
563 (define-key global-map '(control next) 'scroll-left) | 521 (define-key global-map '(control next) 'scroll-left) |
564 ;; potential R6isms | |
565 (define-key global-map 'kp-prior 'scroll-down-command) | 522 (define-key global-map 'kp-prior 'scroll-down-command) |
566 (define-key global-map 'kp-next 'scroll-up-command) | 523 (define-key global-map 'kp-next 'scroll-up-command) |
567 (define-key global-map '(control kp-prior) 'scroll-right) | 524 (define-key global-map '(control kp-prior) 'scroll-right) |
568 (define-key global-map '(control kp-next) 'scroll-left) | 525 (define-key global-map '(control kp-next) 'scroll-left) |
569 | 526 |
570 | |
571 ;; movement to the limits | 527 ;; movement to the limits |
528 (define-key global-map 'home 'beginning-of-line) | |
529 (define-key global-map 'end 'end-of-line) | |
572 (define-key global-map '(control home) 'beginning-of-buffer) | 530 (define-key global-map '(control home) 'beginning-of-buffer) |
573 (define-key global-map '(control end) 'end-of-buffer) | 531 (define-key global-map '(control end) 'end-of-buffer) |
532 (define-key global-map 'kp-home 'beginning-of-line) | |
533 (define-key global-map 'kp-end 'end-of-line) | |
534 (define-key global-map '(control kp-home) 'beginning-of-buffer) | |
535 (define-key global-map '(control kp-end) 'end-of-buffer) | |
536 | |
537 ;; on which systems do these exist? | |
574 (define-key global-map 'begin 'beginning-of-line) | 538 (define-key global-map 'begin 'beginning-of-line) |
575 (define-key global-map '(control begin) 'beginning-of-buffer) | 539 (define-key global-map '(control begin) 'beginning-of-buffer) |
576 ;; potential R6isms | 540 |
577 (define-key global-map 'kp-home 'beginning-of-line) | 541 ;; movement by larger blocks |
578 (define-key global-map '(control kp-home) 'beginning-of-buffer) | 542 (define-key global-map '(control left) 'backward-word) |
579 (define-key global-map 'kp-end 'end-of-line) | 543 (define-key global-map '(control right) 'forward-word) |
580 (define-key global-map '(control kp-end) 'end-of-buffer) | 544 (define-key global-map '(control up) 'backward-block-of-lines) |
545 (define-key global-map '(control down) 'forward-block-of-lines) | |
546 (define-key global-map '(control kp-left) 'backward-word) | |
547 (define-key global-map '(control kp-right) 'forward-word) | |
548 (define-key global-map '(control kp-up) 'backward-block-of-lines) | |
549 (define-key global-map '(control kp-down) 'forward-block-of-lines) | |
550 | |
551 ;; context-sensitive movement | |
552 ;; (meta control left/right) should be reserved for bindings that | |
553 ;; switch between buffers/web pages/etc. | |
554 (define-key global-map '(meta left) 'backward-sexp) | |
555 (define-key global-map '(meta right) 'forward-sexp) | |
556 (define-key global-map '(meta up) 'backward-sentence) | |
557 (define-key global-map '(meta down) 'forward-sentence) | |
558 (define-key global-map '(meta control up) 'backward-paragraph) | |
559 (define-key global-map '(meta control down) 'forward-paragraph) | |
560 (define-key global-map '(meta control home) 'beginning-of-defun) | |
561 (define-key global-map '(meta control end) 'end-of-defun) | |
562 (define-key global-map '(meta control prior) 'backward-page) | |
563 (define-key global-map '(meta control next) 'forward-page) | |
564 (define-key global-map '(meta kp-left) 'backward-sexp) | |
565 (define-key global-map '(meta kp-right) 'forward-sexp) | |
566 (define-key global-map '(meta kp-up) 'backward-sentence) | |
567 (define-key global-map '(meta kp-down) 'forward-sentence) | |
568 (define-key global-map '(meta control kp-up) 'backward-paragraph) | |
569 (define-key global-map '(meta control kp-down) 'forward-paragraph) | |
570 (define-key global-map '(meta control kp-home) 'beginning-of-defun) | |
571 (define-key global-map '(meta control kp-end) 'end-of-defun) | |
572 (define-key global-map '(meta control kp-prior) 'backward-page) | |
573 (define-key global-map '(meta control kp-next) 'forward-page) | |
581 | 574 |
582 ;; movement between windows | 575 ;; movement between windows |
583 (define-key global-map '(control tab) 'other-window) | 576 (define-key global-map '(control tab) 'other-window) |
584 (define-key global-map '(control shift tab) 'backward-other-window) | 577 (define-key global-map '(control shift tab) 'backward-other-window) |
585 | 578 |
586 ;; movement in other windows | 579 ;; movement in other windows |
587 (define-key global-map '(meta next) 'scroll-other-window) | 580 (define-key global-map '(meta next) 'scroll-other-window) |
588 (define-key global-map '(meta prior) 'scroll-other-window-down) | 581 (define-key global-map '(meta prior) 'scroll-other-window-down) |
589 (define-key global-map '(meta home) 'beginning-of-buffer-other-window) | 582 (define-key global-map '(meta home) 'beginning-of-buffer-other-window) |
590 (define-key global-map '(meta end) 'end-of-buffer-other-window) | 583 (define-key global-map '(meta end) 'end-of-buffer-other-window) |
591 ;; potential R6isms | |
592 (define-key global-map '(meta kp-next) 'scroll-other-window) | 584 (define-key global-map '(meta kp-next) 'scroll-other-window) |
593 (define-key global-map '(meta kp-prior) 'scroll-other-window-down) | 585 (define-key global-map '(meta kp-prior) 'scroll-other-window-down) |
594 (define-key global-map '(meta kp-home) 'beginning-of-buffer-other-window) | 586 (define-key global-map '(meta kp-home) 'beginning-of-buffer-other-window) |
595 (define-key global-map '(meta kp-end) 'end-of-buffer-other-window) | 587 (define-key global-map '(meta kp-end) 'end-of-buffer-other-window) |
596 | 588 |
597 ;; potential R6isms | 589 ;; the infamous delete key |
590 (define-key global-map 'delete 'backward-or-forward-delete-char) | |
591 (define-key global-map '(meta delete) 'backward-or-forward-kill-word) | |
592 (define-key global-map [(control x) (delete)] | |
593 'backward-or-forward-kill-sentence) | |
594 (define-key global-map 'kp-delete 'backward-or-forward-delete-char) | |
595 (define-key global-map '(meta kp-delete) 'backward-or-forward-kill-word) | |
596 (define-key global-map [(control x) (kp-delete)] | |
597 'backward-or-forward-kill-sentence) | |
598 | |
599 ;; don't try this one at home, kids. | |
600 (define-key global-map '(control meta delete) 'backward-or-forward-kill-sexp) | |
601 (define-key global-map '(control meta kp-delete) 'backward-or-forward-kill-sexp) | |
602 ;; or this one, either, on Linux. | |
603 (define-key global-map '(control meta backspace) 'backward-kill-sexp) | |
604 | |
605 | |
606 ;;; Miscellaneous key bindings | |
607 (define-key global-map 'insert 'overwrite-mode) | |
608 (define-key global-map 'kp-insert 'overwrite-mode) | |
609 (define-key global-map 'again 'repeat-complex-command) | |
598 (define-key global-map 'redo 'repeat-complex-command) | 610 (define-key global-map 'redo 'repeat-complex-command) |
599 (define-key global-map 'kp-insert 'overwrite-mode) | |
600 (define-key global-map 'kp-delete 'backward-delete-char-untabify) | |
601 | 611 |
602 (define-key global-map 'kp-enter [return]) ; do whatever RET does now | 612 (define-key global-map 'kp-enter [return]) ; do whatever RET does now |
603 (define-key global-map 'kp-tab [tab]) | 613 (define-key global-map 'kp-tab [tab]) |
604 | 614 |
605 (define-key global-map 'undo 'undo) | 615 (define-key global-map 'undo 'undo) |