annotate lisp/emulation/crisp.el @ 20962:54413501e4a9

Customized.
author Stephen Eglen <stephen@gnu.org>
date Sun, 22 Feb 1998 22:01:28 +0000
parents 954352993fa2
children dbd9ecc9dbac
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
1 ;;; crisp.el --- Emulator for CRiSP and Brief key bindings
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
2
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
3 ;; Copyright (C) 1997 Free Software Foundation, Inc.
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5 ;; Author: Gary D. Foster <Gary.Foster@corp.sun.com>
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
6 ;; Keywords: emulations
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 ;; any later version.
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 ;; GNU General Public License for more details.
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23 ;; Boston, MA 02111-1307, USA.
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25 ;;; Commentary:
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27 ;; This file provides keybindings and minor functions to duplicate the
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28 ;; functionality and finger-feel of the CRiSP/Brief editor. This
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29 ;; package is designed to facilitate transitioning from Brief to Emacs
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30 ;; with a minimum amount of hassles.
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 ;; Enable this package by putting the following in your .emacs
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 ;; (require 'crisp)
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
34 ;; and use M-x crisp-mode to toggle it on or off.
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35
17599
dd277f4e6737 (crisp-load-scroll-all): Renamed from ...-lock.
Richard M. Stallman <rms@gnu.org>
parents: 17448
diff changeset
36 ;; This package will automatically default to loading the scroll-all.el
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37 ;; package unless you put (setq crisp-load-scroll-lock nil) in your
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
38 ;; .emacs. If this feature is enabled, it will bind Meta-F1 to the
17599
dd277f4e6737 (crisp-load-scroll-all): Renamed from ...-lock.
Richard M. Stallman <rms@gnu.org>
parents: 17448
diff changeset
39 ;; scroll-all mode toggle.
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
40
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
41 ;; Also, the default keybindings for this mode override the Meta-x key to
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
42 ;; make it exit the editor. If you don't like this change, you can
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
43 ;; prevent this key from being rebound with
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
44 ;; (setq crisp-override-meta-x nil) in your .emacs.
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
45
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
46 ;; Finally, if you want to change the string displayed in the modeline
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
47 ;; when this mode is in effect, override the definition of
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
48 ;; `crisp-mode-modeline-string' in your .emacs. The default value is
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
49 ;; " *Crisp*" which may be a bit lengthy if you have a lot of things
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
50 ;; being displayed there.
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
51
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
52 ;; All these overrides should go *before* the (require 'crisp) statement.
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53
20962
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
54 (defgroup crisp nil
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
55 "Emulator for CRiSP and Brief key bindings."
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
56 :prefix "crisp-"
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
57 :group 'emulations)
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
58
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59 ;; local variables
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
61 (defvar crisp-mode-map (copy-keymap (current-global-map))
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
62 "Local keymap for CRiSP emulation mode.
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63 All the emulation bindings are done here instead of globally.")
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64
20962
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
65 (defcustom crisp-mode-modeline-string " *CRiSP*"
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
66 "String to display in the modeline when CRiSP emulation mode is enabled."
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
67 :type 'string
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
68 :group 'crisp)
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
69
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
70 (defvar crisp-mode-original-keymap (copy-keymap (current-global-map))
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
71 "The original keymap before CRiSP emulation mode remaps anything.
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
72 This keymap is restored when CRiSP emulation mode is disabled.")
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
73
20962
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
74 (defcustom crisp-mode-enabled nil
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
75 "Track status of CRiSP emulation mode.
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
76 A value of nil means CRiSP mode is not enabled. A value of t
20962
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
77 indicates CRiSP mode is enabled."
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
78 :type 'boolean
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
79 :group 'crisp)
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
80
20962
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
81 (defcustom crisp-override-meta-x t
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82 "Controls overriding the normal Emacs M-x key binding in the CRiSP emulator.
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83 Normally the CRiSP emulator rebinds M-x to save-buffers-exit-emacs
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84 and provides the usual M-x functionality on the F10 key.
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86 If this variable is nil when you start the CRiSP emulator, it
20962
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
87 does not alter the binding of M-x."
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
88 :type 'boolean
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
89 :group 'crisp)
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90
20962
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
91 (defcustom crisp-load-scroll-all t
17599
dd277f4e6737 (crisp-load-scroll-all): Renamed from ...-lock.
Richard M. Stallman <rms@gnu.org>
parents: 17448
diff changeset
92 "Controls loading of the Scroll All mode in the CRiSP emulator.
dd277f4e6737 (crisp-load-scroll-all): Renamed from ...-lock.
Richard M. Stallman <rms@gnu.org>
parents: 17448
diff changeset
93 Its Default behavior is to load and enable the Scroll All minor mode
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
94 package when enabling the CRiSP emulator.
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
95
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
96 If this variable is nil when you start the CRiSP emulator, it
20962
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
97 does not load Scroll All."
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
98 :type 'boolean
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
99 :group 'crisp)
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
100
20962
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
101 (defcustom crisp-load-hook nil
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
102 "Hooks to run after loadint the CRiSP emulator package."
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
103 :type 'hook
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
104 :group 'crisp)
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
105
20962
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
106 (defvar crisp-version "crisp.el release 1.1/$Revision: 1.6 $"
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
107 "The release number and RCS version for the CRiSP emulator.")
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
108
17900
08062aad7ef6 (crisp-last-last-command): Renamed from last-last-command
Richard M. Stallman <rms@gnu.org>
parents: 17599
diff changeset
109 (defvar crisp-last-last-command nil
08062aad7ef6 (crisp-last-last-command): Renamed from last-last-command
Richard M. Stallman <rms@gnu.org>
parents: 17599
diff changeset
110 "The command *before* the last command.")
08062aad7ef6 (crisp-last-last-command): Renamed from last-last-command
Richard M. Stallman <rms@gnu.org>
parents: 17599
diff changeset
111
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
112 (if (string-match "XEmacs\\Lucid" emacs-version)
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
113 (add-minor-mode 'crisp-mode-enabled crisp-mode-modeline-string)
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
114 (or (assq 'crisp-mode-enabled minor-mode-alist)
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
115 (setq minor-mode-alist
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
116 (cons '(crisp-mode-enabled crisp-mode-modeline-string) minor-mode-alist))))
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
117
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
118 ;; and now the keymap defines
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
119
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
120 (define-key crisp-mode-map [(f1)] 'other-window)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
121
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
122 (define-key crisp-mode-map [(f2) (down)] 'enlarge-window)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
123 (define-key crisp-mode-map [(f2) (left)] 'shrink-window-horizontally)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
124 (define-key crisp-mode-map [(f2) (right)] 'enlarge-window-horizontally)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125 (define-key crisp-mode-map [(f2) (up)] 'shrink-window)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126 (define-key crisp-mode-map [(f3) (down)] 'split-window-vertically)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127 (define-key crisp-mode-map [(f3) (right)] 'split-window-horizontally)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
128
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
129 (define-key crisp-mode-map [(f4)] 'delete-window)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130 (define-key crisp-mode-map [(control f4)] 'delete-other-windows)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132 (define-key crisp-mode-map [(f5)] 'search-forward-regexp)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
133 (define-key crisp-mode-map [(f19)] 'search-forward-regexp)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
134 (define-key crisp-mode-map [(meta f5)] 'search-backward-regexp)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
135
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136 (define-key crisp-mode-map [(f6)] 'query-replace)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
137
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
138 (define-key crisp-mode-map [(f7)] 'start-kbd-macro)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
139 (define-key crisp-mode-map [(meta f7)] 'end-kbd-macro)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
140
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
141 (define-key crisp-mode-map [(f8)] 'call-last-kbd-macro)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
142 (define-key crisp-mode-map [(meta f8)] 'save-kbd-macro)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
143
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
144 (define-key crisp-mode-map [(f9)] 'find-file)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
145 (define-key crisp-mode-map [(meta f9)] 'load-library)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
146
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
147 (define-key crisp-mode-map [(f10)] 'execute-extended-command)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
148 (define-key crisp-mode-map [(meta f10)] 'compile)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
149
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
150 (define-key crisp-mode-map [(SunF37)] 'kill-buffer)
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
151 (define-key crisp-mode-map [(kp-add)] 'x-copy-primary-selection)
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
152 (define-key crisp-mode-map [(kp-subtract)] 'x-kill-primary-selection)
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
153 (define-key crisp-mode-map [(insert)] 'x-yank-clipboard-selection)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
154 (define-key crisp-mode-map [(f16)] 'x-copy-primary-selection) ; copy on Sun5 kbd
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
155 (define-key crisp-mode-map [(f20)] 'x-kill-primary-selection) ; cut on Sun5 kbd
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
156 (define-key crisp-mode-map [(f18)] 'x-yank-clipboard-selection) ; paste on Sun5 kbd
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
158 (define-key crisp-mode-map [(meta d)] (lambda () (interactive) (beginning-of-line) (kill-line)))
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
159 (define-key crisp-mode-map [(meta e)] 'find-file)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
160 (define-key crisp-mode-map [(meta g)] 'goto-line)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
161 (define-key crisp-mode-map [(meta h)] 'help)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
162 (define-key crisp-mode-map [(meta i)] 'overwrite-mode)
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
163 (define-key crisp-mode-map [(meta j)] 'bookmark-jump)
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
164 (define-key crisp-mode-map [(meta u)] 'advertised-undo)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
165 (define-key crisp-mode-map [(f14)] 'advertised-undo)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
166 (define-key crisp-mode-map [(meta w)] 'save-buffer)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
167 (if
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168 (eq crisp-override-meta-x 't)
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
169 (define-key crisp-mode-map [(meta x)] 'save-buffers-kill-emacs))
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
170 (define-key crisp-mode-map [(meta ?0)] (lambda () (interactive) (bookmark-set "0")))
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
171 (define-key crisp-mode-map [(meta ?1)] (lambda () (interactive) (bookmark-set "1")))
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
172 (define-key crisp-mode-map [(meta ?2)] (lambda () (interactive) (bookmark-set "2")))
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
173 (define-key crisp-mode-map [(meta ?3)] (lambda () (interactive) (bookmark-set "3")))
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
174 (define-key crisp-mode-map [(meta ?4)] (lambda () (interactive) (bookmark-set "4")))
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
175 (define-key crisp-mode-map [(meta ?5)] (lambda () (interactive) (bookmark-set "5")))
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
176 (define-key crisp-mode-map [(meta ?6)] (lambda () (interactive) (bookmark-set "6")))
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
177 (define-key crisp-mode-map [(meta ?7)] (lambda () (interactive) (bookmark-set "7")))
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
178 (define-key crisp-mode-map [(meta ?8)] (lambda () (interactive) (bookmark-set "8")))
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
179 (define-key crisp-mode-map [(meta ?9)] (lambda () (interactive) (bookmark-set "9")))
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
180
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
181 (define-key crisp-mode-map [(shift right)] 'fkey-forward-word)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
182 (define-key crisp-mode-map [(shift left)] 'fkey-backward-word)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
183 (define-key crisp-mode-map [(shift delete)] 'kill-word)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
184 (define-key crisp-mode-map [(shift backspace)] 'backward-kill-word)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
185 (define-key crisp-mode-map [(control left)] 'backward-word)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
186 (define-key crisp-mode-map [(control right)] 'forward-word)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
187
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
188 (define-key crisp-mode-map [(home)] 'crisp-home)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
189 (define-key crisp-mode-map [(end)] 'crisp-end)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
190
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
191 (defun crisp-home ()
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
192 "\"Home\" point, the way CRiSP would do it.
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
193 The first use moves point to beginning of the line. Second
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
194 consecutive use moves point to beginning of the screen. Third
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
195 consecutive use moves point to the beginning of the buffer."
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
196 (interactive nil)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
197 (cond
17900
08062aad7ef6 (crisp-last-last-command): Renamed from last-last-command
Richard M. Stallman <rms@gnu.org>
parents: 17599
diff changeset
198 ((and (eq last-command 'crisp-home)
08062aad7ef6 (crisp-last-last-command): Renamed from last-last-command
Richard M. Stallman <rms@gnu.org>
parents: 17599
diff changeset
199 (eq crisp-last-last-command 'crisp-home))
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
200 (goto-char (point-min)))
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
201 ((eq last-command 'crisp-home)
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
202 (move-to-window-line 0))
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
203 (t
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
204 (beginning-of-line)))
17900
08062aad7ef6 (crisp-last-last-command): Renamed from last-last-command
Richard M. Stallman <rms@gnu.org>
parents: 17599
diff changeset
205 (setq crisp-last-last-command last-command))
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
206
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
207 (defun crisp-end ()
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
208 "\"End\" point, the way CRiSP would do it.
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
209 The first use moves point to end of the line. Second
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
210 consecutive use moves point to the end of the screen. Third
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
211 consecutive use moves point to the end of the buffer."
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
212 (interactive nil)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
213 (cond
17900
08062aad7ef6 (crisp-last-last-command): Renamed from last-last-command
Richard M. Stallman <rms@gnu.org>
parents: 17599
diff changeset
214 ((and (eq last-command 'crisp-end) (eq crisp-last-last-command 'crisp-end))
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
215 (goto-char (point-max)))
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
216 ((eq last-command 'crisp-end)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
217 (move-to-window-line -1)
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
218 (end-of-line))
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
219 (t
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
220 (end-of-line)))
17900
08062aad7ef6 (crisp-last-last-command): Renamed from last-last-command
Richard M. Stallman <rms@gnu.org>
parents: 17599
diff changeset
221 (setq crisp-last-last-command last-command))
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
222
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
223 ;; Now enable the mode
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
224
17904
954352993fa2 (crisp-mode): Add autoload cookie.
Richard M. Stallman <rms@gnu.org>
parents: 17900
diff changeset
225 ;;;###autoload
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
226 (defun crisp-mode ()
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
227 "Toggle CRiSP emulation minor mode."
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
228 (interactive nil)
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
229 (setq crisp-mode-enabled (not crisp-mode-enabled))
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
230 (cond
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
231 ((eq crisp-mode-enabled 't)
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
232 (use-global-map crisp-mode-map)
17599
dd277f4e6737 (crisp-load-scroll-all): Renamed from ...-lock.
Richard M. Stallman <rms@gnu.org>
parents: 17448
diff changeset
233 (if crisp-load-scroll-all
dd277f4e6737 (crisp-load-scroll-all): Renamed from ...-lock.
Richard M. Stallman <rms@gnu.org>
parents: 17448
diff changeset
234 (require 'scroll-all))
dd277f4e6737 (crisp-load-scroll-all): Renamed from ...-lock.
Richard M. Stallman <rms@gnu.org>
parents: 17448
diff changeset
235 (if (featurep 'scroll-all)
dd277f4e6737 (crisp-load-scroll-all): Renamed from ...-lock.
Richard M. Stallman <rms@gnu.org>
parents: 17448
diff changeset
236 (define-key crisp-mode-map [(meta f1)] 'scroll-all-mode))
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
237 (run-hooks 'crisp-load-hook))
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
238 ((eq crisp-mode-enabled 'nil)
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
239 (use-global-map crisp-mode-original-keymap))))
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
240
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
241 (provide 'crisp)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
242
17367
ac4db12935d7 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17361
diff changeset
243 ;;; crisp.el ends here
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
244
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
245