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