Commit | Line | Data |
---|---|---|
60370d40 | 1 | ;;; pc-mode.el --- emulate certain key bindings used on PCs |
b578f267 | 2 | |
73b0cd50 | 3 | ;; Copyright (C) 1995, 2001-2011 Free Software Foundation, Inc. |
e0072c10 | 4 | |
070c251e | 5 | ;; Maintainer: FSF |
e0072c10 RS |
6 | ;; Keywords: emulations |
7 | ||
8 | ;; This file is part of GNU Emacs. | |
9 | ||
ed0f493f | 10 | ;; GNU Emacs is free software: you can redistribute it and/or modify |
e0072c10 | 11 | ;; it under the terms of the GNU General Public License as published by |
ed0f493f GM |
12 | ;; the Free Software Foundation, either version 3 of the License, or |
13 | ;; (at your option) any later version. | |
b578f267 | 14 | |
e0072c10 RS |
15 | ;; GNU Emacs is distributed in the hope that it will be useful, |
16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | ;; GNU General Public License for more details. | |
b578f267 | 19 | |
e0072c10 | 20 | ;; You should have received a copy of the GNU General Public License |
ed0f493f | 21 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
e0072c10 | 22 | |
60370d40 PJ |
23 | ;;; Commentary: |
24 | ||
b578f267 | 25 | ;;; Code: |
e0072c10 RS |
26 | |
27 | ;;;###autoload | |
601fa27a RS |
28 | (defun pc-bindings-mode () |
29 | "Set up certain key bindings for PC compatibility. | |
30 | The keys affected are: | |
002c4306 RS |
31 | Delete (and its variants) delete forward instead of backward. |
32 | C-Backspace kills backward a word (as C-Delete normally would). | |
33 | M-Backspace does undo. | |
34 | Home and End move to beginning and end of line | |
35 | C-Home and C-End move to beginning and end of buffer. | |
36 | C-Escape does list-buffers." | |
601fa27a RS |
37 | |
38 | (interactive) | |
39 | (define-key function-key-map [delete] "\C-d") | |
b6384070 RS |
40 | (define-key function-key-map [M-delete] [?\M-d]) |
41 | (define-key function-key-map [C-delete] [?\M-d]) | |
601fa27a | 42 | (global-set-key [C-M-delete] 'kill-sexp) |
b6384070 RS |
43 | (global-set-key [C-backspace] 'backward-kill-word) |
44 | (global-set-key [M-backspace] 'undo) | |
601fa27a | 45 | |
002c4306 RS |
46 | (global-set-key [C-escape] 'list-buffers) |
47 | ||
601fa27a RS |
48 | (global-set-key [home] 'beginning-of-line) |
49 | (global-set-key [end] 'end-of-line) | |
50 | (global-set-key [C-home] 'beginning-of-buffer) | |
51 | (global-set-key [C-end] 'end-of-buffer)) | |
52 | ||
896546cd RS |
53 | (provide 'pc-mode) |
54 | ||
60370d40 | 55 | ;;; pc-mode.el ends here |