Mercurial > emacs
annotate lisp/emulation/crisp.el @ 22758:dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
(crisp-unbury-buffer): New function.
Fixed bogus XEmacs/Lucid string-match checking.
Made modeline entry mouse2-able.
(crisp-mode-map): Make this a sparse keymap parented from
current-global-map.
(crisp-mode-original-keymap): Don't copy the keymap.
(crisp-last-last-command): Renamed from last-last-command. defvar it.
(crisp-mode): Honor ARG.
(crisp-kill-line, crisp-copy-line): When a region isn't highlighted,
use the region from point to eol. Honor prefix argument.
(crisp-submit-bug-report): New command, taken from cc-mode.
Shortened the version numbering, removed the release-version tracking
(crisp-version): New function.
New keybindings `C-home', `C-end', `M-home', `M-end', `C-f', `M-l',
`M-m'.
(crisp-copy-line): No need to save point.
Removed S-right and S-left bindings.
Abstract the marking and selection interfaces so that we can be
compatible with both Emacs and XEmacs. And try and make the
behavior as close as possible under both environments so that there
are no surprises.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Tue, 14 Jul 1998 22:17:35 +0000 |
parents | 54413501e4a9 |
children | 053f8d41f34c |
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 | 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 | 7 |
8 ;; This file is part of GNU Emacs. | |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
12 ;; the Free Software Foundation; either version 2, or (at your option) | |
13 ;; any later version. | |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
23 ;; Boston, MA 02111-1307, USA. | |
24 | |
22758
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
25 ;; CRiSP is a registered trademark of Foxtrot Systems Ltd. |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
26 |
17361 | 27 ;;; Commentary: |
28 | |
22758
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
29 ;; 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
|
30 ;; 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
|
31 ;; 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
|
32 ;; amount of hassles. |
17361 | 33 |
22758
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
34 ;; 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
|
35 ;; use M-x crisp-mode to toggle it on or off. |
17361 | 36 |
22758
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
37 ;; 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
|
38 ;; 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
|
39 ;; 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
|
40 ;; 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
|
41 ;; duplicates the scroll-alling feature in CRiSP. |
17361 | 42 |
22758
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
43 ;; 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
|
44 ;; 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
|
45 ;; 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
|
46 ;; 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
|
47 ;; 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
|
48 ;; 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
|
49 ;; `save-buffers-kill-emacs'. |
17361 | 50 |
17448
b0fb37e0d14b
Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents:
17367
diff
changeset
|
51 ;; 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
|
52 ;; 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
|
53 ;; `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
|
54 ;; " *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
|
55 ;; being displayed there. |
b0fb37e0d14b
Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents:
17367
diff
changeset
|
56 |
17361 | 57 ;; All these overrides should go *before* the (require 'crisp) statement. |
58 | |
22758
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
59 ;; Code: |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
60 |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
61 (require 'cl) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
62 |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
63 ;; local variables |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
64 |
20962 | 65 (defgroup crisp nil |
66 "Emulator for CRiSP and Brief key bindings." | |
67 :prefix "crisp-" | |
68 :group 'emulations) | |
69 | |
22758
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
70 (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
|
71 (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
|
72 map) |
17448
b0fb37e0d14b
Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents:
17367
diff
changeset
|
73 "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
|
74 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
|
75 nice to the world.") |
17361 | 76 |
20962 | 77 (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
|
78 "*String to display in the modeline when CRiSP emulation mode is enabled." |
20962 | 79 :type 'string |
80 :group 'crisp) | |
17448
b0fb37e0d14b
Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents:
17367
diff
changeset
|
81 |
22758
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
82 (defvar crisp-mode-original-keymap (current-global-map) |
17448
b0fb37e0d14b
Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents:
17367
diff
changeset
|
83 "The original keymap before CRiSP emulation mode remaps anything. |
b0fb37e0d14b
Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents:
17367
diff
changeset
|
84 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
|
85 |
20962 | 86 (defcustom crisp-mode-enabled nil |
17448
b0fb37e0d14b
Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents:
17367
diff
changeset
|
87 "Track status of CRiSP emulation mode. |
b0fb37e0d14b
Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents:
17367
diff
changeset
|
88 A value of nil means CRiSP mode is not enabled. A value of t |
20962 | 89 indicates CRiSP mode is enabled." |
90 :type 'boolean | |
91 :group 'crisp) | |
17448
b0fb37e0d14b
Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents:
17367
diff
changeset
|
92 |
20962 | 93 (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
|
94 "*Controls overriding the normal Emacs M-x key binding 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
|
95 Normally the CRiSP emulator rebinds M-x to save-buffers-exit-emacs and |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
96 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
|
97 is non-nil, M-x will exit Emacs." |
20962 | 98 :type 'boolean |
99 :group 'crisp) | |
17361 | 100 |
22758
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
101 (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
|
102 "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
|
103 Its default behavior is to load and enable the Scroll Lock minor mode |
17361 | 104 package when enabling the CRiSP emulator. |
105 | |
106 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
|
107 does not load the scroll-all package." |
20962 | 108 :type 'boolean |
109 :group 'crisp) | |
17361 | 110 |
20962 | 111 (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
|
112 "Hooks to run after loading the CRiSP emulator package." |
20962 | 113 :type 'hook |
114 :group 'crisp) | |
17448
b0fb37e0d14b
Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents:
17367
diff
changeset
|
115 |
22758
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
116 (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
|
117 "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
|
118 |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
119 (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
|
120 "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
|
121 |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
122 ;; 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
|
123 (defvar crisp-last-last-command nil |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
124 "The previous value of last-command.") |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
125 |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
126 ;; 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
|
127 ;; 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
|
128 |
22758
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
129 (if (and (not (fboundp 'copy-primary-selection)) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
130 (fboundp 'clipboard-kill-ring-save)) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
131 (defalias 'copy-primary-selection 'clipboard-kill-ring-save)) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
132 |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
133 (if (and (not (fboundp 'kill-primary-selection)) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
134 (fboundp 'clipboard-kill-region)) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
135 (defalias 'kill-primary-selection 'clipboard-kill-region)) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
136 |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
137 (if (and (not (fboundp 'yank-clipboard-selection)) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
138 (fboundp 'clipboard-yank)) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
139 (defalias 'yank-clipboard-selection 'clipboard-yank)) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
140 |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
141 ;; 'mark-something is very useful for marking arbitrary areas |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
142 ;; so I stole it from simple.el in XEmacs. |
17900
08062aad7ef6
(crisp-last-last-command): Renamed from last-last-command
Richard M. Stallman <rms@gnu.org>
parents:
17599
diff
changeset
|
143 |
22758
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
144 (if (not (fboundp 'mark-something)) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
145 (defun mark-something (mark-fn movement-fn arg) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
146 "Compatibility function swiped from XEmacs." |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
147 (let (newmark (pushp t)) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
148 (save-excursion |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
149 (if (and (eq last-command mark-fn) (mark)) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
150 ;; Extend the previous state in the same direction: |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
151 (progn |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
152 (if (< (mark) (point)) (setq arg (- arg))) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
153 (goto-char (mark)) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
154 (setq pushp nil))) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
155 (funcall movement-fn arg) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
156 (setq newmark (point))) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
157 (if pushp |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
158 (push-mark newmark nil t) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
159 ;; Do not mess with the mark stack, but merely adjust the previous state: |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
160 (set-mark newmark) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
161 (activate-region))))) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
162 |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
163 ;; 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
|
164 ;; 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
|
165 ;; 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
|
166 ;; 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
|
167 ;; 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
|
168 |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
169 (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
|
170 (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
|
171 |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
172 (defun region-active () |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
173 "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
|
174 (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
|
175 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
|
176 mark-active)) |
17361 | 177 |
178 ;; and now the keymap defines | |
179 | |
180 (define-key crisp-mode-map [(f1)] 'other-window) | |
181 | |
182 (define-key crisp-mode-map [(f2) (down)] 'enlarge-window) | |
183 (define-key crisp-mode-map [(f2) (left)] 'shrink-window-horizontally) | |
184 (define-key crisp-mode-map [(f2) (right)] 'enlarge-window-horizontally) | |
185 (define-key crisp-mode-map [(f2) (up)] 'shrink-window) | |
186 (define-key crisp-mode-map [(f3) (down)] 'split-window-vertically) | |
187 (define-key crisp-mode-map [(f3) (right)] 'split-window-horizontally) | |
188 | |
189 (define-key crisp-mode-map [(f4)] 'delete-window) | |
190 (define-key crisp-mode-map [(control f4)] 'delete-other-windows) | |
191 | |
192 (define-key crisp-mode-map [(f5)] 'search-forward-regexp) | |
193 (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
|
194 (define-key crisp-mode-map [(meta f5)] 'search-backward-regexp) |
17361 | 195 |
196 (define-key crisp-mode-map [(f6)] 'query-replace) | |
197 | |
198 (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
|
199 (define-key crisp-mode-map [(meta f7)] 'end-kbd-macro) |
17361 | 200 |
201 (define-key crisp-mode-map [(f8)] 'call-last-kbd-macro) | |
202 (define-key crisp-mode-map [(meta f8)] 'save-kbd-macro) | |
203 | |
204 (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
|
205 (define-key crisp-mode-map [(meta f9)] 'load-library) |
17361 | 206 |
207 (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
|
208 (define-key crisp-mode-map [(meta f10)] 'compile) |
17361 | 209 |
22758
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
210 (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
|
211 (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
|
212 (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
|
213 ;; 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
|
214 (define-key crisp-mode-map [(f24)] '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
|
215 (define-key crisp-mode-map [(insert)] 'yank-clipboard-selection) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
216 (define-key crisp-mode-map [(f16)] 'copy-primary-selection) ; copy on Sun5 kbd |
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 [(f20)] 'kill-primary-selection) ; cut on Sun5 kbd |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
218 (define-key crisp-mode-map [(f18)] 'yank-clipboard-selection) ; paste on Sun5 kbd |
17361 | 219 |
22758
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 [(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
|
221 (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
|
222 (interactive) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
223 (beginning-of-line) (kill-line))) |
17361 | 224 (define-key crisp-mode-map [(meta e)] 'find-file) |
225 (define-key crisp-mode-map [(meta g)] 'goto-line) | |
226 (define-key crisp-mode-map [(meta h)] 'help) | |
227 (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
|
228 (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
|
229 (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
|
230 (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
|
231 (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
|
232 (define-key crisp-mode-map [(meta p)] 'crisp-unbury-buffer) |
17361 | 233 (define-key crisp-mode-map [(meta u)] 'advertised-undo) |
234 (define-key crisp-mode-map [(f14)] 'advertised-undo) | |
235 (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
|
236 (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
|
237 (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
|
238 (interactive) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
239 (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
|
240 (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
|
241 (interactive) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
242 (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
|
243 (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
|
244 (interactive) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
245 (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
|
246 (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
|
247 (interactive) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
248 (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
|
249 (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
|
250 (interactive) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
251 (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
|
252 (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
|
253 (interactive) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
254 (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
|
255 (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
|
256 (interactive) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
257 (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
|
258 (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
|
259 (interactive) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
260 (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
|
261 (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
|
262 (interactive) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
263 (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
|
264 (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
|
265 (interactive) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
266 (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
|
267 |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
268 (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
|
269 (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
|
270 (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
|
271 (define-key crisp-mode-map [(control right)] 'forward-word) |
17361 | 272 |
22758
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
273 (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
|
274 (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
|
275 (interactive) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
276 (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
|
277 (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
|
278 (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
|
279 (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
|
280 (interactive) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
281 (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
|
282 (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
|
283 |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
284 (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
|
285 |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
286 (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
|
287 "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
|
288 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
|
289 (interactive "P") |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
290 (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
|
291 (if arg |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
292 (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
|
293 (message foo)))) |
17361 | 294 |
22758
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
295 (defun crisp-mark-line (arg) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
296 "Put mark at the end of line. Arg works as in `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
|
297 (interactive "p") |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
298 (mark-something 'crisp-mark-line 'end-of-line arg)) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
299 |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
300 (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
|
301 "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
|
302 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
|
303 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
|
304 (interactive "*p") |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
305 (if (region-active) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
306 (call-interactively 'kill-primary-selection) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
307 (crisp-mark-line arg) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
308 (call-interactively 'kill-primary-selection))) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
309 |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
310 (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
|
311 "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
|
312 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
|
313 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
|
314 the region." |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
315 (interactive "*p") |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
316 (if (region-active) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
317 (call-interactively 'copy-primary-selection) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
318 (crisp-mark-line arg) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
319 (call-interactively 'copy-primary-selection)) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
320 ;; 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
|
321 ;; 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
|
322 (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
|
323 (setq mark-active nil))) |
17361 | 324 |
325 (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
|
326 "\"Home\" the point, the way CRiSP would do it. |
17361 | 327 The first use moves point to beginning of the line. Second |
328 consecutive use moves point to beginning of the screen. Third | |
329 consecutive use moves point to the beginning of the buffer." | |
330 (interactive nil) | |
331 (cond | |
17900
08062aad7ef6
(crisp-last-last-command): Renamed from last-last-command
Richard M. Stallman <rms@gnu.org>
parents:
17599
diff
changeset
|
332 ((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
|
333 (eq crisp-last-last-command 'crisp-home)) |
17448
b0fb37e0d14b
Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents:
17367
diff
changeset
|
334 (goto-char (point-min))) |
17361 | 335 ((eq last-command 'crisp-home) |
17448
b0fb37e0d14b
Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents:
17367
diff
changeset
|
336 (move-to-window-line 0)) |
17361 | 337 (t |
17448
b0fb37e0d14b
Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents:
17367
diff
changeset
|
338 (beginning-of-line))) |
17900
08062aad7ef6
(crisp-last-last-command): Renamed from last-last-command
Richard M. Stallman <rms@gnu.org>
parents:
17599
diff
changeset
|
339 (setq crisp-last-last-command last-command)) |
17361 | 340 |
341 (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
|
342 "\"End\" the point, the way CRiSP would do it. |
17361 | 343 The first use moves point to end of the line. Second |
344 consecutive use moves point to the end of the screen. Third | |
345 consecutive use moves point to the end of the buffer." | |
346 (interactive nil) | |
347 (cond | |
22758
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
348 ((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
|
349 (eq crisp-last-last-command 'crisp-end)) |
17448
b0fb37e0d14b
Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents:
17367
diff
changeset
|
350 (goto-char (point-max))) |
17361 | 351 ((eq last-command 'crisp-end) |
352 (move-to-window-line -1) | |
17448
b0fb37e0d14b
Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents:
17367
diff
changeset
|
353 (end-of-line)) |
17361 | 354 (t |
17448
b0fb37e0d14b
Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents:
17367
diff
changeset
|
355 (end-of-line))) |
17900
08062aad7ef6
(crisp-last-last-command): Renamed from last-last-command
Richard M. Stallman <rms@gnu.org>
parents:
17599
diff
changeset
|
356 (setq crisp-last-last-command last-command)) |
17361 | 357 |
22758
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
358 (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
|
359 "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
|
360 (interactive) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
361 (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
|
362 |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
363 (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
|
364 "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
|
365 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
|
366 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
|
367 `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
|
368 (interactive) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
369 (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
|
370 (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
|
371 (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
|
372 |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
373 ;; bug reporter |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
374 |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
375 (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
|
376 "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
|
377 (interactive) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
378 ;; 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
|
379 (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
|
380 (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
|
381 (and |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
382 (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
|
383 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
|
384 (require 'reporter) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
385 (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
|
386 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
|
387 (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
|
388 nil |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
389 nil |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
390 nil |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
391 "Dear Gary," |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
392 )))) |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
393 |
17361 | 394 ;; Now enable the mode |
395 | |
22758
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
396 (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
|
397 "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
|
398 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
|
399 (interactive "P") |
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
400 (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
|
401 (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
|
402 (> (prefix-numeric-value arg) 0))) |
17448
b0fb37e0d14b
Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents:
17367
diff
changeset
|
403 (cond |
b0fb37e0d14b
Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents:
17367
diff
changeset
|
404 ((eq crisp-mode-enabled 't) |
b0fb37e0d14b
Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents:
17367
diff
changeset
|
405 (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
|
406 (if crisp-load-scroll-all |
dd277f4e6737
(crisp-load-scroll-all): Renamed from ...-lock.
Richard M. Stallman <rms@gnu.org>
parents:
17448
diff
changeset
|
407 (require 'scroll-all)) |
dd277f4e6737
(crisp-load-scroll-all): Renamed from ...-lock.
Richard M. Stallman <rms@gnu.org>
parents:
17448
diff
changeset
|
408 (if (featurep 'scroll-all) |
dd277f4e6737
(crisp-load-scroll-all): Renamed from ...-lock.
Richard M. Stallman <rms@gnu.org>
parents:
17448
diff
changeset
|
409 (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
|
410 (run-hooks 'crisp-load-hook)) |
b0fb37e0d14b
Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents:
17367
diff
changeset
|
411 ((eq crisp-mode-enabled 'nil) |
b0fb37e0d14b
Install the proper version.
Richard M. Stallman <rms@gnu.org>
parents:
17367
diff
changeset
|
412 (use-global-map crisp-mode-original-keymap)))) |
17361 | 413 |
22758
dbd9ecc9dbac
Added next-buffer/previous-buffer keybindings (bound to M-n/M-p).
Karl Heuer <kwzh@gnu.org>
parents:
20962
diff
changeset
|
414 (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
|
415 (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
|
416 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
|
417 (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
|
418 (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
|
419 (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
|
420 |
17361 | 421 (provide 'crisp) |
422 | |
17367 | 423 ;;; crisp.el ends here |