Mercurial > hg > xemacs-beta
comparison lisp/keydefs.el @ 412:697ef44129c6 r21-2-14
Import from CVS: tag r21-2-14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:20:41 +0200 |
parents | 501cfd01ee6d |
children |
comparison
equal
deleted
inserted
replaced
411:12e008d41344 | 412:697ef44129c6 |
---|---|
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. | |
5 | 4 |
6 ;; Maintainer: XEmacs Development Team | 5 ;; Maintainer: XEmacs Development Team |
7 ;; Keywords: internal, dumped | 6 ;; Keywords: internal, dumped |
8 | 7 |
9 ;; This file is part of XEmacs. | 8 ;; This file is part of XEmacs. |
105 (define-key global-map "\C-a" 'beginning-of-line) | 104 (define-key global-map "\C-a" 'beginning-of-line) |
106 (define-key global-map "\C-b" 'backward-char-command) | 105 (define-key global-map "\C-b" 'backward-char-command) |
107 (define-key global-map "\C-e" 'end-of-line) | 106 (define-key global-map "\C-e" 'end-of-line) |
108 (define-key global-map "\C-f" 'forward-char-command) | 107 (define-key global-map "\C-f" 'forward-char-command) |
109 (define-key global-map "\C-d" 'delete-char) | 108 (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) | |
110 | 112 |
111 ;; FSFmacs files.el | 113 ;; FSFmacs files.el |
112 | 114 |
113 (define-key global-map "\C-x\C-f" 'find-file) | 115 (define-key global-map "\C-x\C-f" 'find-file) |
114 (define-key global-map "\C-x\C-q" 'toggle-read-only) | 116 (define-key global-map "\C-x\C-q" 'toggle-read-only) |
236 (define-key global-map '(meta -) 'negative-argument) | 238 (define-key global-map '(meta -) 'negative-argument) |
237 (define-key global-map '(control -) 'negative-argument) | 239 (define-key global-map '(control -) 'negative-argument) |
238 (define-key global-map '(control meta -) 'negative-argument) | 240 (define-key global-map '(control meta -) 'negative-argument) |
239 | 241 |
240 (define-key global-map "\C-k" 'kill-line) | 242 (define-key global-map "\C-k" 'kill-line) |
241 (define-key global-map '(control K) 'historical-kill-line) | |
242 (define-key global-map "\C-w" 'kill-region) | 243 (define-key global-map "\C-w" 'kill-region) |
243 (define-key global-map "\M-w" 'kill-ring-save) | 244 (define-key global-map "\M-w" 'kill-ring-save) |
244 (define-key global-map "\M-\C-w" 'append-next-kill) | 245 (define-key global-map "\M-\C-w" 'append-next-kill) |
245 (define-key global-map "\C-y" 'yank) | 246 (define-key global-map "\C-y" 'yank) |
246 (define-key global-map "\M-y" 'yank-pop) | 247 (define-key global-map "\M-y" 'yank-pop) |
301 (define-key global-map "\M-\C-e" 'end-of-defun) | 302 (define-key global-map "\M-\C-e" 'end-of-defun) |
302 (define-key global-map "\M-\C-h" 'mark-defun) | 303 (define-key global-map "\M-\C-h" 'mark-defun) |
303 (define-key global-map "\M-\(" 'insert-parentheses) | 304 (define-key global-map "\M-\(" 'insert-parentheses) |
304 (define-key global-map "\M-\)" 'move-past-close-and-reindent) | 305 (define-key global-map "\M-\)" 'move-past-close-and-reindent) |
305 (define-key global-map "\M-\t" 'lisp-complete-symbol) | 306 (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) | |
306 | 310 |
307 | 311 |
308 (define-key global-map "\C-x/" 'point-to-register) | 312 (define-key global-map "\C-x/" 'point-to-register) |
309 (define-key global-map "\C-xj" 'jump-to-register) | 313 (define-key global-map "\C-xj" 'jump-to-register) |
310 (define-key global-map "\C-xx" 'copy-to-register) | 314 (define-key global-map "\C-xx" 'copy-to-register) |
383 | 387 |
384 ;; Default binding of "Backspace" is no longer the same as delete. | 388 ;; Default binding of "Backspace" is no longer the same as delete. |
385 ;; Default binding of "Control-h" is help. | 389 ;; Default binding of "Control-h" is help. |
386 (define-key global-map 'backspace 'delete-backward-char) | 390 (define-key global-map 'backspace 'delete-backward-char) |
387 (define-key global-map '(meta backspace) 'backward-kill-word) | 391 (define-key global-map '(meta backspace) 'backward-kill-word) |
388 (define-key global-map [(control x) backspace] 'backward-kill-sentence) | |
389 | 392 |
390 (define-key global-map "\M-\C-z" 'activate-region) | 393 (define-key global-map "\M-\C-z" 'activate-region) |
391 | 394 |
392 ;; FSFmacs macros.c | 395 ;; FSFmacs macros.c |
393 | 396 |
505 ;; differ from server to server, this should be moved into server-specific | 508 ;; differ from server to server, this should be moved into server-specific |
506 ;; files, but these appear to be the standard Motif and PC bindings. | 509 ;; files, but these appear to be the standard Motif and PC bindings. |
507 | 510 |
508 ;; movement by units | 511 ;; movement by units |
509 (define-key global-map 'left 'backward-char-command) | 512 (define-key global-map 'left 'backward-char-command) |
513 (define-key global-map 'up 'previous-line) | |
510 (define-key global-map 'right 'forward-char-command) | 514 (define-key global-map 'right 'forward-char-command) |
511 (define-key global-map 'up 'previous-line) | |
512 (define-key global-map 'down 'next-line) | 515 (define-key global-map 'down 'next-line) |
513 (define-key global-map 'kp-left 'backward-char-command) | |
514 (define-key global-map 'kp-right 'forward-char-command) | |
515 (define-key global-map 'kp-up 'previous-line) | |
516 (define-key global-map 'kp-down 'next-line) | |
517 | 516 |
518 ;; movement by pages | 517 ;; movement by pages |
519 (define-key global-map 'prior 'scroll-down-command) | 518 (define-key global-map 'prior 'scroll-down-command) |
520 (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 | |
521 (define-key global-map '(control prior) 'scroll-right) | 562 (define-key global-map '(control prior) 'scroll-right) |
522 (define-key global-map '(control next) 'scroll-left) | 563 (define-key global-map '(control next) 'scroll-left) |
564 ;; potential R6isms | |
523 (define-key global-map 'kp-prior 'scroll-down-command) | 565 (define-key global-map 'kp-prior 'scroll-down-command) |
524 (define-key global-map 'kp-next 'scroll-up-command) | 566 (define-key global-map 'kp-next 'scroll-up-command) |
525 (define-key global-map '(control kp-prior) 'scroll-right) | 567 (define-key global-map '(control kp-prior) 'scroll-right) |
526 (define-key global-map '(control kp-next) 'scroll-left) | 568 (define-key global-map '(control kp-next) 'scroll-left) |
527 | 569 |
570 | |
528 ;; movement to the limits | 571 ;; movement to the limits |
529 (define-key global-map 'home 'beginning-of-line) | |
530 (define-key global-map 'end 'end-of-line) | |
531 (define-key global-map '(control home) 'beginning-of-buffer) | 572 (define-key global-map '(control home) 'beginning-of-buffer) |
532 (define-key global-map '(control end) 'end-of-buffer) | 573 (define-key global-map '(control end) 'end-of-buffer) |
533 (define-key global-map 'kp-home 'beginning-of-line) | |
534 (define-key global-map 'kp-end 'end-of-line) | |
535 (define-key global-map '(control kp-home) 'beginning-of-buffer) | |
536 (define-key global-map '(control kp-end) 'end-of-buffer) | |
537 | |
538 ;; on which systems do these exist? | |
539 (define-key global-map 'begin 'beginning-of-line) | 574 (define-key global-map 'begin 'beginning-of-line) |
540 (define-key global-map '(control begin) 'beginning-of-buffer) | 575 (define-key global-map '(control begin) 'beginning-of-buffer) |
541 | 576 ;; potential R6isms |
542 ;; movement by larger blocks | 577 (define-key global-map 'kp-home 'beginning-of-line) |
543 (define-key global-map '(control left) 'backward-word) | 578 (define-key global-map '(control kp-home) 'beginning-of-buffer) |
544 (define-key global-map '(control right) 'forward-word) | 579 (define-key global-map 'kp-end 'end-of-line) |
545 (define-key global-map '(control up) 'backward-block-of-lines) | 580 (define-key global-map '(control kp-end) 'end-of-buffer) |
546 (define-key global-map '(control down) 'forward-block-of-lines) | |
547 (define-key global-map '(control kp-left) 'backward-word) | |
548 (define-key global-map '(control kp-right) 'forward-word) | |
549 (define-key global-map '(control kp-up) 'backward-block-of-lines) | |
550 (define-key global-map '(control kp-down) 'forward-block-of-lines) | |
551 | |
552 ;; context-sensitive movement | |
553 (define-key global-map '(meta left) 'backward-sexp) | |
554 (define-key global-map '(meta right) 'forward-sexp) | |
555 (define-key global-map '(meta up) 'backward-paragraph) | |
556 (define-key global-map '(meta down) 'forward-paragraph) | |
557 (define-key global-map '(meta control left) 'backward-sentence) | |
558 (define-key global-map '(meta control right) 'forward-sentence) | |
559 (define-key global-map '(meta control up) 'scroll-down-one) | |
560 (define-key global-map '(meta control down) 'scroll-up-one) | |
561 (define-key global-map '(meta control home) 'beginning-of-defun) | |
562 (define-key global-map '(meta control end) 'end-of-defun) | |
563 (define-key global-map '(meta control prior) 'backward-page) | |
564 (define-key global-map '(meta control next) 'forward-page) | |
565 (define-key global-map '(meta kp-left) 'backward-sexp) | |
566 (define-key global-map '(meta kp-right) 'forward-sexp) | |
567 (define-key global-map '(meta kp-up) 'backward-paragraph) | |
568 (define-key global-map '(meta kp-down) 'forward-paragraph) | |
569 (define-key global-map '(meta control kp-left) 'backward-sentence) | |
570 (define-key global-map '(meta control kp-right) 'forward-sentence) | |
571 (define-key global-map '(meta control kp-up) 'scroll-down-one) | |
572 (define-key global-map '(meta control kp-down) 'scroll-up-one) | |
573 (define-key global-map '(meta control kp-home) 'beginning-of-defun) | |
574 (define-key global-map '(meta control kp-end) 'end-of-defun) | |
575 (define-key global-map '(meta control kp-prior) 'backward-page) | |
576 (define-key global-map '(meta control kp-next) 'forward-page) | |
577 | 581 |
578 ;; movement between windows | 582 ;; movement between windows |
579 (define-key global-map '(control tab) 'other-window) | 583 (define-key global-map '(control tab) 'other-window) |
580 (define-key global-map '(control shift tab) 'backward-other-window) | 584 (define-key global-map '(control shift tab) 'backward-other-window) |
581 | 585 |
582 ;; movement in other windows | 586 ;; movement in other windows |
583 (define-key global-map '(meta next) 'scroll-other-window) | 587 (define-key global-map '(meta next) 'scroll-other-window) |
584 (define-key global-map '(meta prior) 'scroll-other-window-down) | 588 (define-key global-map '(meta prior) 'scroll-other-window-down) |
585 (define-key global-map '(meta home) 'beginning-of-buffer-other-window) | 589 (define-key global-map '(meta home) 'beginning-of-buffer-other-window) |
586 (define-key global-map '(meta end) 'end-of-buffer-other-window) | 590 (define-key global-map '(meta end) 'end-of-buffer-other-window) |
591 ;; potential R6isms | |
587 (define-key global-map '(meta kp-next) 'scroll-other-window) | 592 (define-key global-map '(meta kp-next) 'scroll-other-window) |
588 (define-key global-map '(meta kp-prior) 'scroll-other-window-down) | 593 (define-key global-map '(meta kp-prior) 'scroll-other-window-down) |
589 (define-key global-map '(meta kp-home) 'beginning-of-buffer-other-window) | 594 (define-key global-map '(meta kp-home) 'beginning-of-buffer-other-window) |
590 (define-key global-map '(meta kp-end) 'end-of-buffer-other-window) | 595 (define-key global-map '(meta kp-end) 'end-of-buffer-other-window) |
591 | 596 |
592 ;; the infamous delete key | 597 ;; potential R6isms |
593 (define-key global-map 'delete 'backward-or-forward-delete-char) | 598 (define-key global-map 'redo 'repeat-complex-command) |
594 (define-key global-map '(meta delete) 'backward-or-forward-kill-word) | |
595 (define-key global-map [(control x) (delete)] | |
596 'backward-or-forward-kill-sentence) | |
597 (define-key global-map 'kp-delete 'backward-or-forward-delete-char) | |
598 (define-key global-map '(meta kp-delete) 'backward-or-forward-kill-word) | |
599 (define-key global-map [(control x) (kp-delete)] | |
600 'backward-or-forward-kill-sentence) | |
601 | |
602 ;; don't try this one at home, kids. | |
603 (define-key global-map '(control meta delete) 'backward-or-forward-kill-sexp) | |
604 (define-key global-map '(control meta kp-delete) 'backward-or-forward-kill-sexp) | |
605 ;; or this one, either, on Linux. | |
606 (define-key global-map '(control meta backspace) 'backward-kill-sexp) | |
607 | |
608 | |
609 ;;; Miscellaneous key bindings | |
610 (define-key global-map 'insert 'overwrite-mode) | |
611 (define-key global-map 'kp-insert 'overwrite-mode) | 599 (define-key global-map 'kp-insert 'overwrite-mode) |
612 (define-key global-map 'again 'repeat-complex-command) | 600 (define-key global-map 'kp-delete 'backward-delete-char-untabify) |
613 (define-key global-map 'redo 'repeat-complex-command) | |
614 | 601 |
615 (define-key global-map 'kp-enter [return]) ; do whatever RET does now | 602 (define-key global-map 'kp-enter [return]) ; do whatever RET does now |
616 (define-key global-map 'kp-tab [tab]) | 603 (define-key global-map 'kp-tab [tab]) |
617 | 604 |
618 (define-key global-map 'undo 'undo) | 605 (define-key global-map 'undo 'undo) |