Mercurial > emacs
annotate lisp/emulation/ws-mode.el @ 15456:64addbeb9e96
(LD_SWITCH_SYSTEM): Use no space after -L and -R.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 19 Jun 1996 21:15:58 +0000 |
parents | 83f275dcd93a |
children | 8116c68d8a77 |
rev | line source |
---|---|
656
d74e65773062
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
309
diff
changeset
|
1 ;;; ws-mode.el --- WordStar emulation mode for GNU Emacs |
d74e65773062
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
309
diff
changeset
|
2 |
841 | 3 ;; Copyright (C) 1991 Free Software Foundation, Inc. |
4 | |
772
2b5af16c9af3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
656
diff
changeset
|
5 ;; Author: Juergen Nickelsen <nickel@cs.tu-berlin.de> |
2b5af16c9af3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
656
diff
changeset
|
6 ;; Version: 0.7 |
812
485e82a8acb5
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
773
diff
changeset
|
7 ;; Keywords: emulations |
309 | 8 |
6736
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
4935
diff
changeset
|
9 ;; This file is part of GNU Emacs. |
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
4935
diff
changeset
|
10 |
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
4935
diff
changeset
|
11 ;; GNU Emacs is free software; you can redistribute it and/or modify |
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
4935
diff
changeset
|
12 ;; it under the terms of the GNU General Public License as published by |
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
4935
diff
changeset
|
13 ;; the Free Software Foundation; either version 2, or (at your option) |
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
4935
diff
changeset
|
14 ;; any later version. |
309 | 15 |
6736
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
4935
diff
changeset
|
16 ;; GNU Emacs is distributed in the hope that it will be useful, |
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
4935
diff
changeset
|
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
4935
diff
changeset
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
4935
diff
changeset
|
19 ;; GNU General Public License for more details. |
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
4935
diff
changeset
|
20 |
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
4935
diff
changeset
|
21 ;; You should have received a copy of the GNU General Public License |
14169 | 22 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 ;; Boston, MA 02111-1307, USA. | |
309 | 25 |
772
2b5af16c9af3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
656
diff
changeset
|
26 ;;; Commentary: |
309 | 27 |
1222
3db6f2ac8539
Delete obsolete comments.
Richard M. Stallman <rms@gnu.org>
parents:
841
diff
changeset
|
28 ;; This emulates WordStar, with a major mode. |
309 | 29 |
772
2b5af16c9af3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
656
diff
changeset
|
30 ;;; Code: |
309 | 31 |
32 (defvar wordstar-mode-map nil "") | |
33 (defvar wordstar-C-j-map nil "") | |
34 (defvar wordstar-C-k-map nil "") | |
35 (defvar wordstar-C-o-map nil "") | |
36 (defvar wordstar-C-q-map nil "") | |
37 | |
38 (if wordstar-mode-map | |
39 () | |
40 (setq wordstar-mode-map (make-keymap)) | |
41 ;; (setq wordstar-C-j-map (make-keymap)) ; later, perhaps | |
42 (setq wordstar-C-k-map (make-keymap)) | |
43 (setq wordstar-C-o-map (make-keymap)) | |
44 (setq wordstar-C-q-map (make-keymap)) | |
45 | |
46 (define-key wordstar-mode-map "\C-a" 'backward-word) | |
47 (define-key wordstar-mode-map "\C-b" 'fill-paragraph) | |
48 (define-key wordstar-mode-map "\C-c" 'scroll-up) | |
49 (define-key wordstar-mode-map "\C-d" 'forward-char) | |
50 (define-key wordstar-mode-map "\C-e" 'previous-line) | |
51 (define-key wordstar-mode-map "\C-f" 'forward-word) | |
52 (define-key wordstar-mode-map "\C-g" 'delete-char) | |
53 (define-key wordstar-mode-map "\C-h" 'backward-char) | |
54 (define-key wordstar-mode-map "\C-i" 'indent-for-tab-command) | |
55 (define-key wordstar-mode-map "\C-j" 'help-for-help) | |
56 (define-key wordstar-mode-map "\C-k" wordstar-C-k-map) | |
57 (define-key wordstar-mode-map "\C-l" 'ws-repeat-search) | |
58 (define-key wordstar-mode-map "\C-n" 'open-line) | |
59 (define-key wordstar-mode-map "\C-o" wordstar-C-o-map) | |
60 (define-key wordstar-mode-map "\C-p" 'quoted-insert) | |
61 (define-key wordstar-mode-map "\C-q" wordstar-C-q-map) | |
62 (define-key wordstar-mode-map "\C-r" 'scroll-down) | |
63 (define-key wordstar-mode-map "\C-s" 'backward-char) | |
64 (define-key wordstar-mode-map "\C-t" 'kill-word) | |
65 (define-key wordstar-mode-map "\C-u" 'keyboard-quit) | |
66 (define-key wordstar-mode-map "\C-v" 'overwrite-mode) | |
67 (define-key wordstar-mode-map "\C-w" 'scroll-down-line) | |
68 (define-key wordstar-mode-map "\C-x" 'next-line) | |
69 (define-key wordstar-mode-map "\C-y" 'kill-complete-line) | |
70 (define-key wordstar-mode-map "\C-z" 'scroll-up-line) | |
71 | |
72 ;; wordstar-C-k-map | |
73 | |
74 (define-key wordstar-C-k-map " " ()) | |
75 (define-key wordstar-C-k-map "0" 'ws-set-marker-0) | |
76 (define-key wordstar-C-k-map "1" 'ws-set-marker-1) | |
77 (define-key wordstar-C-k-map "2" 'ws-set-marker-2) | |
78 (define-key wordstar-C-k-map "3" 'ws-set-marker-3) | |
79 (define-key wordstar-C-k-map "4" 'ws-set-marker-4) | |
80 (define-key wordstar-C-k-map "5" 'ws-set-marker-5) | |
81 (define-key wordstar-C-k-map "6" 'ws-set-marker-6) | |
82 (define-key wordstar-C-k-map "7" 'ws-set-marker-7) | |
83 (define-key wordstar-C-k-map "8" 'ws-set-marker-8) | |
84 (define-key wordstar-C-k-map "9" 'ws-set-marker-9) | |
85 (define-key wordstar-C-k-map "b" 'ws-begin-block) | |
86 (define-key wordstar-C-k-map "\C-b" 'ws-begin-block) | |
87 (define-key wordstar-C-k-map "c" 'ws-copy-block) | |
88 (define-key wordstar-C-k-map "\C-c" 'ws-copy-block) | |
89 (define-key wordstar-C-k-map "d" 'save-buffers-kill-emacs) | |
90 (define-key wordstar-C-k-map "\C-d" 'save-buffers-kill-emacs) | |
91 (define-key wordstar-C-k-map "f" 'find-file) | |
92 (define-key wordstar-C-k-map "\C-f" 'find-file) | |
93 (define-key wordstar-C-k-map "h" 'ws-show-markers) | |
94 (define-key wordstar-C-k-map "\C-h" 'ws-show-markers) | |
95 (define-key wordstar-C-k-map "i" 'ws-indent-block) | |
96 (define-key wordstar-C-k-map "\C-i" 'ws-indent-block) | |
97 (define-key wordstar-C-k-map "k" 'ws-end-block) | |
98 (define-key wordstar-C-k-map "\C-k" 'ws-end-block) | |
99 (define-key wordstar-C-k-map "p" 'ws-print-block) | |
100 (define-key wordstar-C-k-map "\C-p" 'ws-print-block) | |
101 (define-key wordstar-C-k-map "q" 'kill-emacs) | |
102 (define-key wordstar-C-k-map "\C-q" 'kill-emacs) | |
103 (define-key wordstar-C-k-map "r" 'insert-file) | |
104 (define-key wordstar-C-k-map "\C-r" 'insert-file) | |
105 (define-key wordstar-C-k-map "s" 'save-some-buffers) | |
106 (define-key wordstar-C-k-map "\C-s" 'save-some-buffers) | |
107 (define-key wordstar-C-k-map "t" 'ws-mark-word) | |
108 (define-key wordstar-C-k-map "\C-t" 'ws-mark-word) | |
109 (define-key wordstar-C-k-map "u" 'ws-exdent-block) | |
110 (define-key wordstar-C-k-map "\C-u" 'keyboard-quit) | |
111 (define-key wordstar-C-k-map "v" 'ws-move-block) | |
112 (define-key wordstar-C-k-map "\C-v" 'ws-move-block) | |
113 (define-key wordstar-C-k-map "w" 'ws-write-block) | |
114 (define-key wordstar-C-k-map "\C-w" 'ws-write-block) | |
115 (define-key wordstar-C-k-map "x" 'save-buffers-kill-emacs) | |
116 (define-key wordstar-C-k-map "\C-x" 'save-buffers-kill-emacs) | |
117 (define-key wordstar-C-k-map "y" 'ws-delete-block) | |
118 (define-key wordstar-C-k-map "\C-y" 'ws-delete-block) | |
119 | |
120 ;; wordstar-C-j-map not yet implemented | |
121 | |
122 ;; wordstar-C-o-map | |
123 | |
124 (define-key wordstar-C-o-map " " ()) | |
12969
836d868710ec
(wordstar-center-line): Renamed from center-line.
Richard M. Stallman <rms@gnu.org>
parents:
7690
diff
changeset
|
125 (define-key wordstar-C-o-map "c" 'wordstar-center-line) |
836d868710ec
(wordstar-center-line): Renamed from center-line.
Richard M. Stallman <rms@gnu.org>
parents:
7690
diff
changeset
|
126 (define-key wordstar-C-o-map "\C-c" 'wordstar-center-line) |
309 | 127 (define-key wordstar-C-o-map "b" 'switch-to-buffer) |
128 (define-key wordstar-C-o-map "\C-b" 'switch-to-buffer) | |
129 (define-key wordstar-C-o-map "j" 'justify-current-line) | |
130 (define-key wordstar-C-o-map "\C-j" 'justify-current-line) | |
131 (define-key wordstar-C-o-map "k" 'kill-buffer) | |
132 (define-key wordstar-C-o-map "\C-k" 'kill-buffer) | |
133 (define-key wordstar-C-o-map "l" 'list-buffers) | |
134 (define-key wordstar-C-o-map "\C-l" 'list-buffers) | |
135 (define-key wordstar-C-o-map "m" 'auto-fill-mode) | |
136 (define-key wordstar-C-o-map "\C-m" 'auto-fill-mode) | |
137 (define-key wordstar-C-o-map "r" 'set-fill-column) | |
138 (define-key wordstar-C-o-map "\C-r" 'set-fill-column) | |
139 (define-key wordstar-C-o-map "\C-u" 'keyboard-quit) | |
140 (define-key wordstar-C-o-map "wd" 'delete-other-windows) | |
141 (define-key wordstar-C-o-map "wh" 'split-window-horizontally) | |
142 (define-key wordstar-C-o-map "wo" 'other-window) | |
143 (define-key wordstar-C-o-map "wv" 'split-window-vertically) | |
144 | |
145 ;; wordstar-C-q-map | |
146 (define-key wordstar-C-q-map " " ()) | |
147 (define-key wordstar-C-q-map "0" 'ws-find-marker-0) | |
148 (define-key wordstar-C-q-map "1" 'ws-find-marker-1) | |
149 (define-key wordstar-C-q-map "2" 'ws-find-marker-2) | |
150 (define-key wordstar-C-q-map "3" 'ws-find-marker-3) | |
151 (define-key wordstar-C-q-map "4" 'ws-find-marker-4) | |
152 (define-key wordstar-C-q-map "5" 'ws-find-marker-5) | |
153 (define-key wordstar-C-q-map "6" 'ws-find-marker-6) | |
154 (define-key wordstar-C-q-map "7" 'ws-find-marker-7) | |
155 (define-key wordstar-C-q-map "8" 'ws-find-marker-8) | |
156 (define-key wordstar-C-q-map "9" 'ws-find-marker-9) | |
157 (define-key wordstar-C-q-map "a" 'ws-query-replace) | |
158 (define-key wordstar-C-q-map "\C-a" 'ws-query-replace) | |
159 (define-key wordstar-C-q-map "b" 'ws-goto-block-begin) | |
160 (define-key wordstar-C-q-map "\C-b" 'ws-goto-block-begin) | |
161 (define-key wordstar-C-q-map "c" 'end-of-buffer) | |
162 (define-key wordstar-C-q-map "\C-c" 'end-of-buffer) | |
163 (define-key wordstar-C-q-map "d" 'end-of-line) | |
164 (define-key wordstar-C-q-map "\C-d" 'end-of-line) | |
165 (define-key wordstar-C-q-map "f" 'ws-search) | |
166 (define-key wordstar-C-q-map "\C-f" 'ws-search) | |
167 (define-key wordstar-C-q-map "k" 'ws-goto-block-end) | |
168 (define-key wordstar-C-q-map "\C-k" 'ws-goto-block-end) | |
169 (define-key wordstar-C-q-map "l" 'ws-undo) | |
170 (define-key wordstar-C-q-map "\C-l" 'ws-undo) | |
171 (define-key wordstar-C-q-map "p" 'ws-last-cursorp) | |
172 (define-key wordstar-C-q-map "\C-p" 'ws-last-cursorp) | |
173 (define-key wordstar-C-q-map "r" 'beginning-of-buffer) | |
174 (define-key wordstar-C-q-map "\C-r" 'beginning-of-buffer) | |
175 (define-key wordstar-C-q-map "s" 'beginning-of-line) | |
176 (define-key wordstar-C-q-map "\C-s" 'beginning-of-line) | |
177 (define-key wordstar-C-q-map "\C-u" 'keyboard-quit) | |
178 (define-key wordstar-C-q-map "w" 'ws-last-error) | |
179 (define-key wordstar-C-q-map "\C-w" 'ws-last-error) | |
180 (define-key wordstar-C-q-map "y" 'ws-kill-eol) | |
181 (define-key wordstar-C-q-map "\C-y" 'ws-kill-eol) | |
182 (define-key wordstar-C-q-map "\177" 'ws-kill-bol)) | |
183 | |
4935
1f5c25761f2f
(wordstar-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
184 ;;;###autoload |
1244
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
185 (defun wordstar-mode () |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
186 "Major mode with WordStar-like key bindings. |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
187 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
188 BUGS: |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
189 - Help menus with WordStar commands (C-j just calls help-for-help) |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
190 are not implemented |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
191 - Options for search and replace |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
192 - Show markers (C-k h) is somewhat strange |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
193 - Search and replace (C-q a) is only available in forward direction |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
194 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
195 No key bindings beginning with ESC are installed, they will work |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
196 Emacs-like. |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
197 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
198 The key bindings are: |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
199 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
200 C-a backward-word |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
201 C-b fill-paragraph |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
202 C-c scroll-up-line |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
203 C-d forward-char |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
204 C-e previous-line |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
205 C-f forward-word |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
206 C-g delete-char |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
207 C-h backward-char |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
208 C-i indent-for-tab-command |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
209 C-j help-for-help |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
210 C-k ordstar-C-k-map |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
211 C-l ws-repeat-search |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
212 C-n open-line |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
213 C-p quoted-insert |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
214 C-r scroll-down-line |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
215 C-s backward-char |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
216 C-t kill-word |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
217 C-u keyboard-quit |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
218 C-v overwrite-mode |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
219 C-w scroll-down |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
220 C-x next-line |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
221 C-y kill-complete-line |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
222 C-z scroll-up |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
223 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
224 C-k 0 ws-set-marker-0 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
225 C-k 1 ws-set-marker-1 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
226 C-k 2 ws-set-marker-2 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
227 C-k 3 ws-set-marker-3 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
228 C-k 4 ws-set-marker-4 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
229 C-k 5 ws-set-marker-5 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
230 C-k 6 ws-set-marker-6 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
231 C-k 7 ws-set-marker-7 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
232 C-k 8 ws-set-marker-8 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
233 C-k 9 ws-set-marker-9 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
234 C-k b ws-begin-block |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
235 C-k c ws-copy-block |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
236 C-k d save-buffers-kill-emacs |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
237 C-k f find-file |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
238 C-k h ws-show-markers |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
239 C-k i ws-indent-block |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
240 C-k k ws-end-block |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
241 C-k p ws-print-block |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
242 C-k q kill-emacs |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
243 C-k r insert-file |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
244 C-k s save-some-buffers |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
245 C-k t ws-mark-word |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
246 C-k u ws-exdent-block |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
247 C-k C-u keyboard-quit |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
248 C-k v ws-move-block |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
249 C-k w ws-write-block |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
250 C-k x kill-emacs |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
251 C-k y ws-delete-block |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
252 |
12969
836d868710ec
(wordstar-center-line): Renamed from center-line.
Richard M. Stallman <rms@gnu.org>
parents:
7690
diff
changeset
|
253 C-o c wordstar-center-line |
1244
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
254 C-o b switch-to-buffer |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
255 C-o j justify-current-line |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
256 C-o k kill-buffer |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
257 C-o l list-buffers |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
258 C-o m auto-fill-mode |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
259 C-o r set-fill-column |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
260 C-o C-u keyboard-quit |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
261 C-o wd delete-other-windows |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
262 C-o wh split-window-horizontally |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
263 C-o wo other-window |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
264 C-o wv split-window-vertically |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
265 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
266 C-q 0 ws-find-marker-0 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
267 C-q 1 ws-find-marker-1 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
268 C-q 2 ws-find-marker-2 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
269 C-q 3 ws-find-marker-3 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
270 C-q 4 ws-find-marker-4 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
271 C-q 5 ws-find-marker-5 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
272 C-q 6 ws-find-marker-6 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
273 C-q 7 ws-find-marker-7 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
274 C-q 8 ws-find-marker-8 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
275 C-q 9 ws-find-marker-9 |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
276 C-q a ws-query-replace |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
277 C-q b ws-to-block-begin |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
278 C-q c end-of-buffer |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
279 C-q d end-of-line |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
280 C-q f ws-search |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
281 C-q k ws-to-block-end |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
282 C-q l ws-undo |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
283 C-q p ws-last-cursorp |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
284 C-q r beginning-of-buffer |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
285 C-q C-u keyboard-quit |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
286 C-q w ws-last-error |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
287 C-q y ws-kill-eol |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
288 C-q DEL ws-kill-bol |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
289 " |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
290 (interactive) |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
291 (kill-all-local-variables) |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
292 (use-local-map wordstar-mode-map) |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
293 (setq mode-name "WordStar") |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
294 (setq major-mode 'wordstar-mode)) |
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
295 |
309 | 296 |
12969
836d868710ec
(wordstar-center-line): Renamed from center-line.
Richard M. Stallman <rms@gnu.org>
parents:
7690
diff
changeset
|
297 (defun wordstar-center-paragraph () |
309 | 298 "Center each line in the paragraph at or after point. |
12969
836d868710ec
(wordstar-center-line): Renamed from center-line.
Richard M. Stallman <rms@gnu.org>
parents:
7690
diff
changeset
|
299 See `wordstar-center-line' for more info." |
309 | 300 (interactive) |
301 (save-excursion | |
302 (forward-paragraph) | |
303 (or (bolp) (newline 1)) | |
304 (let ((end (point))) | |
305 (backward-paragraph) | |
12969
836d868710ec
(wordstar-center-line): Renamed from center-line.
Richard M. Stallman <rms@gnu.org>
parents:
7690
diff
changeset
|
306 (wordstar-center-region (point) end)))) |
309 | 307 |
12969
836d868710ec
(wordstar-center-line): Renamed from center-line.
Richard M. Stallman <rms@gnu.org>
parents:
7690
diff
changeset
|
308 (defun wordstar-center-region (from to) |
309 | 309 "Center each line starting in the region. |
12969
836d868710ec
(wordstar-center-line): Renamed from center-line.
Richard M. Stallman <rms@gnu.org>
parents:
7690
diff
changeset
|
310 See `wordstar-center-line' for more info." |
309 | 311 (interactive "r") |
312 (if (> from to) | |
313 (let ((tem to)) | |
314 (setq to from from tem))) | |
315 (save-excursion | |
316 (save-restriction | |
317 (narrow-to-region from to) | |
318 (goto-char from) | |
319 (while (not (eobp)) | |
12969
836d868710ec
(wordstar-center-line): Renamed from center-line.
Richard M. Stallman <rms@gnu.org>
parents:
7690
diff
changeset
|
320 (wordstar-center-line) |
309 | 321 (forward-line 1))))) |
322 | |
12969
836d868710ec
(wordstar-center-line): Renamed from center-line.
Richard M. Stallman <rms@gnu.org>
parents:
7690
diff
changeset
|
323 (defun wordstar-center-line () |
309 | 324 "Center the line point is on, within the width specified by `fill-column'. |
325 This means adjusting the indentation to match | |
326 the distance between the end of the text and `fill-column'." | |
327 (interactive) | |
328 (save-excursion | |
329 (let (line-length) | |
330 (beginning-of-line) | |
331 (delete-horizontal-space) | |
332 (end-of-line) | |
333 (delete-horizontal-space) | |
334 (setq line-length (current-column)) | |
335 (beginning-of-line) | |
336 (indent-to | |
337 (+ left-margin | |
338 (/ (- fill-column left-margin line-length) 2)))))) | |
339 | |
340 (defun scroll-down-line () | |
341 "Scroll one line down." | |
342 (interactive) | |
343 (scroll-down 1)) | |
344 | |
345 (defun scroll-up-line () | |
346 "Scroll one line up." | |
347 (interactive) | |
348 (scroll-up 1)) | |
349 | |
350 ;;;;;;;;;;; | |
351 ;; wordstar special variables: | |
352 | |
353 (defvar ws-marker-0 nil "Position marker 0 in WordStar mode.") | |
354 (defvar ws-marker-1 nil "Position marker 1 in WordStar mode.") | |
355 (defvar ws-marker-2 nil "Position marker 2 in WordStar mode.") | |
356 (defvar ws-marker-3 nil "Position marker 3 in WordStar mode.") | |
357 (defvar ws-marker-4 nil "Position marker 4 in WordStar mode.") | |
358 (defvar ws-marker-5 nil "Position marker 5 in WordStar mode.") | |
359 (defvar ws-marker-6 nil "Position marker 6 in WordStar mode.") | |
360 (defvar ws-marker-7 nil "Position marker 7 in WordStar mode.") | |
361 (defvar ws-marker-8 nil "Position marker 8 in WordStar mode.") | |
362 (defvar ws-marker-9 nil "Position marker 9 in WordStar mode.") | |
363 | |
364 (defvar ws-block-begin-marker nil "Beginning of \"Block\" in WordStar mode.") | |
365 (defvar ws-block-end-marker nil "End of \"Block\" in WordStar mode.") | |
366 | |
367 (defvar ws-search-string nil "String of last search in WordStar mode.") | |
368 (defvar ws-search-direction t | |
369 "Direction of last search in WordStar mode. T if forward, NIL if backward.") | |
370 | |
371 (defvar ws-last-cursorposition nil | |
372 "Position before last search etc. in WordStar mode.") | |
373 | |
374 (defvar ws-last-errormessage nil | |
375 "Last error message issued by a WordStar mode function.") | |
376 | |
377 ;;;;;;;;;;; | |
378 ;; wordstar special functions: | |
379 | |
380 (defun ws-error (string) | |
381 "Report error of a WordStar special function. Error message is saved | |
382 in ws-last-errormessage for recovery with C-q w." | |
383 (setq ws-last-errormessage string) | |
384 (error string)) | |
385 | |
386 (defun ws-set-marker-0 () | |
387 "In WordStar mode: Set marker 0 to current cursor position." | |
388 (interactive) | |
389 (setq ws-marker-0 (point-marker)) | |
390 (message "Marker 0 set")) | |
391 | |
392 (defun ws-set-marker-1 () | |
393 "In WordStar mode: Set marker 1 to current cursor position." | |
394 (interactive) | |
395 (setq ws-marker-1 (point-marker)) | |
396 (message "Marker 1 set")) | |
397 | |
398 (defun ws-set-marker-2 () | |
399 "In WordStar mode: Set marker 2 to current cursor position." | |
400 (interactive) | |
401 (setq ws-marker-2 (point-marker)) | |
402 (message "Marker 2 set")) | |
403 | |
404 (defun ws-set-marker-3 () | |
405 "In WordStar mode: Set marker 3 to current cursor position." | |
406 (interactive) | |
407 (setq ws-marker-3 (point-marker)) | |
408 (message "Marker 3 set")) | |
409 | |
410 (defun ws-set-marker-4 () | |
411 "In WordStar mode: Set marker 4 to current cursor position." | |
412 (interactive) | |
413 (setq ws-marker-4 (point-marker)) | |
414 (message "Marker 4 set")) | |
415 | |
416 (defun ws-set-marker-5 () | |
417 "In WordStar mode: Set marker 5 to current cursor position." | |
418 (interactive) | |
419 (setq ws-marker-5 (point-marker)) | |
420 (message "Marker 5 set")) | |
421 | |
422 (defun ws-set-marker-6 () | |
423 "In WordStar mode: Set marker 6 to current cursor position." | |
424 (interactive) | |
425 (setq ws-marker-6 (point-marker)) | |
426 (message "Marker 6 set")) | |
427 | |
428 (defun ws-set-marker-7 () | |
429 "In WordStar mode: Set marker 7 to current cursor position." | |
430 (interactive) | |
431 (setq ws-marker-7 (point-marker)) | |
432 (message "Marker 7 set")) | |
433 | |
434 (defun ws-set-marker-8 () | |
435 "In WordStar mode: Set marker 8 to current cursor position." | |
436 (interactive) | |
437 (setq ws-marker-8 (point-marker)) | |
438 (message "Marker 8 set")) | |
439 | |
440 (defun ws-set-marker-9 () | |
441 "In WordStar mode: Set marker 9 to current cursor position." | |
442 (interactive) | |
443 (setq ws-marker-9 (point-marker)) | |
444 (message "Marker 9 set")) | |
445 | |
446 (defun ws-begin-block () | |
447 "In WordStar mode: Set block begin marker to current cursor position." | |
448 (interactive) | |
449 (setq ws-block-begin-marker (point-marker)) | |
450 (message "Block begin marker set")) | |
451 | |
452 (defun ws-show-markers () | |
453 "In WordStar mode: Show block markers." | |
454 (interactive) | |
455 (if (or ws-block-begin-marker ws-block-end-marker) | |
456 (save-excursion | |
457 (if ws-block-begin-marker | |
458 (let () | |
459 (goto-char ws-block-begin-marker) | |
460 (message "Block begin marker") | |
461 (sit-for 2)) | |
462 (message "Block begin marker not set") | |
463 (sit-for 2)) | |
464 (if ws-block-end-marker | |
465 (let () | |
466 (goto-char ws-block-end-marker) | |
467 (message "Block end marker") | |
468 (sit-for 2)) | |
469 (message "Block end marker not set")) | |
470 (message "")) | |
471 (message "Block markers not set"))) | |
472 | |
473 | |
474 (defun ws-indent-block () | |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
1244
diff
changeset
|
475 "In WordStar mode: Indent block (not yet implemented)." |
309 | 476 (interactive) |
477 (ws-error "Indent block not yet implemented")) | |
478 | |
479 (defun ws-end-block () | |
480 "In WordStar mode: Set block end marker to current cursor position." | |
481 (interactive) | |
482 (setq ws-block-end-marker (point-marker)) | |
483 (message "Block end marker set")) | |
484 | |
485 (defun ws-print-block () | |
486 "In WordStar mode: Print block." | |
487 (interactive) | |
488 (message "Don't do this. Write block to a file (C-k w) and print this file.")) | |
489 | |
490 (defun ws-mark-word () | |
491 "In WordStar mode: Mark current word as block." | |
492 (interactive) | |
493 (save-excursion | |
1244
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
494 (forward-word 1) |
309 | 495 (sit-for 1) |
496 (ws-end-block) | |
1244
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
497 (forward-word -1) |
309 | 498 (sit-for 1) |
499 (ws-begin-block))) | |
500 | |
501 (defun ws-exdent-block () | |
502 "I don't know what this (C-k u) should do." | |
503 (interactive) | |
504 (ws-error "This won't be done -- not yet implemented.")) | |
505 | |
506 (defun ws-move-block () | |
507 "In WordStar mode: Move block to current cursor position." | |
508 (interactive) | |
509 (if (and ws-block-begin-marker ws-block-end-marker) | |
510 (let () | |
1244
ee01548e8ba5
(ws-mark-word): Use forward-word, with an arg, instead of backward-word.
Richard M. Stallman <rms@gnu.org>
parents:
1222
diff
changeset
|
511 (kill-region ws-block-begin-marker ws-block-end-marker) |
309 | 512 (yank) |
513 (save-excursion | |
514 (goto-char (region-beginning)) | |
515 (setq ws-block-begin-marker (point-marker)) | |
516 (goto-char (region-end)) | |
517 (setq ws-block-end-marker (point-marker)))) | |
518 (ws-error (cond (ws-block-begin-marker "Block end marker not set") | |
519 (ws-block-end-marker "Block begin marker not set") | |
520 (t "Block markers not set"))))) | |
521 | |
522 (defun ws-write-block () | |
523 "In WordStar mode: Write block to file." | |
524 (interactive) | |
525 (if (and ws-block-begin-marker ws-block-end-marker) | |
526 (let ((filename (read-file-name "Write block to file: "))) | |
527 (write-region ws-block-begin-marker ws-block-end-marker filename)) | |
528 (ws-error (cond (ws-block-begin-marker "Block end marker not set") | |
529 (ws-block-end-marker "Block begin marker not set") | |
530 (t "Block markers not set"))))) | |
531 | |
532 | |
533 (defun ws-delete-block () | |
534 "In WordStar mode: Delete block." | |
535 (interactive) | |
536 (if (and ws-block-begin-marker ws-block-end-marker) | |
537 (let () | |
538 (kill-region ws-block-begin-marker ws-block-end-marker) | |
539 (setq ws-block-end-marker nil) | |
540 (setq ws-block-begin-marker nil)) | |
541 (ws-error (cond (ws-block-begin-marker "Block end marker not set") | |
542 (ws-block-end-marker "Block begin marker not set") | |
543 (t "Block markers not set"))))) | |
544 | |
545 (defun ws-find-marker-0 () | |
546 "In WordStar mode: Go to marker 0." | |
547 (interactive) | |
548 (if ws-marker-0 | |
549 (let () | |
550 (setq ws-last-cursorposition (point-marker)) | |
551 (goto-char ws-marker-0)) | |
552 (ws-error "Marker 0 not set"))) | |
553 | |
554 (defun ws-find-marker-1 () | |
555 "In WordStar mode: Go to marker 1." | |
556 (interactive) | |
557 (if ws-marker-1 | |
558 (let () | |
559 (setq ws-last-cursorposition (point-marker)) | |
560 (goto-char ws-marker-1)) | |
561 (ws-error "Marker 1 not set"))) | |
562 | |
563 (defun ws-find-marker-2 () | |
564 "In WordStar mode: Go to marker 2." | |
565 (interactive) | |
566 (if ws-marker-2 | |
567 (let () | |
568 (setq ws-last-cursorposition (point-marker)) | |
569 (goto-char ws-marker-2)) | |
570 (ws-error "Marker 2 not set"))) | |
571 | |
572 (defun ws-find-marker-3 () | |
573 "In WordStar mode: Go to marker 3." | |
574 (interactive) | |
575 (if ws-marker-3 | |
576 (let () | |
577 (setq ws-last-cursorposition (point-marker)) | |
578 (goto-char ws-marker-3)) | |
579 (ws-error "Marker 3 not set"))) | |
580 | |
581 (defun ws-find-marker-4 () | |
582 "In WordStar mode: Go to marker 4." | |
583 (interactive) | |
584 (if ws-marker-4 | |
585 (let () | |
586 (setq ws-last-cursorposition (point-marker)) | |
587 (goto-char ws-marker-4)) | |
588 (ws-error "Marker 4 not set"))) | |
589 | |
590 (defun ws-find-marker-5 () | |
591 "In WordStar mode: Go to marker 5." | |
592 (interactive) | |
593 (if ws-marker-5 | |
594 (let () | |
595 (setq ws-last-cursorposition (point-marker)) | |
596 (goto-char ws-marker-5)) | |
597 (ws-error "Marker 5 not set"))) | |
598 | |
599 (defun ws-find-marker-6 () | |
600 "In WordStar mode: Go to marker 6." | |
601 (interactive) | |
602 (if ws-marker-6 | |
603 (let () | |
604 (setq ws-last-cursorposition (point-marker)) | |
605 (goto-char ws-marker-6)) | |
606 (ws-error "Marker 6 not set"))) | |
607 | |
608 (defun ws-find-marker-7 () | |
609 "In WordStar mode: Go to marker 7." | |
610 (interactive) | |
611 (if ws-marker-7 | |
612 (let () | |
613 (setq ws-last-cursorposition (point-marker)) | |
614 (goto-char ws-marker-7)) | |
615 (ws-error "Marker 7 not set"))) | |
616 | |
617 (defun ws-find-marker-8 () | |
618 "In WordStar mode: Go to marker 8." | |
619 (interactive) | |
620 (if ws-marker-8 | |
621 (let () | |
622 (setq ws-last-cursorposition (point-marker)) | |
623 (goto-char ws-marker-8)) | |
624 (ws-error "Marker 8 not set"))) | |
625 | |
626 (defun ws-find-marker-9 () | |
627 "In WordStar mode: Go to marker 9." | |
628 (interactive) | |
629 (if ws-marker-9 | |
630 (let () | |
631 (setq ws-last-cursorposition (point-marker)) | |
632 (goto-char ws-marker-9)) | |
633 (ws-error "Marker 9 not set"))) | |
634 | |
635 (defun ws-goto-block-begin () | |
636 "In WordStar mode: Go to block begin marker." | |
637 (interactive) | |
638 (if ws-block-begin-marker | |
639 (let () | |
640 (setq ws-last-cursorposition (point-marker)) | |
641 (goto-char ws-block-begin-marker)) | |
642 (ws-error "Block begin marker not set"))) | |
643 | |
644 (defun ws-search (string) | |
645 "In WordStar mode: Search string, remember string for repetition." | |
646 (interactive "sSearch for: ") | |
647 (message "Forward (f) or backward (b)") | |
648 (let ((direction | |
649 (read-char))) | |
7690
5b2b84efaeb9
(ws-search): Fix malformed character constants.
Karl Heuer <kwzh@gnu.org>
parents:
7639
diff
changeset
|
650 (cond ((equal (upcase direction) ?F) |
309 | 651 (setq ws-search-string string) |
652 (setq ws-search-direction t) | |
653 (setq ws-last-cursorposition (point-marker)) | |
654 (search-forward string)) | |
7690
5b2b84efaeb9
(ws-search): Fix malformed character constants.
Karl Heuer <kwzh@gnu.org>
parents:
7639
diff
changeset
|
655 ((equal (upcase direction) ?B) |
309 | 656 (setq ws-search-string string) |
657 (setq ws-search-direction nil) | |
658 (setq ws-last-cursorposition (point-marker)) | |
659 (search-backward string)) | |
660 (t (keyboard-quit))))) | |
661 | |
662 (defun ws-goto-block-end () | |
663 "In WordStar mode: Go to block end marker." | |
664 (interactive) | |
665 (if ws-block-end-marker | |
666 (let () | |
667 (setq ws-last-cursorposition (point-marker)) | |
668 (goto-char ws-block-end-marker)) | |
669 (ws-error "Block end marker not set"))) | |
670 | |
671 (defun ws-undo () | |
672 "In WordStar mode: Undo and give message about undoing more changes." | |
673 (interactive) | |
674 (undo) | |
675 (message "Repeat C-q l to undo more changes.")) | |
676 | |
677 (defun ws-goto-last-cursorposition () | |
678 "In WordStar mode: " | |
679 (interactive) | |
680 (if ws-last-cursorposition | |
681 (let () | |
682 (setq ws-last-cursorposition (point-marker)) | |
683 (goto-char ws-last-cursorposition)) | |
684 (ws-error "No last cursor position available."))) | |
685 | |
686 (defun ws-last-error () | |
687 "In WordStar mode: repeat last error message. | |
688 This will only work for errors raised by WordStar mode functions." | |
689 (interactive) | |
690 (if ws-last-errormessage | |
691 (message ws-last-errormessage) | |
692 (message "No WordStar error yet."))) | |
693 | |
694 (defun ws-kill-eol () | |
695 "In WordStar mode: Kill to end of line (like WordStar, not like Emacs)." | |
696 (interactive) | |
697 (let ((p (point))) | |
698 (end-of-line) | |
699 (kill-region p (point)))) | |
700 | |
701 (defun ws-kill-bol () | |
702 "In WordStar mode: Kill to beginning of line | |
7639 | 703 \(like WordStar, not like Emacs)." |
309 | 704 (interactive) |
705 (let ((p (point))) | |
706 (beginning-of-line) | |
707 (kill-region (point) p))) | |
708 | |
709 (defun kill-complete-line () | |
710 "Kill the complete line." | |
711 (interactive) | |
712 (beginning-of-line) | |
713 (if (eobp) (error "End of buffer")) | |
714 (let ((beg (point))) | |
715 (forward-line 1) | |
716 (kill-region beg (point)))) | |
717 | |
718 (defun ws-repeat-search () | |
719 "In WordStar mode: Repeat last search." | |
720 (interactive) | |
721 (setq ws-last-cursorposition (point-marker)) | |
722 (if ws-search-string | |
723 (if ws-search-direction | |
724 (search-forward ws-search-string) | |
725 (search-backward ws-search-string)) | |
726 (ws-error "No search to repeat"))) | |
727 | |
728 (defun ws-query-replace (from to) | |
729 "In WordStar mode: Search string, remember string for repetition." | |
730 (interactive "sReplace: | |
731 sWith: " ) | |
732 (setq ws-search-string from) | |
733 (setq ws-search-direction t) | |
734 (setq ws-last-cursorposition (point-marker)) | |
735 (query-replace from to)) | |
736 | |
737 (defun ws-copy-block () | |
738 "In WordStar mode: Copy block to current cursor position." | |
739 (interactive) | |
740 (if (and ws-block-begin-marker ws-block-end-marker) | |
741 (let () | |
742 (copy-region-as-kill ws-block-begin-marker ws-block-end-marker) | |
743 (yank) | |
744 (save-excursion | |
745 (goto-char (region-beginning)) | |
746 (setq ws-block-begin-marker (point-marker)) | |
747 (goto-char (region-end)) | |
748 (setq ws-block-end-marker (point-marker)))) | |
749 (ws-error (cond (ws-block-begin-marker "Block end marker not set") | |
750 (ws-block-end-marker "Block begin marker not set") | |
751 (t "Block markers not set"))))) | |
656
d74e65773062
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
309
diff
changeset
|
752 |
d74e65773062
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
309
diff
changeset
|
753 ;;; ws-mode.el ends here |