Mercurial > emacs
annotate lisp/emulation/ws-mode.el @ 112013:f11676feb984
Fix up last change.
* lisp/emacs-lisp/bytecomp.el (byte-compile-output-docform): Fix up use of
print-number-table.
* src/print.c (PRINT_NUMBER_OBJECT, PRINT_NUMBER_STATUS): Remove.
(print_preprocess): Fix handling of uninterned symbols in last change.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Wed, 22 Dec 2010 19:00:12 -0500 |
parents | cc035ccb9275 |
children | 417b1e4d63cd |
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 |
104993
403125cdfb24
Replace empty `let's with `progn'.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
3 ;; Copyright (C) 1991, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, |
106815 | 4 ;; 2009, 2010 Free Software Foundation, Inc. |
841 | 5 |
772
2b5af16c9af3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
656
diff
changeset
|
6 ;; Author: Juergen Nickelsen <nickel@cs.tu-berlin.de> |
2b5af16c9af3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
656
diff
changeset
|
7 ;; Version: 0.7 |
812
485e82a8acb5
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
773
diff
changeset
|
8 ;; Keywords: emulations |
309 | 9 |
6736
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
4935
diff
changeset
|
10 ;; 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
|
11 |
94658
eb7b2376cae5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
12 ;; GNU Emacs is free software: you can redistribute it and/or modify |
6736
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
4935
diff
changeset
|
13 ;; it under the terms of the GNU General Public License as published by |
94658
eb7b2376cae5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
14 ;; the Free Software Foundation, either version 3 of the License, or |
eb7b2376cae5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
15 ;; (at your option) any later version. |
309 | 16 |
6736
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
4935
diff
changeset
|
17 ;; 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
|
18 ;; 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
|
19 ;; 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
|
20 ;; 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
|
21 |
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
4935
diff
changeset
|
22 ;; You should have received a copy of the GNU General Public License |
94658
eb7b2376cae5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
309 | 24 |
772
2b5af16c9af3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
656
diff
changeset
|
25 ;;; Commentary: |
309 | 26 |
1222
3db6f2ac8539
Delete obsolete comments.
Richard M. Stallman <rms@gnu.org>
parents:
841
diff
changeset
|
27 ;; This emulates WordStar, with a major mode. |
309 | 28 |
772
2b5af16c9af3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
656
diff
changeset
|
29 ;;; Code: |
110909
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
30 (defvar wordstar-C-k-map |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
31 (let ((map (make-keymap))) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
32 (define-key map " " ()) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
33 (define-key map "0" 'ws-set-marker-0) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
34 (define-key map "1" 'ws-set-marker-1) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
35 (define-key map "2" 'ws-set-marker-2) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
36 (define-key map "3" 'ws-set-marker-3) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
37 (define-key map "4" 'ws-set-marker-4) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
38 (define-key map "5" 'ws-set-marker-5) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
39 (define-key map "6" 'ws-set-marker-6) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
40 (define-key map "7" 'ws-set-marker-7) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
41 (define-key map "8" 'ws-set-marker-8) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
42 (define-key map "9" 'ws-set-marker-9) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
43 (define-key map "b" 'ws-begin-block) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
44 (define-key map "\C-b" 'ws-begin-block) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
45 (define-key map "c" 'ws-copy-block) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
46 (define-key map "\C-c" 'ws-copy-block) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
47 (define-key map "d" 'save-buffers-kill-emacs) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
48 (define-key map "\C-d" 'save-buffers-kill-emacs) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
49 (define-key map "f" 'find-file) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
50 (define-key map "\C-f" 'find-file) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
51 (define-key map "h" 'ws-show-markers) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
52 (define-key map "\C-h" 'ws-show-markers) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
53 (define-key map "i" 'ws-indent-block) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
54 (define-key map "\C-i" 'ws-indent-block) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
55 (define-key map "k" 'ws-end-block) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
56 (define-key map "\C-k" 'ws-end-block) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
57 (define-key map "p" 'ws-print-block) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
58 (define-key map "\C-p" 'ws-print-block) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
59 (define-key map "q" 'kill-emacs) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
60 (define-key map "\C-q" 'kill-emacs) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
61 (define-key map "r" 'insert-file) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
62 (define-key map "\C-r" 'insert-file) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
63 (define-key map "s" 'save-some-buffers) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
64 (define-key map "\C-s" 'save-some-buffers) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
65 (define-key map "t" 'ws-mark-word) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
66 (define-key map "\C-t" 'ws-mark-word) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
67 (define-key map "u" 'ws-exdent-block) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
68 (define-key map "\C-u" 'keyboard-quit) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
69 (define-key map "v" 'ws-move-block) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
70 (define-key map "\C-v" 'ws-move-block) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
71 (define-key map "w" 'ws-write-block) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
72 (define-key map "\C-w" 'ws-write-block) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
73 (define-key map "x" 'save-buffers-kill-emacs) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
74 (define-key map "\C-x" 'save-buffers-kill-emacs) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
75 (define-key map "y" 'ws-delete-block) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
76 (define-key map "\C-y" 'ws-delete-block) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
77 map) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
78 "") |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
42206
diff
changeset
|
79 |
110909
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
80 (defvar wordstar-C-o-map |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
81 (let ((map (make-keymap))) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
82 (define-key map " " ()) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
83 (define-key map "c" 'wordstar-center-line) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
84 (define-key map "\C-c" 'wordstar-center-line) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
85 (define-key map "b" 'switch-to-buffer) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
86 (define-key map "\C-b" 'switch-to-buffer) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
87 (define-key map "j" 'justify-current-line) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
88 (define-key map "\C-j" 'justify-current-line) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
89 (define-key map "k" 'kill-buffer) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
90 (define-key map "\C-k" 'kill-buffer) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
91 (define-key map "l" 'list-buffers) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
92 (define-key map "\C-l" 'list-buffers) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
93 (define-key map "m" 'auto-fill-mode) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
94 (define-key map "\C-m" 'auto-fill-mode) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
95 (define-key map "r" 'set-fill-column) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
96 (define-key map "\C-r" 'set-fill-column) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
97 (define-key map "\C-u" 'keyboard-quit) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
98 (define-key map "wd" 'delete-other-windows) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
99 (define-key map "wh" 'split-window-horizontally) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
100 (define-key map "wo" 'other-window) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
101 (define-key map "wv" 'split-window-vertically) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
102 map) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
103 "") |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
42206
diff
changeset
|
104 |
110909
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
105 (defvar wordstar-C-q-map |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
106 (let ((map (make-keymap))) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
107 (define-key map " " ()) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
108 (define-key map "0" 'ws-find-marker-0) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
109 (define-key map "1" 'ws-find-marker-1) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
110 (define-key map "2" 'ws-find-marker-2) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
111 (define-key map "3" 'ws-find-marker-3) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
112 (define-key map "4" 'ws-find-marker-4) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
113 (define-key map "5" 'ws-find-marker-5) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
114 (define-key map "6" 'ws-find-marker-6) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
115 (define-key map "7" 'ws-find-marker-7) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
116 (define-key map "8" 'ws-find-marker-8) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
117 (define-key map "9" 'ws-find-marker-9) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
118 (define-key map "a" 'ws-query-replace) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
119 (define-key map "\C-a" 'ws-query-replace) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
120 (define-key map "b" 'ws-goto-block-begin) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
121 (define-key map "\C-b" 'ws-goto-block-begin) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
122 (define-key map "c" 'end-of-buffer) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
123 (define-key map "\C-c" 'end-of-buffer) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
124 (define-key map "d" 'end-of-line) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
125 (define-key map "\C-d" 'end-of-line) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
126 (define-key map "f" 'ws-search) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
127 (define-key map "\C-f" 'ws-search) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
128 (define-key map "k" 'ws-goto-block-end) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
129 (define-key map "\C-k" 'ws-goto-block-end) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
130 (define-key map "l" 'ws-undo) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
131 (define-key map "\C-l" 'ws-undo) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
132 (define-key map "p" 'ws-last-cursorp) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
133 (define-key map "\C-p" 'ws-last-cursorp) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
134 (define-key map "r" 'beginning-of-buffer) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
135 (define-key map "\C-r" 'beginning-of-buffer) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
136 (define-key map "s" 'beginning-of-line) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
137 (define-key map "\C-s" 'beginning-of-line) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
138 (define-key map "\C-u" 'keyboard-quit) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
139 (define-key map "w" 'ws-last-error) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
140 (define-key map "\C-w" 'ws-last-error) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
141 (define-key map "y" 'ws-kill-eol) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
142 (define-key map "\C-y" 'ws-kill-eol) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
143 (define-key map "\177" 'ws-kill-bol) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
144 map) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
145 "") |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
42206
diff
changeset
|
146 |
110909
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
147 (defvar wordstar-mode-map |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
148 (let ((map (make-keymap))) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
149 (define-key map "\C-a" 'backward-word) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
150 (define-key map "\C-b" 'fill-paragraph) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
151 (define-key map "\C-c" 'scroll-up) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
152 (define-key map "\C-d" 'forward-char) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
153 (define-key map "\C-e" 'previous-line) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
154 (define-key map "\C-f" 'forward-word) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
155 (define-key map "\C-g" 'delete-char) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
156 (define-key map "\C-h" 'backward-char) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
157 (define-key map "\C-i" 'indent-for-tab-command) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
158 (define-key map "\C-j" 'help-for-help) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
159 (define-key map "\C-k" wordstar-C-k-map) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
160 (define-key map "\C-l" 'ws-repeat-search) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
161 (define-key map "\C-n" 'open-line) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
162 (define-key map "\C-o" wordstar-C-o-map) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
163 (define-key map "\C-p" 'quoted-insert) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
164 (define-key map "\C-q" wordstar-C-q-map) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
165 (define-key map "\C-r" 'scroll-down) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
166 (define-key map "\C-s" 'backward-char) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
167 (define-key map "\C-t" 'kill-word) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
168 (define-key map "\C-u" 'keyboard-quit) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
169 (define-key map "\C-v" 'overwrite-mode) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
170 (define-key map "\C-w" 'scroll-down-line) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
171 (define-key map "\C-x" 'next-line) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
172 (define-key map "\C-y" 'kill-complete-line) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
173 (define-key map "\C-z" 'scroll-up-line) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
174 map) |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
175 "") |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
42206
diff
changeset
|
176 |
110909
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
177 ;; wordstar-C-j-map not yet implemented |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
178 (defvar wordstar-C-j-map nil "") |
cc035ccb9275
Declare and define in one step various mode maps.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
107785
diff
changeset
|
179 |
309 | 180 |
17657
8116c68d8a77
(wordstar-mode): Add a mode-class property.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
181 (put 'wordstar-mode 'mode-class 'special) |
8116c68d8a77
(wordstar-mode): Add a mode-class property.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
182 |
4935
1f5c25761f2f
(wordstar-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
183 ;;;###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
|
184 (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
|
185 "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
|
186 |
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 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
|
188 - 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
|
189 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
|
190 - 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
|
191 - 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
|
192 - 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
|
193 |
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 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
|
195 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
|
196 |
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 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
|
198 |
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 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
|
200 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
|
201 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
|
202 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
|
203 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
|
204 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
|
205 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
|
206 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
|
207 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
|
208 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
|
209 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
|
210 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
|
211 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
|
212 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
|
213 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
|
214 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
|
215 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
|
216 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
|
217 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
|
218 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
|
219 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
|
220 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
|
221 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
|
222 |
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 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
|
224 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
|
225 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
|
226 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
|
227 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
|
228 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
|
229 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
|
230 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
|
231 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
|
232 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
|
233 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
|
234 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
|
235 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
|
236 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
|
237 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
|
238 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
|
239 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
|
240 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
|
241 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
|
242 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
|
243 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
|
244 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
|
245 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
|
246 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
|
247 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
|
248 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
|
249 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
|
250 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
|
251 |
12969
836d868710ec
(wordstar-center-line): Renamed from center-line.
Richard M. Stallman <rms@gnu.org>
parents:
7690
diff
changeset
|
252 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
|
253 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
|
254 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
|
255 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
|
256 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
|
257 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
|
258 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
|
259 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
|
260 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
|
261 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
|
262 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
|
263 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
|
264 |
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 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
|
266 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
|
267 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
|
268 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
|
269 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
|
270 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
|
271 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
|
272 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
|
273 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
|
274 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
|
275 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
|
276 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
|
277 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
|
278 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
|
279 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
|
280 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
|
281 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
|
282 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
|
283 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
|
284 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
|
285 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
|
286 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
|
287 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
|
288 " |
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 (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
|
290 (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
|
291 (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
|
292 (setq mode-name "WordStar") |
20246
4aa45a7a62e8
(wordstar-mode): Run wordstar-mode-hook.
Karl Heuer <kwzh@gnu.org>
parents:
18383
diff
changeset
|
293 (setq major-mode 'wordstar-mode) |
62759
a796f7d10b85
(wordstar-mode): Use run-mode-hooks.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
294 (run-mode-hooks 'wordstar-mode-hook)) |
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
|
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) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
42206
diff
changeset
|
336 (indent-to |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
42206
diff
changeset
|
337 (+ left-margin |
309 | 338 (/ (- fill-column left-margin line-length) 2)))))) |
339 | |
340 ;;;;;;;;;;; | |
341 ;; wordstar special variables: | |
342 | |
343 (defvar ws-marker-0 nil "Position marker 0 in WordStar mode.") | |
344 (defvar ws-marker-1 nil "Position marker 1 in WordStar mode.") | |
345 (defvar ws-marker-2 nil "Position marker 2 in WordStar mode.") | |
346 (defvar ws-marker-3 nil "Position marker 3 in WordStar mode.") | |
347 (defvar ws-marker-4 nil "Position marker 4 in WordStar mode.") | |
348 (defvar ws-marker-5 nil "Position marker 5 in WordStar mode.") | |
349 (defvar ws-marker-6 nil "Position marker 6 in WordStar mode.") | |
350 (defvar ws-marker-7 nil "Position marker 7 in WordStar mode.") | |
351 (defvar ws-marker-8 nil "Position marker 8 in WordStar mode.") | |
352 (defvar ws-marker-9 nil "Position marker 9 in WordStar mode.") | |
353 | |
354 (defvar ws-block-begin-marker nil "Beginning of \"Block\" in WordStar mode.") | |
355 (defvar ws-block-end-marker nil "End of \"Block\" in WordStar mode.") | |
356 | |
357 (defvar ws-search-string nil "String of last search in WordStar mode.") | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
42206
diff
changeset
|
358 (defvar ws-search-direction t |
42206 | 359 "Direction of last search in WordStar mode. t if forward, nil if backward.") |
309 | 360 |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
42206
diff
changeset
|
361 (defvar ws-last-cursorposition nil |
309 | 362 "Position before last search etc. in WordStar mode.") |
363 | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
42206
diff
changeset
|
364 (defvar ws-last-errormessage nil |
309 | 365 "Last error message issued by a WordStar mode function.") |
366 | |
367 ;;;;;;;;;;; | |
368 ;; wordstar special functions: | |
369 | |
370 (defun ws-error (string) | |
371 "Report error of a WordStar special function. Error message is saved | |
372 in ws-last-errormessage for recovery with C-q w." | |
373 (setq ws-last-errormessage string) | |
374 (error string)) | |
375 | |
376 (defun ws-set-marker-0 () | |
377 "In WordStar mode: Set marker 0 to current cursor position." | |
378 (interactive) | |
379 (setq ws-marker-0 (point-marker)) | |
380 (message "Marker 0 set")) | |
381 | |
382 (defun ws-set-marker-1 () | |
383 "In WordStar mode: Set marker 1 to current cursor position." | |
384 (interactive) | |
385 (setq ws-marker-1 (point-marker)) | |
386 (message "Marker 1 set")) | |
387 | |
388 (defun ws-set-marker-2 () | |
389 "In WordStar mode: Set marker 2 to current cursor position." | |
390 (interactive) | |
391 (setq ws-marker-2 (point-marker)) | |
392 (message "Marker 2 set")) | |
393 | |
394 (defun ws-set-marker-3 () | |
395 "In WordStar mode: Set marker 3 to current cursor position." | |
396 (interactive) | |
397 (setq ws-marker-3 (point-marker)) | |
398 (message "Marker 3 set")) | |
399 | |
400 (defun ws-set-marker-4 () | |
401 "In WordStar mode: Set marker 4 to current cursor position." | |
402 (interactive) | |
403 (setq ws-marker-4 (point-marker)) | |
404 (message "Marker 4 set")) | |
405 | |
406 (defun ws-set-marker-5 () | |
407 "In WordStar mode: Set marker 5 to current cursor position." | |
408 (interactive) | |
409 (setq ws-marker-5 (point-marker)) | |
410 (message "Marker 5 set")) | |
411 | |
412 (defun ws-set-marker-6 () | |
413 "In WordStar mode: Set marker 6 to current cursor position." | |
414 (interactive) | |
415 (setq ws-marker-6 (point-marker)) | |
416 (message "Marker 6 set")) | |
417 | |
418 (defun ws-set-marker-7 () | |
419 "In WordStar mode: Set marker 7 to current cursor position." | |
420 (interactive) | |
421 (setq ws-marker-7 (point-marker)) | |
422 (message "Marker 7 set")) | |
423 | |
424 (defun ws-set-marker-8 () | |
425 "In WordStar mode: Set marker 8 to current cursor position." | |
426 (interactive) | |
427 (setq ws-marker-8 (point-marker)) | |
428 (message "Marker 8 set")) | |
429 | |
430 (defun ws-set-marker-9 () | |
431 "In WordStar mode: Set marker 9 to current cursor position." | |
432 (interactive) | |
433 (setq ws-marker-9 (point-marker)) | |
434 (message "Marker 9 set")) | |
435 | |
436 (defun ws-begin-block () | |
437 "In WordStar mode: Set block begin marker to current cursor position." | |
438 (interactive) | |
439 (setq ws-block-begin-marker (point-marker)) | |
440 (message "Block begin marker set")) | |
441 | |
442 (defun ws-show-markers () | |
443 "In WordStar mode: Show block markers." | |
444 (interactive) | |
445 (if (or ws-block-begin-marker ws-block-end-marker) | |
446 (save-excursion | |
447 (if ws-block-begin-marker | |
104993
403125cdfb24
Replace empty `let's with `progn'.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
448 (progn |
309 | 449 (goto-char ws-block-begin-marker) |
450 (message "Block begin marker") | |
451 (sit-for 2)) | |
452 (message "Block begin marker not set") | |
453 (sit-for 2)) | |
454 (if ws-block-end-marker | |
104993
403125cdfb24
Replace empty `let's with `progn'.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
455 (progn |
309 | 456 (goto-char ws-block-end-marker) |
457 (message "Block end marker") | |
458 (sit-for 2)) | |
459 (message "Block end marker not set")) | |
460 (message "")) | |
461 (message "Block markers not set"))) | |
462 | |
463 | |
464 (defun ws-indent-block () | |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
1244
diff
changeset
|
465 "In WordStar mode: Indent block (not yet implemented)." |
309 | 466 (interactive) |
467 (ws-error "Indent block not yet implemented")) | |
468 | |
469 (defun ws-end-block () | |
470 "In WordStar mode: Set block end marker to current cursor position." | |
471 (interactive) | |
472 (setq ws-block-end-marker (point-marker)) | |
473 (message "Block end marker set")) | |
474 | |
475 (defun ws-print-block () | |
476 "In WordStar mode: Print block." | |
477 (interactive) | |
478 (message "Don't do this. Write block to a file (C-k w) and print this file.")) | |
479 | |
480 (defun ws-mark-word () | |
481 "In WordStar mode: Mark current word as block." | |
482 (interactive) | |
483 (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
|
484 (forward-word 1) |
309 | 485 (sit-for 1) |
486 (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
|
487 (forward-word -1) |
309 | 488 (sit-for 1) |
489 (ws-begin-block))) | |
490 | |
491 (defun ws-exdent-block () | |
492 "I don't know what this (C-k u) should do." | |
493 (interactive) | |
494 (ws-error "This won't be done -- not yet implemented.")) | |
495 | |
496 (defun ws-move-block () | |
497 "In WordStar mode: Move block to current cursor position." | |
498 (interactive) | |
499 (if (and ws-block-begin-marker ws-block-end-marker) | |
104993
403125cdfb24
Replace empty `let's with `progn'.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
500 (progn |
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
|
501 (kill-region ws-block-begin-marker ws-block-end-marker) |
309 | 502 (yank) |
503 (save-excursion | |
504 (goto-char (region-beginning)) | |
505 (setq ws-block-begin-marker (point-marker)) | |
506 (goto-char (region-end)) | |
507 (setq ws-block-end-marker (point-marker)))) | |
508 (ws-error (cond (ws-block-begin-marker "Block end marker not set") | |
509 (ws-block-end-marker "Block begin marker not set") | |
510 (t "Block markers not set"))))) | |
511 | |
512 (defun ws-write-block () | |
513 "In WordStar mode: Write block to file." | |
514 (interactive) | |
515 (if (and ws-block-begin-marker ws-block-end-marker) | |
516 (let ((filename (read-file-name "Write block to file: "))) | |
517 (write-region ws-block-begin-marker ws-block-end-marker filename)) | |
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 | |
523 (defun ws-delete-block () | |
524 "In WordStar mode: Delete block." | |
525 (interactive) | |
526 (if (and ws-block-begin-marker ws-block-end-marker) | |
104993
403125cdfb24
Replace empty `let's with `progn'.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
527 (progn |
309 | 528 (kill-region ws-block-begin-marker ws-block-end-marker) |
529 (setq ws-block-end-marker nil) | |
530 (setq ws-block-begin-marker nil)) | |
531 (ws-error (cond (ws-block-begin-marker "Block end marker not set") | |
532 (ws-block-end-marker "Block begin marker not set") | |
533 (t "Block markers not set"))))) | |
534 | |
535 (defun ws-find-marker-0 () | |
536 "In WordStar mode: Go to marker 0." | |
537 (interactive) | |
538 (if ws-marker-0 | |
104993
403125cdfb24
Replace empty `let's with `progn'.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
539 (progn |
309 | 540 (setq ws-last-cursorposition (point-marker)) |
541 (goto-char ws-marker-0)) | |
542 (ws-error "Marker 0 not set"))) | |
543 | |
544 (defun ws-find-marker-1 () | |
545 "In WordStar mode: Go to marker 1." | |
546 (interactive) | |
547 (if ws-marker-1 | |
104993
403125cdfb24
Replace empty `let's with `progn'.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
548 (progn |
309 | 549 (setq ws-last-cursorposition (point-marker)) |
550 (goto-char ws-marker-1)) | |
551 (ws-error "Marker 1 not set"))) | |
552 | |
553 (defun ws-find-marker-2 () | |
554 "In WordStar mode: Go to marker 2." | |
555 (interactive) | |
556 (if ws-marker-2 | |
104993
403125cdfb24
Replace empty `let's with `progn'.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
557 (progn |
309 | 558 (setq ws-last-cursorposition (point-marker)) |
559 (goto-char ws-marker-2)) | |
560 (ws-error "Marker 2 not set"))) | |
561 | |
562 (defun ws-find-marker-3 () | |
563 "In WordStar mode: Go to marker 3." | |
564 (interactive) | |
565 (if ws-marker-3 | |
104993
403125cdfb24
Replace empty `let's with `progn'.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
566 (progn |
309 | 567 (setq ws-last-cursorposition (point-marker)) |
568 (goto-char ws-marker-3)) | |
569 (ws-error "Marker 3 not set"))) | |
570 | |
571 (defun ws-find-marker-4 () | |
572 "In WordStar mode: Go to marker 4." | |
573 (interactive) | |
574 (if ws-marker-4 | |
104993
403125cdfb24
Replace empty `let's with `progn'.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
575 (progn |
309 | 576 (setq ws-last-cursorposition (point-marker)) |
577 (goto-char ws-marker-4)) | |
578 (ws-error "Marker 4 not set"))) | |
579 | |
580 (defun ws-find-marker-5 () | |
581 "In WordStar mode: Go to marker 5." | |
582 (interactive) | |
583 (if ws-marker-5 | |
104993
403125cdfb24
Replace empty `let's with `progn'.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
584 (progn |
309 | 585 (setq ws-last-cursorposition (point-marker)) |
586 (goto-char ws-marker-5)) | |
587 (ws-error "Marker 5 not set"))) | |
588 | |
589 (defun ws-find-marker-6 () | |
590 "In WordStar mode: Go to marker 6." | |
591 (interactive) | |
592 (if ws-marker-6 | |
104993
403125cdfb24
Replace empty `let's with `progn'.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
593 (progn |
309 | 594 (setq ws-last-cursorposition (point-marker)) |
595 (goto-char ws-marker-6)) | |
596 (ws-error "Marker 6 not set"))) | |
597 | |
598 (defun ws-find-marker-7 () | |
599 "In WordStar mode: Go to marker 7." | |
600 (interactive) | |
601 (if ws-marker-7 | |
104993
403125cdfb24
Replace empty `let's with `progn'.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
602 (progn |
309 | 603 (setq ws-last-cursorposition (point-marker)) |
604 (goto-char ws-marker-7)) | |
605 (ws-error "Marker 7 not set"))) | |
606 | |
607 (defun ws-find-marker-8 () | |
608 "In WordStar mode: Go to marker 8." | |
609 (interactive) | |
610 (if ws-marker-8 | |
104993
403125cdfb24
Replace empty `let's with `progn'.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
611 (progn |
309 | 612 (setq ws-last-cursorposition (point-marker)) |
613 (goto-char ws-marker-8)) | |
614 (ws-error "Marker 8 not set"))) | |
615 | |
616 (defun ws-find-marker-9 () | |
617 "In WordStar mode: Go to marker 9." | |
618 (interactive) | |
619 (if ws-marker-9 | |
104993
403125cdfb24
Replace empty `let's with `progn'.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
620 (progn |
309 | 621 (setq ws-last-cursorposition (point-marker)) |
622 (goto-char ws-marker-9)) | |
623 (ws-error "Marker 9 not set"))) | |
624 | |
625 (defun ws-goto-block-begin () | |
626 "In WordStar mode: Go to block begin marker." | |
627 (interactive) | |
628 (if ws-block-begin-marker | |
104993
403125cdfb24
Replace empty `let's with `progn'.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
629 (progn |
309 | 630 (setq ws-last-cursorposition (point-marker)) |
631 (goto-char ws-block-begin-marker)) | |
632 (ws-error "Block begin marker not set"))) | |
633 | |
634 (defun ws-search (string) | |
635 "In WordStar mode: Search string, remember string for repetition." | |
636 (interactive "sSearch for: ") | |
637 (message "Forward (f) or backward (b)") | |
638 (let ((direction | |
639 (read-char))) | |
7690
5b2b84efaeb9
(ws-search): Fix malformed character constants.
Karl Heuer <kwzh@gnu.org>
parents:
7639
diff
changeset
|
640 (cond ((equal (upcase direction) ?F) |
309 | 641 (setq ws-search-string string) |
642 (setq ws-search-direction t) | |
643 (setq ws-last-cursorposition (point-marker)) | |
644 (search-forward string)) | |
7690
5b2b84efaeb9
(ws-search): Fix malformed character constants.
Karl Heuer <kwzh@gnu.org>
parents:
7639
diff
changeset
|
645 ((equal (upcase direction) ?B) |
309 | 646 (setq ws-search-string string) |
647 (setq ws-search-direction nil) | |
648 (setq ws-last-cursorposition (point-marker)) | |
649 (search-backward string)) | |
650 (t (keyboard-quit))))) | |
651 | |
652 (defun ws-goto-block-end () | |
653 "In WordStar mode: Go to block end marker." | |
654 (interactive) | |
655 (if ws-block-end-marker | |
104993
403125cdfb24
Replace empty `let's with `progn'.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
656 (progn |
309 | 657 (setq ws-last-cursorposition (point-marker)) |
658 (goto-char ws-block-end-marker)) | |
659 (ws-error "Block end marker not set"))) | |
660 | |
661 (defun ws-undo () | |
662 "In WordStar mode: Undo and give message about undoing more changes." | |
663 (interactive) | |
664 (undo) | |
665 (message "Repeat C-q l to undo more changes.")) | |
666 | |
667 (defun ws-goto-last-cursorposition () | |
668 "In WordStar mode: " | |
669 (interactive) | |
670 (if ws-last-cursorposition | |
104993
403125cdfb24
Replace empty `let's with `progn'.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
671 (progn |
309 | 672 (setq ws-last-cursorposition (point-marker)) |
673 (goto-char ws-last-cursorposition)) | |
674 (ws-error "No last cursor position available."))) | |
675 | |
676 (defun ws-last-error () | |
677 "In WordStar mode: repeat last error message. | |
678 This will only work for errors raised by WordStar mode functions." | |
679 (interactive) | |
680 (if ws-last-errormessage | |
65589
0670efd1e2df
message format spec fixes, commit # 8
Deepak Goel <deego@gnufans.org>
parents:
64701
diff
changeset
|
681 (message "%s" ws-last-errormessage) |
309 | 682 (message "No WordStar error yet."))) |
683 | |
684 (defun ws-kill-eol () | |
685 "In WordStar mode: Kill to end of line (like WordStar, not like Emacs)." | |
686 (interactive) | |
687 (let ((p (point))) | |
688 (end-of-line) | |
689 (kill-region p (point)))) | |
690 | |
691 (defun ws-kill-bol () | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
42206
diff
changeset
|
692 "In WordStar mode: Kill to beginning of line |
7639 | 693 \(like WordStar, not like Emacs)." |
309 | 694 (interactive) |
695 (let ((p (point))) | |
696 (beginning-of-line) | |
697 (kill-region (point) p))) | |
698 | |
699 (defun kill-complete-line () | |
700 "Kill the complete line." | |
701 (interactive) | |
702 (beginning-of-line) | |
703 (if (eobp) (error "End of buffer")) | |
704 (let ((beg (point))) | |
705 (forward-line 1) | |
706 (kill-region beg (point)))) | |
707 | |
708 (defun ws-repeat-search () | |
709 "In WordStar mode: Repeat last search." | |
710 (interactive) | |
711 (setq ws-last-cursorposition (point-marker)) | |
712 (if ws-search-string | |
713 (if ws-search-direction | |
714 (search-forward ws-search-string) | |
715 (search-backward ws-search-string)) | |
716 (ws-error "No search to repeat"))) | |
717 | |
718 (defun ws-query-replace (from to) | |
719 "In WordStar mode: Search string, remember string for repetition." | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
42206
diff
changeset
|
720 (interactive "sReplace: |
309 | 721 sWith: " ) |
722 (setq ws-search-string from) | |
723 (setq ws-search-direction t) | |
724 (setq ws-last-cursorposition (point-marker)) | |
725 (query-replace from to)) | |
726 | |
727 (defun ws-copy-block () | |
728 "In WordStar mode: Copy block to current cursor position." | |
729 (interactive) | |
730 (if (and ws-block-begin-marker ws-block-end-marker) | |
104993
403125cdfb24
Replace empty `let's with `progn'.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
731 (progn |
309 | 732 (copy-region-as-kill ws-block-begin-marker ws-block-end-marker) |
733 (yank) | |
734 (save-excursion | |
735 (goto-char (region-beginning)) | |
736 (setq ws-block-begin-marker (point-marker)) | |
737 (goto-char (region-end)) | |
738 (setq ws-block-end-marker (point-marker)))) | |
739 (ws-error (cond (ws-block-begin-marker "Block end marker not set") | |
740 (ws-block-end-marker "Block begin marker not set") | |
741 (t "Block markers not set"))))) | |
656
d74e65773062
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
309
diff
changeset
|
742 |
18383 | 743 (provide 'ws-mode) |
744 | |
93975
1e3a407766b9
Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
79705
diff
changeset
|
745 ;; arch-tag: 6dd864bf-2ccb-4d59-af6e-492eba2890a3 |
656
d74e65773062
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
309
diff
changeset
|
746 ;;; ws-mode.el ends here |