annotate lisp/emulation/crisp.el @ 23955:9f9e1b450ff5

(easy-menu-get-map): Change global map only if this menu exists in the global map already, and not in the local map. (easy-menu-do-add-item): Fix error message.
author Richard M. Stallman <rms@gnu.org>
date Tue, 29 Dec 1998 22:54:37 +0000
parents d1d9c92ca734
children 585c5f115d83
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
1 ;; crisp.el --- CRiSP/Brief Emacs emulator
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
2
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
3 ;; Copyright (C) 1997, 1998 Free Software Foundation, Inc.
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
5 ;; Author: Gary D. Foster <gfoster@suzieq.ml.org>
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
6 ;; Keywords: emulations brief crisp
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
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
27 ;; Keybindings and minor functions to duplicate the functionality and
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
28 ;; finger-feel of the CRiSP/Brief editor. This package is designed to
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
29 ;; facilitate transitioning from Brief to (XE|E)macs with a minimum
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
30 ;; amount of hassles.
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
32 ;; Enable this package by putting (require 'crisp) in your .emacs and
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
33 ;; use M-x crisp-mode to toggle it on or off.
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
35 ;; This package will automatically load the scroll-all.el package if
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
36 ;; you put (setq crisp-load-scroll-all t) in your .emacs before
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
37 ;; loading this package. If this feature is enabled, it will bind
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
38 ;; meta-f1 to the scroll-all mode toggle. The scroll-all package
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
39 ;; duplicates the scroll-alling feature in CRiSP.
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
40
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
41 ;; Also, the default keybindings for brief/CRiSP override the M-x
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
42 ;; key to exit the editor. If you don't like this functionality, you
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
43 ;; can prevent this behavior (or redefine it dynamically) by setting
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
44 ;; the value of `crisp-override-meta-x' either in your .emacs or
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
45 ;; interactively. The default setting is nil, which means that M-x will
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
46 ;; by default run `execute-extended-command' instead of the command
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
47 ;; `save-buffers-kill-emacs'.
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
48
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
49 ;; 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
50 ;; 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
51 ;; `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
52 ;; " *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
53 ;; being displayed there.
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
54
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55 ;; All these overrides should go *before* the (require 'crisp) statement.
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
57 ;; Code:
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
58
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
59 ;; local variables
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
60
20962
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
61 (defgroup crisp nil
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
62 "Emulator for CRiSP and Brief key bindings."
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
63 :prefix "crisp-"
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
64 :group 'emulations)
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
65
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
66 (defvar crisp-mode-map (let ((map (make-sparse-keymap)))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
67 (set-keymap-parent map (current-global-map))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
68 map)
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
69 "Local keymap for CRiSP emulation mode.
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
70 All the bindings are done here instead of globally to try and be
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
71 nice to the world.")
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
72
20962
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
73 (defcustom crisp-mode-modeline-string " *CRiSP*"
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
74 "*String to display in the modeline when CRiSP emulation mode is enabled."
20962
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
75 :type 'string
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
76 :group 'crisp)
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
77
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
78 (defvar crisp-mode-original-keymap (current-global-map)
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
79 "The original keymap before CRiSP emulation mode remaps anything.
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
80 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
81
20962
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
82 (defcustom crisp-mode-enabled nil
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
83 "Track status of CRiSP emulation mode.
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
84 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
85 indicates CRiSP mode is enabled."
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
86 :type 'boolean
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
87 :group 'crisp)
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
88
20962
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
89 (defcustom crisp-override-meta-x t
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
90 "*Controls overriding the normal Emacs M-x key binding in the CRiSP emulator.
22827
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
91 Normally the CRiSP emulator rebinds M-x to `save-buffers-exit-emacs', and
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
92 provides the usual M-x functionality on the F10 key. If this variable
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
93 is non-nil, M-x will exit Emacs."
20962
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
94 :type 'boolean
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
95 :group 'crisp)
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
96
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
97 (defcustom crisp-load-scroll-all nil
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
98 "Controls loading of the Scroll Lock in the CRiSP emulator.
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
99 Its default behavior is to load and enable the Scroll Lock minor mode
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
100 package when enabling the CRiSP emulator.
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
101
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
102 If this variable is nil when you start the CRiSP emulator, it
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
103 does not load the scroll-all package."
20962
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
104 :type 'boolean
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
105 :group 'crisp)
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
106
20962
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
107 (defcustom crisp-load-hook nil
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
108 "Hooks to run after loading the CRiSP emulator package."
20962
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
109 :type 'hook
54413501e4a9 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 17904
diff changeset
110 :group 'crisp)
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
111
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
112 (defconst crisp-version "1.33"
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
113 "The version of the CRiSP emulator.")
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
114
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
115 (defconst crisp-mode-help-address "gfoster@suzieq.ml.org"
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
116 "The email address of the CRiSP mode author/maintainer.")
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
117
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
118 ;; Silence the byte-compiler.
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
119 (defvar crisp-last-last-command nil
22827
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
120 "The previous value of `last-command'.")
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
121
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
122 ;; The cut and paste routines are different between XEmacs and Emacs
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
123 ;; so we need to set up aliases for the functions.
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
124
22827
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
125 (defalias 'crisp-set-clipboard
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
126 (if (fboundp 'clipboard-kill-ring-save)
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
127 'clipboard-kill-ring-save
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
128 'copy-primary-selection))
17900
08062aad7ef6 (crisp-last-last-command): Renamed from last-last-command
Richard M. Stallman <rms@gnu.org>
parents: 17599
diff changeset
129
22827
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
130 (defalias 'crisp-kill-region
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
131 (if (fboundp 'clipboard-kill-region)
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
132 'clipboard-kill-region
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
133 'kill-primary-selection))
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
134
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
135 (defalias 'crisp-yank-clipboard
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
136 (if (fboundp 'clipboard-yank)
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
137 'clipboard-yank
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
138 'yank-clipboard-selection))
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
139
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
140 ;; force transient-mark-mode in Emacs, so that the marking routines
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
141 ;; work as expected. If the user turns off transient mark mode,
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
142 ;; most things will still work fine except the crisp-(copy|kill)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
143 ;; functions won't work quite as nicely when regions are marked
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
144 ;; differently and could really confuse people. Caveat emptor.
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
145
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
146 (if (fboundp 'transient-mark-mode)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
147 (transient-mark-mode t))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
148
22827
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
149 (defun crisp-region-active ()
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
150 "Compatibility function to test for an active region."
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
151 (if (boundp 'zmacs-region-active-p)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
152 zmacs-region-active-p
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
153 mark-active))
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
154
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
155 ;; and now the keymap defines
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
156
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157 (define-key crisp-mode-map [(f1)] 'other-window)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
158
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
159 (define-key crisp-mode-map [(f2) (down)] 'enlarge-window)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
160 (define-key crisp-mode-map [(f2) (left)] 'shrink-window-horizontally)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
161 (define-key crisp-mode-map [(f2) (right)] 'enlarge-window-horizontally)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
162 (define-key crisp-mode-map [(f2) (up)] 'shrink-window)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163 (define-key crisp-mode-map [(f3) (down)] 'split-window-vertically)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
164 (define-key crisp-mode-map [(f3) (right)] 'split-window-horizontally)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
165
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
166 (define-key crisp-mode-map [(f4)] 'delete-window)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
167 (define-key crisp-mode-map [(control f4)] 'delete-other-windows)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169 (define-key crisp-mode-map [(f5)] 'search-forward-regexp)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
170 (define-key crisp-mode-map [(f19)] 'search-forward-regexp)
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
171 (define-key crisp-mode-map [(meta f5)] 'search-backward-regexp)
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
172
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
173 (define-key crisp-mode-map [(f6)] 'query-replace)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
174
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
175 (define-key crisp-mode-map [(f7)] 'start-kbd-macro)
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
176 (define-key crisp-mode-map [(meta f7)] 'end-kbd-macro)
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
177
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
178 (define-key crisp-mode-map [(f8)] 'call-last-kbd-macro)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
179 (define-key crisp-mode-map [(meta f8)] 'save-kbd-macro)
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 [(f9)] 'find-file)
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
182 (define-key crisp-mode-map [(meta f9)] 'load-library)
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
183
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
184 (define-key crisp-mode-map [(f10)] 'execute-extended-command)
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
185 (define-key crisp-mode-map [(meta f10)] 'compile)
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
186
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
187 (define-key crisp-mode-map [(SunF37)] 'kill-buffer)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
188 (define-key crisp-mode-map [(kp-add)] 'crisp-copy-line)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
189 (define-key crisp-mode-map [(kp-subtract)] 'crisp-kill-line)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
190 ;; just to cover all the bases (GNU Emacs, for instance)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
191 (define-key crisp-mode-map [(f24)] 'crisp-kill-line)
22827
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
192 (define-key crisp-mode-map [(insert)] 'crisp-yank-clipboard)
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
193 (define-key crisp-mode-map [(f16)] 'crisp-set-clipboard) ; copy on Sun5 kbd
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
194 (define-key crisp-mode-map [(f20)] 'crisp-kill-region) ; cut on Sun5 kbd
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
195 (define-key crisp-mode-map [(f18)] 'crisp-yank-clipboard) ; paste on Sun5 kbd
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
196
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
197 (define-key crisp-mode-map [(control f)] 'fill-paragraph-or-region)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
198 (define-key crisp-mode-map [(meta d)] (lambda ()
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
199 (interactive)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
200 (beginning-of-line) (kill-line)))
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
201 (define-key crisp-mode-map [(meta e)] 'find-file)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
202 (define-key crisp-mode-map [(meta g)] 'goto-line)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
203 (define-key crisp-mode-map [(meta h)] 'help)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
204 (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
205 (define-key crisp-mode-map [(meta j)] 'bookmark-jump)
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
206 (define-key crisp-mode-map [(meta l)] 'crisp-mark-line)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
207 (define-key crisp-mode-map [(meta m)] 'set-mark-command)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
208 (define-key crisp-mode-map [(meta n)] 'bury-buffer)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
209 (define-key crisp-mode-map [(meta p)] 'crisp-unbury-buffer)
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
210 (define-key crisp-mode-map [(meta u)] 'advertised-undo)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
211 (define-key crisp-mode-map [(f14)] 'advertised-undo)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
212 (define-key crisp-mode-map [(meta w)] 'save-buffer)
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
213 (define-key crisp-mode-map [(meta x)] 'crisp-meta-x-wrapper)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
214 (define-key crisp-mode-map [(meta ?0)] (lambda ()
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
215 (interactive)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
216 (bookmark-set "0")))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
217 (define-key crisp-mode-map [(meta ?1)] (lambda ()
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
218 (interactive)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
219 (bookmark-set "1")))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
220 (define-key crisp-mode-map [(meta ?2)] (lambda ()
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
221 (interactive)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
222 (bookmark-set "2")))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
223 (define-key crisp-mode-map [(meta ?3)] (lambda ()
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
224 (interactive)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
225 (bookmark-set "3")))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
226 (define-key crisp-mode-map [(meta ?4)] (lambda ()
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
227 (interactive)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
228 (bookmark-set "4")))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
229 (define-key crisp-mode-map [(meta ?5)] (lambda ()
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
230 (interactive)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
231 (bookmark-set "5")))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
232 (define-key crisp-mode-map [(meta ?6)] (lambda ()
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
233 (interactive)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
234 (bookmark-set "6")))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
235 (define-key crisp-mode-map [(meta ?7)] (lambda ()
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
236 (interactive)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
237 (bookmark-set "7")))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
238 (define-key crisp-mode-map [(meta ?8)] (lambda ()
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
239 (interactive)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
240 (bookmark-set "8")))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
241 (define-key crisp-mode-map [(meta ?9)] (lambda ()
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
242 (interactive)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
243 (bookmark-set "9")))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
244
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
245 (define-key crisp-mode-map [(shift delete)] 'kill-word)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
246 (define-key crisp-mode-map [(shift backspace)] 'backward-kill-word)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
247 (define-key crisp-mode-map [(control left)] 'backward-word)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
248 (define-key crisp-mode-map [(control right)] 'forward-word)
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
249
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
250 (define-key crisp-mode-map [(home)] 'crisp-home)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
251 (define-key crisp-mode-map [(control home)] (lambda ()
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
252 (interactive)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
253 (move-to-window-line 0)))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
254 (define-key crisp-mode-map [(meta home)] 'beginning-of-line)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
255 (define-key crisp-mode-map [(end)] 'crisp-end)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
256 (define-key crisp-mode-map [(control end)] (lambda ()
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
257 (interactive)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
258 (move-to-window-line -1)))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
259 (define-key crisp-mode-map [(meta end)] 'end-of-line)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
260
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
261 (define-key crisp-mode-map [(control c) (b)] 'crisp-submit-bug-report)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
262
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
263 (defun crisp-version (&optional arg)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
264 "Version number of the CRiSP emulator package.
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
265 If ARG, insert results at point."
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
266 (interactive "P")
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
267 (let ((foo (concat "CRiSP version " crisp-version)))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
268 (if arg
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
269 (insert (message foo))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
270 (message foo))))
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
271
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
272 (defun crisp-mark-line (arg)
22849
d1d9c92ca734 (crisp-mark-line): Greatly simplified.
Richard M. Stallman <rms@gnu.org>
parents: 22827
diff changeset
273 "Set mark at the end of the line. Arg works as in `end-of-line'."
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
274 (interactive "p")
22849
d1d9c92ca734 (crisp-mark-line): Greatly simplified.
Richard M. Stallman <rms@gnu.org>
parents: 22827
diff changeset
275 (let (newmark)
d1d9c92ca734 (crisp-mark-line): Greatly simplified.
Richard M. Stallman <rms@gnu.org>
parents: 22827
diff changeset
276 (save-excursion
22827
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
277 (end-of-line arg)
22849
d1d9c92ca734 (crisp-mark-line): Greatly simplified.
Richard M. Stallman <rms@gnu.org>
parents: 22827
diff changeset
278 (setq newmark (point)))
d1d9c92ca734 (crisp-mark-line): Greatly simplified.
Richard M. Stallman <rms@gnu.org>
parents: 22827
diff changeset
279 (push-mark newmark nil t)))
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
280
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
281 (defun crisp-kill-line (arg)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
282 "Mark and kill line(s).
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
283 Marks from point to end of the current line (honoring prefix arguments),
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
284 copies the region to the kill ring and clipboard, and then deletes it."
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
285 (interactive "*p")
22827
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
286 (if (crisp-region-active)
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
287 (call-interactively 'crisp-kill-region)
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
288 (crisp-mark-line arg)
22827
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
289 (call-interactively 'crisp-kill-region)))
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
290
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
291 (defun crisp-copy-line (arg)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
292 "Mark and copy line(s).
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
293 Marks from point to end of the current line (honoring prefix arguments),
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
294 copies the region to the kill ring and clipboard, and then deactivates
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
295 the region."
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
296 (interactive "*p")
22827
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
297 (if (crisp-region-active)
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
298 (call-interactively 'crisp-set-clipboard)
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
299 (crisp-mark-line arg)
22827
053f8d41f34c Don't require cl.
Richard M. Stallman <rms@gnu.org>
parents: 22758
diff changeset
300 (call-interactively 'crisp-set-clipboard))
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
301 ;; clear the region after the operation is complete
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
302 ;; XEmacs does this automagically, Emacs doesn't.
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
303 (if (boundp 'mark-active)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
304 (setq mark-active nil)))
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
305
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
306 (defun crisp-home ()
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
307 "\"Home\" the point, the way CRiSP would do it.
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
308 The first use moves point to beginning of the line. Second
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
309 consecutive use moves point to beginning of the screen. Third
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
310 consecutive use moves point to the beginning of the buffer."
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
311 (interactive nil)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
312 (cond
17900
08062aad7ef6 (crisp-last-last-command): Renamed from last-last-command
Richard M. Stallman <rms@gnu.org>
parents: 17599
diff changeset
313 ((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
314 (eq crisp-last-last-command 'crisp-home))
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
315 (goto-char (point-min)))
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
316 ((eq last-command 'crisp-home)
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
317 (move-to-window-line 0))
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
318 (t
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
319 (beginning-of-line)))
17900
08062aad7ef6 (crisp-last-last-command): Renamed from last-last-command
Richard M. Stallman <rms@gnu.org>
parents: 17599
diff changeset
320 (setq crisp-last-last-command last-command))
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
321
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
322 (defun crisp-end ()
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
323 "\"End\" the point, the way CRiSP would do it.
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
324 The first use moves point to end of the line. Second
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
325 consecutive use moves point to the end of the screen. Third
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
326 consecutive use moves point to the end of the buffer."
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
327 (interactive nil)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
328 (cond
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
329 ((and (eq last-command 'crisp-end)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
330 (eq crisp-last-last-command 'crisp-end))
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
331 (goto-char (point-max)))
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
332 ((eq last-command 'crisp-end)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
333 (move-to-window-line -1)
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
334 (end-of-line))
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
335 (t
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
336 (end-of-line)))
17900
08062aad7ef6 (crisp-last-last-command): Renamed from last-last-command
Richard M. Stallman <rms@gnu.org>
parents: 17599
diff changeset
337 (setq crisp-last-last-command last-command))
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
338
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
339 (defun crisp-unbury-buffer ()
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
340 "Go back one buffer"
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
341 (interactive)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
342 (switch-to-buffer (car (last (buffer-list)))))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
343
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
344 (defun crisp-meta-x-wrapper ()
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
345 "Wrapper function to conditionally override the normal M-x bindings.
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
346 When `crisp-override-meta-x' is non-nil, M-x will exit Emacs (the
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
347 normal CRiSP binding) and when it is nil M-x will run
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
348 `execute-extended-command' (the normal Emacs binding)."
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
349 (interactive)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
350 (if crisp-override-meta-x
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
351 (save-buffers-kill-emacs)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
352 (call-interactively 'execute-extended-command)))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
353
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
354 ;; bug reporter
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
355
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
356 (defun crisp-submit-bug-report ()
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
357 "Submit via mail a bug report on CRiSP Mode."
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
358 (interactive)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
359 ;; load in reporter
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
360 (let ((reporter-prompt-for-summary-p t)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
361 (reporter-dont-compact-list '(c-offsets-alist)))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
362 (and
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
363 (if (y-or-n-p "Do you want to submit a report on CRiSP Mode? ")
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
364 t (message "") nil)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
365 (require 'reporter)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
366 (reporter-submit-bug-report
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
367 crisp-mode-help-address
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
368 (concat "CRiSP Mode [" crisp-version "]")
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
369 nil
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
370 nil
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
371 nil
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
372 "Dear Gary,"
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
373 ))))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
374
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
375 ;; Now enable the mode
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
376
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
377 (defun crisp-mode (&optional arg)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
378 "Toggle CRiSP emulation minor mode.
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
379 With ARG, turn CRiSP mode on if ARG is positive, off otherwise."
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
380 (interactive "P")
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
381 (setq crisp-mode-enabled (if (null arg)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
382 (not crisp-mode-enabled)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
383 (> (prefix-numeric-value arg) 0)))
17448
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
384 (cond
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
385 ((eq crisp-mode-enabled 't)
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
386 (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
387 (if crisp-load-scroll-all
dd277f4e6737 (crisp-load-scroll-all): Renamed from ...-lock.
Richard M. Stallman <rms@gnu.org>
parents: 17448
diff changeset
388 (require 'scroll-all))
dd277f4e6737 (crisp-load-scroll-all): Renamed from ...-lock.
Richard M. Stallman <rms@gnu.org>
parents: 17448
diff changeset
389 (if (featurep 'scroll-all)
dd277f4e6737 (crisp-load-scroll-all): Renamed from ...-lock.
Richard M. Stallman <rms@gnu.org>
parents: 17448
diff changeset
390 (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
391 (run-hooks 'crisp-load-hook))
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
392 ((eq crisp-mode-enabled 'nil)
b0fb37e0d14b Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents: 17367
diff changeset
393 (use-global-map crisp-mode-original-keymap))))
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
394
22758
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
395 (if (fboundp 'add-minor-mode)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
396 (add-minor-mode 'crisp-mode-enabled 'crisp-mode-modeline-string
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
397 nil nil 'crisp-mode)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
398 (or (assq 'crisp-mode-enabled minor-mode-alist)
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
399 (setq minor-mode-alist
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
400 (cons '(crisp-mode-enabled crisp-mode-modeline-string) minor-mode-alist))))
dbd9ecc9dbac Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents: 20962
diff changeset
401
17361
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
402 (provide 'crisp)
d3c4df8a1219 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
403
17367
ac4db12935d7 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17361
diff changeset
404 ;;; crisp.el ends here