Mercurial > emacs
annotate lisp/emulation/pc-mode.el @ 101330:eca9795f3903
* nsterm.h (EmacsApp-setAppleMenu:): Conditionalize more correctly on Tiger. * nsfns.m (ns_do_applescript): Conditionalize typeUTF16ExternalRepresentation on Tiger.
author | Adrian Robert <Adrian.B.Robert@gmail.com> |
---|---|
date | Thu, 22 Jan 2009 00:00:13 +0000 |
parents | a9dc0e7c3f2b |
children | 1d1d5d9bd884 |
rev | line source |
---|---|
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
18383
diff
changeset
|
1 ;;; pc-mode.el --- emulate certain key bindings used on PCs |
14169 | 2 |
74466 | 3 ;; Copyright (C) 1995, 2001, 2002, 2003, 2004, 2005, |
100908 | 4 ;; 2006, 2007, 2008, 2009 Free Software Foundation, Inc. |
12372
91dc931a32c8
(pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents:
11748
diff
changeset
|
5 |
38695 | 6 ;; Maintainer: FSF |
12372
91dc931a32c8
(pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents:
11748
diff
changeset
|
7 ;; Keywords: emulations |
91dc931a32c8
(pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents:
11748
diff
changeset
|
8 |
91dc931a32c8
(pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents:
11748
diff
changeset
|
9 ;; This file is part of GNU Emacs. |
91dc931a32c8
(pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents:
11748
diff
changeset
|
10 |
94658
eb7b2376cae5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
11 ;; GNU Emacs is free software: you can redistribute it and/or modify |
12372
91dc931a32c8
(pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents:
11748
diff
changeset
|
12 ;; it under the terms of the GNU General Public License as published by |
94658
eb7b2376cae5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
13 ;; the Free Software Foundation, either version 3 of the License, or |
eb7b2376cae5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
14 ;; (at your option) any later version. |
14169 | 15 |
12372
91dc931a32c8
(pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents:
11748
diff
changeset
|
16 ;; GNU Emacs is distributed in the hope that it will be useful, |
91dc931a32c8
(pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents:
11748
diff
changeset
|
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
91dc931a32c8
(pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents:
11748
diff
changeset
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
91dc931a32c8
(pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents:
11748
diff
changeset
|
19 ;; GNU General Public License for more details. |
14169 | 20 |
12372
91dc931a32c8
(pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents:
11748
diff
changeset
|
21 ;; You should have received a copy of the GNU General Public License |
94658
eb7b2376cae5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
12372
91dc931a32c8
(pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents:
11748
diff
changeset
|
23 |
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
18383
diff
changeset
|
24 ;;; Commentary: |
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
18383
diff
changeset
|
25 |
14169 | 26 ;;; Code: |
12372
91dc931a32c8
(pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents:
11748
diff
changeset
|
27 |
91dc931a32c8
(pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents:
11748
diff
changeset
|
28 ;;;###autoload |
11344 | 29 (defun pc-bindings-mode () |
30 "Set up certain key bindings for PC compatibility. | |
31 The keys affected are: | |
11748 | 32 Delete (and its variants) delete forward instead of backward. |
33 C-Backspace kills backward a word (as C-Delete normally would). | |
34 M-Backspace does undo. | |
35 Home and End move to beginning and end of line | |
36 C-Home and C-End move to beginning and end of buffer. | |
37 C-Escape does list-buffers." | |
11344 | 38 |
39 (interactive) | |
40 (define-key function-key-map [delete] "\C-d") | |
11747 | 41 (define-key function-key-map [M-delete] [?\M-d]) |
42 (define-key function-key-map [C-delete] [?\M-d]) | |
11344 | 43 (global-set-key [C-M-delete] 'kill-sexp) |
11747 | 44 (global-set-key [C-backspace] 'backward-kill-word) |
45 (global-set-key [M-backspace] 'undo) | |
11344 | 46 |
11748 | 47 (global-set-key [C-escape] 'list-buffers) |
48 | |
11344 | 49 (global-set-key [home] 'beginning-of-line) |
50 (global-set-key [end] 'end-of-line) | |
51 (global-set-key [C-home] 'beginning-of-buffer) | |
52 (global-set-key [C-end] 'end-of-buffer)) | |
53 | |
18383 | 54 (provide 'pc-mode) |
55 | |
93975
1e3a407766b9
Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
79705
diff
changeset
|
56 ;; arch-tag: df007c05-f885-4cd0-8c1e-487d0f8dd9c9 |
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
18383
diff
changeset
|
57 ;;; pc-mode.el ends here |