Mercurial > emacs
annotate lisp/=gosmacs.el @ 16842:72276b334084 before-thomas-posix1996 glibc-2_0_2 libc-970108 libc-970109 libc-970110 libc-970111 libc-970112 libc-970113 libc-970114 libc-970115 libc-970116 libc-970117 libc-970118 libc-970119 libc-970120 libc-970121 libc-970122 libc-970123 libc-970124 libc-970125 libc-970126 libc-970127 libc-970128 libc-970129 libc-970130 libc-970131 libc-970201 libc-970202 libc-970203 libc-970204 libc-970205 libc-970206 libc-970207 libc-970208 libc-970209 libc-970210 libc-970211 libc-970212 libc-970213 libc-970214 libc-970215 libc-970216 libc-970217 libc-970218 libc-970219 libc-970220 libc-970221 libc-970222 libc-970223 libc-970224 libc-970225 libc-970226 libc-970227 libc-970228 libc-970301 libc-970302 libc-970303 libc-970304 libc-970305 libc-970306 libc-970307 libc-970308 libc-970309 libc-970310 libc-970311 libc-970312 libc-970313 libc-970314 libc-970315 libc-970316 libc-970317 libc-970318 libc-970319 libc-970320 libc-970321 libc-970322 libc-970323 libc-970324 libc20x-970306 libc20x-97031 libc20x-970316 libc20x-970318 libc20x-970319 libc20x-970404 root-libc-2_0_x-branch
Add hppa1.1-hitachi-hiuxmpp support, passed along by rms.
author | David J. MacKenzie <djm@gnu.org> |
---|---|
date | Tue, 07 Jan 1997 19:29:28 +0000 |
parents | afb11b3822c2 |
children |
rev | line source |
---|---|
660
08eb386dd0f3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
258
diff
changeset
|
1 ;;; gosmacs.el --- rebindings to imitate Gosmacs. |
08eb386dd0f3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
258
diff
changeset
|
2 |
845 | 3 ;; Copyright (C) 1986 Free Software Foundation, Inc. |
4 | |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
660
diff
changeset
|
5 ;; Maintainer: FSF |
811
e694e0879463
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
807
diff
changeset
|
6 ;; Keywords: emulations |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
660
diff
changeset
|
7 |
36 | 8 ;; This file is part of GNU Emacs. |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
660
diff
changeset
|
12 ;; the Free Software Foundation; either version 2, or (at your option) |
36 | 13 ;; any later version. |
14 | |
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. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
21 ;; along with GNU Emacs; see the file COPYING. If not, write to | |
22 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
23 | |
2307
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1864
diff
changeset
|
24 ;;; Commentary: |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1864
diff
changeset
|
25 |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1864
diff
changeset
|
26 ;; Make GNU Emacs look like Gosling Emacs. `M-x set-gosmacs-bindings' |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1864
diff
changeset
|
27 ;; does this change; `M-x set-gnu-bindings' undoes it. |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1864
diff
changeset
|
28 |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
660
diff
changeset
|
29 ;;; Code: |
36 | 30 |
1864
1354a2911d11
* gosmacs.el: Bind M-h to delete-previous-word, not
Jim Blandy <jimb@redhat.com>
parents:
1850
diff
changeset
|
31 (require 'mlsupport) |
1354a2911d11
* gosmacs.el: Bind M-h to delete-previous-word, not
Jim Blandy <jimb@redhat.com>
parents:
1850
diff
changeset
|
32 |
36 | 33 (defvar non-gosmacs-binding-alist nil) |
34 | |
258 | 35 ;;;###autoload |
36 | 36 (defun set-gosmacs-bindings () |
37 "Rebind some keys globally to make GNU Emacs resemble Gosling Emacs. | |
38 Use \\[set-gnu-bindings] to restore previous global bindings." | |
39 (interactive) | |
40 (setq non-gosmacs-binding-alist | |
41 (rebind-and-record | |
42 '(("\C-x\C-e" compile) | |
43 ("\C-x\C-f" save-buffers-kill-emacs) | |
44 ("\C-x\C-i" insert-file) | |
45 ("\C-x\C-m" save-some-buffers) | |
46 ("\C-x\C-n" next-error) | |
47 ("\C-x\C-o" switch-to-buffer) | |
48 ("\C-x\C-r" insert-file) | |
2411 | 49 ("\C-x\C-u" undo) |
36 | 50 ("\C-x\C-v" find-file-other-window) |
51 ("\C-x\C-z" shrink-window) | |
52 ("\C-x!" shell-command) | |
53 ("\C-xd" delete-window) | |
54 ("\C-xn" gosmacs-next-window) | |
55 ("\C-xp" gosmacs-previous-window) | |
56 ("\C-xz" enlarge-window) | |
57 ("\C-z" scroll-one-line-up) | |
58 ("\e\C-c" save-buffers-kill-emacs) | |
59 ("\e!" line-to-top-of-window) | |
60 ("\e(" backward-paragraph) | |
61 ("\e)" forward-paragraph) | |
62 ("\e?" apropos) | |
1864
1354a2911d11
* gosmacs.el: Bind M-h to delete-previous-word, not
Jim Blandy <jimb@redhat.com>
parents:
1850
diff
changeset
|
63 ("\eh" delete-previous-word) |
36 | 64 ("\ej" indent-sexp) |
65 ("\eq" query-replace) | |
66 ("\er" replace-string) | |
67 ("\ez" scroll-one-line-down) | |
68 ("\C-_" suspend-emacs))))) | |
69 | |
70 (defun rebind-and-record (bindings) | |
71 "Establish many new global bindings and record the bindings replaced. | |
208 | 72 Arg BINDINGS is an alist whose elements are (KEY DEFINITION). |
73 Returns a similar alist whose elements describe the same KEYs | |
36 | 74 but each with the old definition that was replaced," |
75 (let (old) | |
76 (while bindings | |
77 (let* ((this (car bindings)) | |
78 (key (car this)) | |
79 (newdef (nth 1 this))) | |
80 (setq old (cons (list key (lookup-key global-map key)) old)) | |
81 (global-set-key key newdef)) | |
82 (setq bindings (cdr bindings))) | |
83 (nreverse old))) | |
84 | |
85 (defun set-gnu-bindings () | |
86 "Restore the global bindings that were changed by \\[set-gosmacs-bindings]." | |
87 (interactive) | |
88 (rebind-and-record non-gosmacs-binding-alist)) | |
89 | |
90 (defun gosmacs-previous-window () | |
91 "Select the window above or to the left of the window now selected. | |
92 From the window at the upper left corner, select the one at the lower right." | |
93 (interactive) | |
94 (select-window (previous-window))) | |
95 | |
96 (defun gosmacs-next-window () | |
97 "Select the window below or to the right of the window now selected. | |
98 From the window at the lower right corner, select the one at the upper left." | |
99 (interactive) | |
100 (select-window (next-window))) | |
101 | |
102 (defun scroll-one-line-up (&optional arg) | |
103 "Scroll the selected window up (forward in the text) one line (or N lines)." | |
104 (interactive "p") | |
105 (scroll-up (or arg 1))) | |
106 | |
107 (defun scroll-one-line-down (&optional arg) | |
108 "Scroll the selected window down (backward in the text) one line (or N)." | |
109 (interactive "p") | |
110 (scroll-down (or arg 1))) | |
111 | |
112 (defun line-to-top-of-window () | |
113 "Scroll the selected window up so that the current line is at the top." | |
114 (interactive) | |
115 (recenter 0)) | |
660
08eb386dd0f3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
258
diff
changeset
|
116 |
08eb386dd0f3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
258
diff
changeset
|
117 ;;; gosmacs.el ends here |