Mercurial > emacs
annotate lisp/emulation/edt.el @ 45266:f93cb851704f
*** empty log message ***
author | Colin Walters <walters@gnu.org> |
---|---|
date | Mon, 13 May 2002 05:47:08 +0000 |
parents | 64274328203b |
children | 2c6ffe81125c |
rev | line source |
---|---|
38436
b174db545cfd
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
35124
diff
changeset
|
1 ;;; edt.el --- enhanced EDT keypad mode emulation for GNU Emacs 19 |
660
08eb386dd0f3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
258
diff
changeset
|
2 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
3 ;; Copyright (C) 1986, 1992, 1993, 1994, 1995, 2000, 2001 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
4 ;; Free Software Foundation, Inc. |
846
20674ae6bf52
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
811
diff
changeset
|
5 |
18943 | 6 ;; Author: Kevin Gallagher <kevingal@onramp.net> |
7 ;; Maintainer: Kevin Gallagher <kevingal@onramp.net> | |
811
e694e0879463
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
807
diff
changeset
|
8 ;; Keywords: emulations |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
793
diff
changeset
|
9 |
57 | 10 ;; This file is part of GNU Emacs. |
11 | |
12 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
13 ;; it under the terms of the GNU General Public License as published |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
14 ;; by the Free Software Foundation; either version 2, or (at your |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
15 ;; option) any later version. |
57 | 16 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
17 ;; GNU Emacs is distributed in the hope that it will be useful, but |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
20 ;; General Public License for more details. |
57 | 21 |
22 ;; You should have received a copy of the GNU General Public License | |
14169 | 23 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
25 ;; Boston, MA 02111-1307, USA. | |
57 | 26 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
27 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
28 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
29 ;;; Commentary: |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
30 ;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
31 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
32 ;; This is Version 4.0 of the EDT Emulation for Emacs 19 and above. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
33 ;; It comes with special functions which replicate nearly all of EDT's |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
34 ;; keypad mode behavior. It sets up default keypad and function key |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
35 ;; bindings which closely match those found in EDT. Support is |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
36 ;; provided so that users may reconfigure most keypad and function key |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
37 ;; bindings to their own liking. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
38 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
39 ;; NOTE: Version 4.0 contains several enhancements. See the |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
40 ;; Enhancement section below for the details. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
41 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
42 ;; Getting Started: |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
43 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
44 ;; To start the EDT Emulation, first start Emacs and then enter |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
45 ;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
46 ;; M-x edt-emulation-on |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
47 ;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
48 ;; to begin the emulation. After initialization is complete, the |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
49 ;; following message will appear below the status line informing you |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
50 ;; that the emulation has been enabled: "Default EDT keymap active". |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
51 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
52 ;; You can have the EDT Emulation start up automatically, each time |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
53 ;; you initiate a GNU Emacs session, by adding the following line to |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
54 ;; your .emacs file: |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
55 ;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
56 ;; (add-hook term-setup-hook 'edt-emulation-on) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
57 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
58 ;; IMPORTANT: Be sure to read the file, edt-user.doc, located in the |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
59 ;; Emacs "etc" directory. It contains very helpful user information. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
60 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
61 ;; The EDT emulation consists of the following files: |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
62 ;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
63 ;; edt-user.doc - User Instructions and Sample Customization File |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
64 ;; edt.el - EDT Emulation Functions and Default Configuration |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
65 ;; edt-lk201.el - Built-in support for DEC LK-201 Keyboards |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
66 ;; edt-vt100.el - Built-in support for DEC VT-100 (and above) terminals |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
67 ;; edt-pc.el - Built-in support for PC 101 Keyboards under MS-DOS |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
68 ;; edt-mapper.el - Create an EDT LK-201 Map File for Keyboards Without |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
69 ;; Built-in Support |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
70 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
71 ;; Enhancements: |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
72 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
73 ;; Version 4.0 contains the following enhancements: |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
74 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
75 ;; 1. Scroll margins at the top and bottom of the window are now |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
76 ;; supported. (The design was copied from tpu-extras.el.) By |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
77 ;; default, this feature is enabled, with the top margin set to |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
78 ;; 10% of the window and the bottom margin set to 15% of the |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
79 ;; window. To change these settings, you can invoke the function |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
80 ;; edt-set-scroll-margins in your .emacs file. For example, the |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
81 ;; following line |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
82 ;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
83 ;; (edt-set-scroll-margins "20%" "25%") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
84 ;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
85 ;; sets the top margin to 20% of the window and the bottom margin |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
86 ;; to 25% of the window. To disable this feature, set each |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
87 ;; margin to 0%. You can also invoke edt-set-scroll-margins |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
88 ;; interactively while EDT Emulation is active to change the |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
89 ;; settings for that session. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
90 ;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
91 ;; NOTE: Another way to set the scroll margins is to use the |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
92 ;; Emacs customization feature (not available in Emacs 19) to set |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
93 ;; the following two variables directly: |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
94 ;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
95 ;; edt-top-scroll-margin and edt-bottom-scroll-margin |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
96 ;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
97 ;; Enter the Emacs `customize' command. First select the Editing |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
98 ;; group and then select the Emulations group. Finally, select |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
99 ;; the Edt group and follow the directions. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
100 ;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
101 ;; 2. The SUBS command is now supported and bound to GOLD-Enter by |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
102 ;; default. (This design was copied from tpu-edt.el.) Note, in |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
103 ;; earlier versions of EDT Emulation, GOLD-Enter was assigned to |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
104 ;; the Emacs function `query-replace'. The binding of |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
105 ;; `query-replace' has been moved to GOLD-/. If you prefer to |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
106 ;; restore `query-replace' to GOLD-Enter, then use an EDT user |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
107 ;; customization file, edt-user.el, to do this. See edt-user.doc |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
108 ;; for details. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
109 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
110 ;; 3. EDT Emulation now also works in XEmacs, including the |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
111 ;; highlighting of selected text. |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
793
diff
changeset
|
112 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
113 ;; 4. If you access a workstation using an X Server, observe that |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
114 ;; the initialization file generated by edt-mapper.el will now |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
115 ;; contain the name of the X Server vendor. This is a |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
116 ;; convenience for those who have access to their Unix account |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
117 ;; from more than one type of X Server. Since different X |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
118 ;; Servers typically require different EDT emulation |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
119 ;; initialization files, edt-mapper.el will now generate these |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
120 ;; different initialization files and save them with different |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
121 ;; names. Then, the correct initialization file for the |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
122 ;; particular X server in use is loaded correctly automatically. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
123 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
124 ;; 5. Also, edt-mapper.el is now capable of binding an ASCII key |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
125 ;; sequence, providing the ASCII key sequence prefix is already |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
126 ;; known by Emacs to be a prefix. As a result of providing this |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
127 ;; support, some terminal/keyboard/window system configurations, |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
128 ;; which don't have a complete set of sensible function key |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
129 ;; bindings built into Emacs in `function-key-map', can still be |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
130 ;; configured for use with EDT Emulation. (Note: In a few rare |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
131 ;; circumstances this does not work properly. In particular, it |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
132 ;; does not work if a subset of the leading ASCII characters in a |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
133 ;; key sequence are recognized by Emacs as having an existing |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
134 ;; binding. For example, if the keypad 7 (KP-7) key generates |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
135 ;; the sequence \"<ESC>Ow\" and \"<ESC>O\" is already bound to a |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
136 ;; function, pressing KP-7 when told to do so by edt-mapper.el |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
137 ;; will result in edt-mapper.el incorrectly mapping \"<ESC>O\" to |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
138 ;; KP-7 and \"w\" to KP-8. If something like this happens to |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
139 ;; you, it is probably a bug in the support for your keyboard |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
140 ;; within Emacs OR a bug in the Unix termcap/terminfo support for |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
141 ;; your terminal OR a bug in the terminal emulation software you |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
142 ;; are using.) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
143 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
144 ;; 6. The edt-quit function (bound to GOLD-q by default) has been |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
145 ;; modified to warn the user when file-related buffer |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
146 ;; modifications exist. It now cautions the user that those |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
147 ;; modifications will be lost if the user quits without saving |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
148 ;; those buffers. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
149 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
150 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
151 ;;; History: |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
152 ;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
153 ;; Version 4.0 2000 Added New Features and Fixed a Few Bugs |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
154 ;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
155 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
156 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
157 ;;; Code: |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
158 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
159 ;;; Electric Help functions are used for keypad help displays. A few |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
160 ;;; picture functions are used in rectangular cut and paste commands. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
161 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
162 (require 'ehelp) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
163 (require 'picture) |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
793
diff
changeset
|
164 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
165 ;;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
166 ;;;; VARIABLES and CONSTANTS |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
167 ;;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
168 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
169 ;; For backward compatibility to Emacs 19, skip this if defgroup is |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
170 ;; not defined. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
171 (if (fboundp 'defgroup) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
172 (defgroup edt nil |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
173 "Emacs emulating EDT." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
174 :prefix "edt-" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
175 :group 'emulations)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
176 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
177 ;;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
178 ;;; Version Information |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
179 ;;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
180 (defconst edt-version "4.0" "EDT Emulation version number.") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
181 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
182 ;;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
183 ;;; User Configurable Variables |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
184 ;;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
185 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
186 ;; For backward compatibility to Emacs 19, use defvar if defcustom is |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
187 ;; not defined. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
188 (if (fboundp 'defcustom) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
189 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
190 (defcustom edt-keep-current-page-delimiter nil |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
191 "*Emacs MUST be restarted for a change in value to take effect! |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
192 Non-nil leaves Emacs value of `page-delimiter' unchanged within EDT |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
193 Emulation. If set to nil (the default), the `page-delimiter' variable |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
194 is set to \"\\f\" when edt-emulation-on is first invoked. This |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
195 setting replicates EDT's page delimiter behavior. The original value |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
196 is restored when edt-emulation-off is called." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
197 :type 'boolean |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
198 :group 'edt) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
199 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
200 (defcustom edt-use-EDT-control-key-bindings nil |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
201 "*Emacs MUST be restarted for a change in value to take effect! |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
202 Non-nil causes the control key bindings to be replaced with EDT |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
203 bindings. If set to nil (the default), EDT control key bindings are |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
204 not used and the current Emacs control key bindings are retained for |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
205 use within the EDT emulation." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
206 :type 'boolean |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
207 :group 'edt) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
208 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
209 (defcustom edt-word-entities '(?\t) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
210 "*Specifies the list of EDT word entity characters. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
211 The default list, (\?\\t), contains just the TAB character, which |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
212 emulates EDT. Characters are specified in the list using their |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
213 decimal ASCII values. A question mark, followed by the actual |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
214 character, can be used to indicate the numerical value of the |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
215 character, instead of the actual decimal value. So, ?A means the |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
216 numerical value for the letter A, \?/ means the numerical value for /, |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
217 etc. Several unprintable and special characters have special |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
218 representations, which you can also use: |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
219 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
220 \?\\b specifies BS, C-h |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
221 \?\\t specifies TAB, C-i |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
222 \?\\n specifies LFD, C-j |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
223 \?\\v specifies VTAB, C-k |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
224 \?\\f specifies FF, C-l |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
225 \?\\r specifies CR, C-m |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
226 \?\\e specifies ESC, C-[ |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
227 \?\\\\ specifies \\ |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
228 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
229 In EDT Emulation movement-by-word commands, each character in the list |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
230 will be treated as if it were a separate word." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
231 :type '(repeat integer) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
232 :group 'edt) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
233 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
234 (defcustom edt-top-scroll-margin 10 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
235 "*Scroll margin at the top of the screen. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
236 Interpreted as a percent of the current window size with a default |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
237 setting of 10%. If set to 0, top scroll margin is disabled." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
238 :type 'integer |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
239 :group 'edt) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
240 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
241 (defcustom edt-bottom-scroll-margin 15 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
242 "*Scroll margin at the bottom of the screen. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
243 Interpreted as a percent of the current window size with a default |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
244 setting of 15%. If set to 0, bottom scroll margin is disabled." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
245 :type 'integer |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
246 :group 'edt)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
247 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
248 (defvar edt-keep-current-page-delimiter nil |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
249 "*Non-nil leaves Emacs value of `page-delimiter' unchanged within EDT |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
250 Emulation. If set to nil (the default), the `page-delimiter' variable |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
251 is set to \"\\f\" when edt-emulation-on is first invoked. This |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
252 setting replicates EDT's page delimiter behavior. The original value |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
253 is restored when edt-emulation-off is called.") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
254 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
255 (defvar edt-use-EDT-control-key-bindings nil |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
256 "*Non-nil causes the control key bindings to be replaced with EDT |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
257 bindings. If set to nil (the default), EDT control key bindings are |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
258 not used and the current Emacs control key bindings are retained for |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
259 use within the EDT emulation.") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
260 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
261 (defvar edt-word-entities '(?\t) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
262 "*Specifies the list of EDT word entity characters. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
263 The default list, (\?\\t), contains just the TAB character, which |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
264 emulates EDT. Characters are specified in the list using their |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
265 decimal ASCII values. A question mark, followed by the actual |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
266 character, can be used to indicate the numerical value of the |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
267 character, instead of the actual decimal value. So, ?A means the |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
268 numerical value for the letter A, \?/ means the numerical value for /, |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
269 etc. Several unprintable and special characters have special |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
270 representations, which you can also use: |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
271 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
272 \?\\b specifies BS, C-h |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
273 \?\\t specifies TAB, C-i |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
274 \?\\n specifies LFD, C-j |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
275 \?\\v specifies VTAB, C-k |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
276 \?\\f specifies FF, C-l |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
277 \?\\r specifies CR, C-m |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
278 \?\\e specifies ESC, C-[ |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
279 \?\\\\ specifies \\ |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
280 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
281 In EDT Emulation movement-by-word commands, each character in the list |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
282 will be treated as if it were a separate word.") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
283 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
284 (defvar edt-top-scroll-margin 10 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
285 "*Scroll margin at the top of the screen. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
286 Interpreted as a percent of the current window size with a default |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
287 setting of 10%. If set to 0, top scroll margin is disabled.") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
288 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
289 (defvar edt-bottom-scroll-margin 15 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
290 "*Scroll margin at the bottom of the screen. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
291 Interpreted as a percent of the current window size with a default |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
292 setting of 15%. If set to 0, bottom scroll margin is disabled."))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
293 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
294 ;;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
295 ;;; Internal Variables |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
296 ;;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
297 |
57 | 298 (defvar edt-last-deleted-lines "" |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
299 "Last text deleted by the EDT emulation DEL L command.") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
300 |
57 | 301 (defvar edt-last-deleted-words "" |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
302 "Last text deleted by the EDT emulation DEL W command.") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
303 |
57 | 304 (defvar edt-last-deleted-chars "" |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
305 "Last text deleted by the EDT emulation DEL C command.") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
306 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
307 (defvar edt-find-last-text "" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
308 "Last text found by the EDT emulation FIND command.") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
309 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
310 (defvar edt-match-beginning-mark (make-marker) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
311 "Used internally by the EDT emulation SUBS command.") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
312 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
313 (defvar edt-match-end-mark (make-marker) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
314 "Used internally by the EDT emulation SUBS command.") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
315 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
316 (defvar edt-last-replaced-key-definition nil |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
317 "Key definition replaced with `edt-define-key' or `edt-learn' command.") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
318 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
319 (defvar edt-direction-string "" |
11442 | 320 "String indicating current direction of movement.") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
321 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
322 (defvar edt-select-mode nil |
11442 | 323 "Non-nil means select mode is active.") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
324 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
325 (defvar edt-select-mode-current "" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
326 "Text displayed in mode line to indicate the state of EDT select mode. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
327 When select mode is inactive, it is set to an empty string.") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
328 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
329 (defconst edt-select-mode-string " Select" |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
330 "Used in mode line to indicate select mode is active.") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
331 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
332 (defconst edt-forward-string " ADVANCE" |
11442 | 333 "Direction string in mode line to indicate forward movement.") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
334 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
335 (defconst edt-backward-string " BACKUP" |
11442 | 336 "Direction string in mode line to indicate backward movement.") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
337 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
338 (defvar edt-default-map-active nil |
11442 | 339 "Non-nil indicates that default EDT emulation key bindings are active. |
42206 | 340 nil means user-defined custom bindings are active.") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
341 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
342 (defvar edt-user-map-configured nil |
11442 | 343 "Non-nil indicates that user custom EDT key bindings are configured. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
344 This means that an edt-user.el file was found in the user's `load-path'.") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
345 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
346 (defvar edt-term nil |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
347 "Specifies the terminal type, if applicable.") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
348 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
349 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
350 ;;; Emacs version identifiers - currently referenced by |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
351 ;;; |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
352 ;;; o edt-emulation-on o edt-load-keys |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
353 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
354 (defconst edt-emacs19-p (not (string-lessp emacs-version "19")) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
355 "Non-nil if we are running GNU Emacs or XEmacs version 19, or higher.") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
356 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
357 (defconst edt-x-emacs19-p |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
358 (and edt-emacs19-p (string-match "XEmacs" emacs-version)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
359 "Non-nil if we are running XEmacs version 19, or higher.") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
360 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
361 (defconst edt-gnu-emacs19-p (and edt-emacs19-p (not edt-x-emacs19-p)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
362 "Non-nil if we are running GNU Emacs version 19, or higher.") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
363 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
364 (defconst edt-emacs-variant (if edt-gnu-emacs19-p "gnu" "xemacs") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
365 "Indicates Emacs variant: GNU Emacs or XEmacs \(aka Lucid Emacs\).") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
366 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
367 (defconst edt-window-system (if edt-gnu-emacs19-p window-system (console-type)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
368 "Indicates window system \(in GNU Emacs\) or console type \(in XEmacs\).") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
369 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
370 (defconst edt-xserver (if (eq edt-window-system 'x) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
371 (if edt-x-emacs19-p |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
372 (replace-in-string (x-server-vendor) "[ _]" "-") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
373 (subst-char-in-string ? ?- (x-server-vendor))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
374 nil) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
375 "Indicates X server vendor name, if applicable.") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
376 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
377 (defvar edt-keys-file nil |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
378 "User's custom keypad and function keys mappings to emulate LK-201 keyboard.") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
379 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
380 ;;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
381 ;;;; EDT Emulation Commands |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
382 ;;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
383 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
384 ;;; Almost all of EDT's keypad mode commands have equivalent Emacs |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
385 ;;; function counterparts. But many of these counterparts behave |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
386 ;;; somewhat differently in Emacs. |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
387 ;;; |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
388 ;;; So, the following Emacs functions emulate, where practical, the |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
389 ;;; exact behavior of the corresponding EDT keypad mode commands. In |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
390 ;;; a few cases, the emulation is not exact, but it should be close |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
391 ;;; enough for most EDT die-hards. |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
392 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
393 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
394 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
395 ;;; PAGE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
396 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
397 ;;; Emacs uses the regexp assigned to page-delimiter to determine what |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
398 ;;; marks a page break. This is normally "^\f", which causes the |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
399 ;;; edt-page command to ignore form feeds not located at the beginning |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
400 ;;; of a line. To emulate the EDT PAGE command exactly, |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
401 ;;; page-delimiter is set to "\f" when EDT emulation is turned on, and |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
402 ;;; restored to its original value when EDT emulation is turned off. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
403 ;;; But this can be overridden if the EDT definition is not desired by |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
404 ;;; placing |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
405 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
406 ;;; (setq edt-keep-current-page-delimiter t) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
407 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
408 ;;; in your .emacs file. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
409 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
410 (defun edt-page-forward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
411 "Move forward to just after next page delimiter. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
412 Argument NUM is the number of page delimiters to move." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
413 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
414 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
415 (if (eobp) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
416 (error "End of buffer") |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
417 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
418 (forward-page num) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
419 (if (eobp) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
420 (edt-line-to-bottom-of-window) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
421 (edt-line-to-top-of-window))))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
422 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
423 (defun edt-page-backward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
424 "Move backward to just after previous page delimiter. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
425 Argument NUM is the number of page delimiters to move." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
426 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
427 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
428 (if (bobp) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
429 (error "Beginning of buffer") |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
430 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
431 (backward-page num) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
432 (edt-line-to-top-of-window) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
433 (if edt-x-emacs19-p (setq zmacs-region-stays t))))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
434 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
435 (defun edt-page (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
436 "Move in current direction to next page delimiter. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
437 Argument NUM is the number of page delimiters to move." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
438 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
439 (if (equal edt-direction-string edt-forward-string) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
440 (edt-page-forward num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
441 (edt-page-backward num))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
442 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
443 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
444 ;;; SECT |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
445 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
446 ;;; EDT defaults a section size to be 16 lines of its one and only |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
447 ;;; 24-line window. That's two-thirds of the window at a time. The |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
448 ;;; EDT SECT commands moves the cursor, not the window. |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
449 ;;; |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
450 ;;; This emulation of EDT's SECT moves the cursor approximately |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
451 ;;; two-thirds of the current window at a time. |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
452 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
453 (defun edt-sect-forward (num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
454 "Move cursor forward two-thirds of a window's number of lines. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
455 Argument NUM is the number of sections to move." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
456 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
457 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
458 (edt-line-forward (* (* (/ (- (window-height) 1) 3) 2) num))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
459 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
460 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
461 (defun edt-sect-backward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
462 "Move cursor backward two-thirds of a window. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
463 Argument NUM is the number of sections to move." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
464 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
465 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
466 (edt-line-backward (* (* (/ (- (window-height) 1) 3) 2) num))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
467 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
468 (defun edt-sect (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
469 "Move in current direction a full window. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
470 Argument NUM is the number of sections to move." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
471 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
472 (if (equal edt-direction-string edt-forward-string) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
473 (edt-sect-forward num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
474 (edt-sect-backward num))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
475 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
476 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
477 ;;; BEGINNING OF LINE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
478 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
479 ;;; EDT's beginning-of-line command is not affected by current |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
480 ;;; direction, for some unknown reason. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
481 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
482 (defun edt-beginning-of-line (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
483 "Move backward to next beginning of line mark. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
484 Argument NUM is the number of BOL marks to move." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
485 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
486 (edt-check-prefix num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
487 (let ((beg (edt-current-line))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
488 (if (bolp) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
489 (forward-line (* -1 num)) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
490 (progn |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
491 (setq num (1- num)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
492 (forward-line (* -1 num)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
493 (edt-top-check beg num)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
494 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
495 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
496 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
497 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
498 ;;; EOL (End of Line) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
499 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
500 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
501 (defun edt-end-of-line-forward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
502 "Move forward to next end of line mark. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
503 Argument NUM is the number of EOL marks to move." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
504 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
505 (edt-check-prefix num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
506 (let ((beg (edt-current-line))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
507 (forward-char) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
508 (end-of-line num) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
509 (edt-bottom-check beg num)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
510 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
511 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
512 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
513 (defun edt-end-of-line-backward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
514 "Move backward to next end of line mark. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
515 Argument NUM is the number of EOL marks to move." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
516 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
517 (edt-check-prefix num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
518 (let ((beg (edt-current-line))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
519 (end-of-line (1- num)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
520 (edt-top-check beg num)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
521 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
522 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
523 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
524 (defun edt-end-of-line (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
525 "Move in current direction to next end of line mark. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
526 Argument NUM is the number of EOL marks to move." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
527 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
528 (if (equal edt-direction-string edt-forward-string) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
529 (edt-end-of-line-forward num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
530 (edt-end-of-line-backward num))) |
57 | 531 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
532 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
533 ;;; WORD |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
534 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
535 ;;; This one is a tad messy. To emulate EDT's behavior everywhere in |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
536 ;;; the file (beginning of file, end of file, beginning of line, end |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
537 ;;; of line, etc.) it takes a bit of special handling. |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
538 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
539 ;;; The variable edt-word-entities contains a list of characters which |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
540 ;;; are to be viewed as distinct words where ever they appear in the |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
541 ;;; buffer. This emulates the EDT line mode command SET ENTITY WORD. |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
542 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
543 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
544 (defun edt-one-word-forward () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
545 "Move forward to first character of next word." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
546 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
547 (if (eobp) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
548 (error "End of buffer")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
549 (if (eolp) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
550 (forward-char) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
551 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
552 (if (memq (following-char) edt-word-entities) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
553 (forward-char) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
554 (while (and |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
555 (not (eolp)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
556 (not (eobp)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
557 (not (eq ?\ (char-syntax (following-char)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
558 (not (memq (following-char) edt-word-entities))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
559 (forward-char))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
560 (while (and |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
561 (not (eolp)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
562 (not (eobp)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
563 (eq ?\ (char-syntax (following-char))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
564 (not (memq (following-char) edt-word-entities))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
565 (forward-char)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
566 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
567 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
568 (defun edt-one-word-backward () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
569 "Move backward to first character of previous word." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
570 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
571 (if (bobp) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
572 (error "Beginning of buffer")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
573 (if (bolp) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
574 (backward-char) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
575 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
576 (backward-char) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
577 (while (and |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
578 (not (bolp)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
579 (not (bobp)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
580 (eq ?\ (char-syntax (following-char))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
581 (not (memq (following-char) edt-word-entities))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
582 (backward-char)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
583 (if (not (memq (following-char) edt-word-entities)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
584 (while (and |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
585 (not (bolp)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
586 (not (bobp)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
587 (not (eq ?\ (char-syntax (preceding-char)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
588 (not (memq (preceding-char) edt-word-entities))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
589 (backward-char))))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
590 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
591 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
592 (defun edt-word-forward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
593 "Move forward to first character of next word. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
594 Argument NUM is the number of words to move." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
595 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
596 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
597 (while (> num 0) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
598 (edt-one-word-forward) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
599 (setq num (1- num)))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
600 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
601 (defun edt-word-backward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
602 "Move backward to first character of previous word. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
603 Argument NUM is the number of words to move." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
604 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
605 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
606 (while (> num 0) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
607 (edt-one-word-backward) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
608 (setq num (1- num)))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
609 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
610 (defun edt-word (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
611 "Move in current direction to first character of next word. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
612 Argument NUM is the number of words to move." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
613 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
614 (if (equal edt-direction-string edt-forward-string) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
615 (edt-word-forward num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
616 (edt-word-backward num))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
617 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
618 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
619 ;;; CHAR |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
620 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
621 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
622 (defun edt-character (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
623 "Move in current direction to next character. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
624 Argument NUM is the number of characters to move." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
625 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
626 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
627 (if (equal edt-direction-string edt-forward-string) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
628 (forward-char num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
629 (backward-char num)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
630 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
631 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
632 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
633 ;;; LINE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
634 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
635 ;;; When direction is set to BACKUP, LINE behaves just like BEGINNING |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
636 ;;; OF LINE in EDT. So edt-line-backward is not really needed as a |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
637 ;;; separate function. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
638 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
639 (defun edt-line-backward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
640 "Move backward to next beginning of line mark. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
641 Argument NUM is the number of BOL marks to move." |
57 | 642 (interactive "p") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
643 (edt-beginning-of-line num)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
644 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
645 (defun edt-line-forward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
646 "Move forward to next beginning of line mark. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
647 Argument NUM is the number of BOL marks to move." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
648 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
649 (edt-check-prefix num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
650 (let ((beg (edt-current-line))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
651 (forward-line num) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
652 (edt-bottom-check beg num)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
653 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
654 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
655 (defun edt-line (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
656 "Move in current direction to next beginning of line mark. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
657 Argument NUM is the number of BOL marks to move." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
658 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
659 (if (equal edt-direction-string edt-forward-string) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
660 (edt-line-forward num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
661 (edt-line-backward num))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
662 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
663 ;;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
664 ;;; UP and DOWN Arrows |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
665 ;;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
666 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
667 (defun edt-next-line (num) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
668 "Move cursor down one line. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
669 Argument NUM is the number of lines to move." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
670 (interactive "p") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
671 (edt-check-prefix num) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
672 (let ((beg (edt-current-line))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
673 (next-line num) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
674 (edt-bottom-check beg num)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
675 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
676 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
677 (defun edt-previous-line (num) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
678 "Move cursor up one line. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
679 Argument NUM is the number of lines to move." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
680 (interactive "p") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
681 (edt-check-prefix num) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
682 (let ((beg (edt-current-line))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
683 (previous-line num) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
684 (edt-top-check beg num)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
685 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
686 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
687 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
688 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
689 ;;; TOP |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
690 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
691 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
692 (defun edt-top () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
693 "Move cursor to the beginning of buffer." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
694 (interactive) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
695 (goto-char (point-min)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
696 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
697 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
698 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
699 ;;; BOTTOM |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
700 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
701 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
702 (defun edt-bottom () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
703 "Move cursor to the end of buffer." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
704 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
705 (goto-char (point-max)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
706 (edt-line-to-bottom-of-window)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
707 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
708 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
709 ;;; FIND |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
710 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
711 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
712 (defun edt-find-forward (&optional find) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
713 "Find first occurrence of a string in forward direction and save it. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
714 Optional argument FIND is t is this function is called from `edt-find'." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
715 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
716 (if (not find) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
717 (set 'edt-find-last-text (read-string "Search forward: "))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
718 (let* ((left nil) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
719 (beg (edt-current-line)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
720 (height (window-height)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
721 (top-percent |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
722 (if (= 0 edt-top-scroll-margin) 10 edt-top-scroll-margin)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
723 (bottom-percent |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
724 (if (= 0 edt-bottom-scroll-margin) 15 edt-bottom-scroll-margin)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
725 (top-margin (/ (* height top-percent) 100)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
726 (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
727 (bottom-margin (max beg (- height bottom-up-margin 1))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
728 (top (save-excursion (move-to-window-line top-margin) (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
729 (bottom (save-excursion (move-to-window-line bottom-margin) (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
730 (far (save-excursion |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
731 (goto-char bottom) (forward-line (- height 2)) (point)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
732 (if (search-forward edt-find-last-text) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
733 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
734 (search-backward edt-find-last-text) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
735 (edt-set-match) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
736 (cond((> (point) far) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
737 (setq left (save-excursion (forward-line height))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
738 (if (= 0 left) (recenter top-margin) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
739 (recenter (- left bottom-up-margin)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
740 (t |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
741 (and (> (point) bottom) (recenter bottom-margin))))))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
742 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
743 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
744 (defun edt-find-backward (&optional find) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
745 "Find first occurrence of a string in the backward direction and save it. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
746 Optional argument FIND is t if this function is called from `edt-find'." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
747 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
748 (if (not find) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
749 (set 'edt-find-last-text (read-string "Search backward: "))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
750 (let* ((left nil) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
751 (beg (edt-current-line)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
752 (height (window-height)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
753 (top-percent |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
754 (if (= 0 edt-top-scroll-margin) 10 edt-top-scroll-margin)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
755 (bottom-percent |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
756 (if (= 0 edt-bottom-scroll-margin) 15 edt-bottom-scroll-margin)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
757 (top-margin (/ (* height top-percent) 100)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
758 (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
759 (bottom-margin (max beg (- height bottom-up-margin 1))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
760 (top (save-excursion (move-to-window-line top-margin) (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
761 (bottom (save-excursion (move-to-window-line bottom-margin) (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
762 (far (save-excursion |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
763 (goto-char bottom) (forward-line (- height 2)) (point)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
764 (if (search-backward edt-find-last-text) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
765 (edt-set-match)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
766 (and (< (point) top) (recenter (min beg top-margin)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
767 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
768 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
769 (defun edt-find () |
13978
2445061c92d4
(edt-find-forward, edt-find-backward, edt-find,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
770 "Find first occurrence of string in current direction and save it." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
771 (interactive) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
772 (set 'edt-find-last-text (read-string "Search: ")) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
773 (if (equal edt-direction-string edt-forward-string) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
774 (edt-find-forward t) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
775 (edt-find-backward t))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
776 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
777 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
778 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
779 ;;; FNDNXT |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
780 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
781 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
782 (defun edt-find-next-forward () |
13978
2445061c92d4
(edt-find-forward, edt-find-backward, edt-find,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
783 "Find next occurrence of a string in forward direction." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
784 (interactive) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
785 (let* ((left nil) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
786 (beg (edt-current-line)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
787 (height (window-height)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
788 (top-percent |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
789 (if (= 0 edt-top-scroll-margin) 10 edt-top-scroll-margin)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
790 (bottom-percent |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
791 (if (= 0 edt-bottom-scroll-margin) 15 edt-bottom-scroll-margin)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
792 (top-margin (/ (* height top-percent) 100)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
793 (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
794 (bottom-margin (max beg (- height bottom-up-margin 1))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
795 (top (save-excursion (move-to-window-line top-margin) (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
796 (bottom (save-excursion (move-to-window-line bottom-margin) (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
797 (far (save-excursion |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
798 (goto-char bottom) (forward-line (- height 2)) (point)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
799 (forward-char 1) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
800 (if (search-forward edt-find-last-text nil t) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
801 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
802 (search-backward edt-find-last-text) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
803 (edt-set-match) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
804 (cond((> (point) far) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
805 (setq left (save-excursion (forward-line height))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
806 (if (= 0 left) (recenter top-margin) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
807 (recenter (- left bottom-up-margin)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
808 (t |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
809 (and (> (point) bottom) (recenter bottom-margin))))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
810 (progn |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
811 (backward-char 1) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
812 (error "Search failed: \"%s\"" edt-find-last-text)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
813 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
814 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
815 (defun edt-find-next-backward () |
13978
2445061c92d4
(edt-find-forward, edt-find-backward, edt-find,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
816 "Find next occurrence of a string in backward direction." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
817 (interactive) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
818 (let* ((left nil) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
819 (beg (edt-current-line)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
820 (height (window-height)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
821 (top-percent |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
822 (if (= 0 edt-top-scroll-margin) 10 edt-top-scroll-margin)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
823 (bottom-percent |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
824 (if (= 0 edt-bottom-scroll-margin) 15 edt-bottom-scroll-margin)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
825 (top-margin (/ (* height top-percent) 100)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
826 (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
827 (bottom-margin (max beg (- height bottom-up-margin 1))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
828 (top (save-excursion (move-to-window-line top-margin) (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
829 (bottom (save-excursion (move-to-window-line bottom-margin) (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
830 (far (save-excursion |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
831 (goto-char bottom) (forward-line (- height 2)) (point)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
832 (if (not (search-backward edt-find-last-text nil t)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
833 (error "Search failed: \"%s\"" edt-find-last-text) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
834 (progn |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
835 (edt-set-match) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
836 (and (< (point) top) (recenter (min beg top-margin)))))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
837 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
838 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
839 (defun edt-find-next () |
13978
2445061c92d4
(edt-find-forward, edt-find-backward, edt-find,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
840 "Find next occurrence of a string in current direction." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
841 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
842 (if (equal edt-direction-string edt-forward-string) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
843 (edt-find-next-forward) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
844 (edt-find-next-backward))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
845 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
846 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
847 ;;; APPEND |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
848 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
849 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
850 (defun edt-append () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
851 "Append this kill region to last killed region." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
852 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
853 (edt-check-selection) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
854 (append-next-kill) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
855 (kill-region (mark) (point)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
856 (message "Selected text APPENDED to kill ring")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
857 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
858 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
859 ;;; DEL L |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
860 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
861 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
862 (defun edt-delete-line (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
863 "Delete from cursor up to and including the end of line mark. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
864 Argument NUM is the number of lines to delete." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
865 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
866 (edt-check-prefix num) |
57 | 867 (let ((beg (point))) |
868 (forward-line num) | |
869 (if (not (eq (preceding-char) ?\n)) | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
870 (insert "\n")) |
57 | 871 (setq edt-last-deleted-lines |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
872 (buffer-substring beg (point))) |
57 | 873 (delete-region beg (point)))) |
874 | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
875 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
876 ;;; DEL EOL |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
877 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
878 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
879 (defun edt-delete-to-end-of-line (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
880 "Delete from cursor up to but excluding the end of line mark. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
881 Argument NUM is the number of lines to delete." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
882 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
883 (edt-check-prefix num) |
57 | 884 (let ((beg (point))) |
885 (forward-char 1) | |
886 (end-of-line num) | |
887 (setq edt-last-deleted-lines | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
888 (buffer-substring beg (point))) |
57 | 889 (delete-region beg (point)))) |
890 | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
891 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
892 ;;; SELECT |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
893 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
894 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
895 (defun edt-select-mode (arg) |
11442 | 896 "Turn EDT select mode off if ARG is nil; otherwise, turn EDT select mode on. |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
897 In select mode, selected text is highlighted." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
898 (if arg |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
899 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
900 (make-local-variable 'edt-select-mode) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
901 (setq edt-select-mode 'edt-select-mode-current) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
902 (setq rect-start-point (window-point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
903 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
904 (kill-local-variable 'edt-select-mode))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
905 (force-mode-line-update)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
906 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
907 (defun edt-select () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
908 "Set mark at cursor and start text selection." |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
909 (interactive) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
910 (set-mark-command nil)) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
911 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
912 (defun edt-reset () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
913 "Cancel text selection." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
914 (interactive) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
915 (if edt-gnu-emacs19-p |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
916 (deactivate-mark) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
917 (zmacs-deactivate-region))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
918 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
919 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
920 ;;; CUT |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
921 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
922 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
923 (defun edt-cut () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
924 "Deletes selected text but copies to kill ring." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
925 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
926 (edt-check-selection) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
927 (kill-region (mark) (point)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
928 (message "Selected text CUT to kill ring")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
929 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
930 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
931 ;;; DELETE TO BEGINNING OF LINE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
932 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
933 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
934 (defun edt-delete-to-beginning-of-line (num) |
11442 | 935 "Delete from cursor to beginning of line. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
936 Argument NUM is the number of lines to delete." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
937 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
938 (edt-check-prefix num) |
57 | 939 (let ((beg (point))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
940 (edt-beginning-of-line num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
941 (setq edt-last-deleted-lines |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
942 (buffer-substring (point) beg)) |
57 | 943 (delete-region beg (point)))) |
944 | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
945 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
946 ;;; DEL W |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
947 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
948 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
949 (defun edt-delete-word (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
950 "Delete from cursor up to but excluding first character of next word. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
951 Argument NUM is the number of words to delete." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
952 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
953 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
954 (let ((beg (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
955 (edt-word-forward num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
956 (setq edt-last-deleted-words (buffer-substring beg (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
957 (delete-region beg (point)))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
958 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
959 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
960 ;;; DELETE TO BEGINNING OF WORD |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
961 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
962 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
963 (defun edt-delete-to-beginning-of-word (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
964 "Delete from cursor to beginning of word. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
965 Argument NUM is the number of words to delete." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
966 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
967 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
968 (let ((beg (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
969 (edt-word-backward num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
970 (setq edt-last-deleted-words (buffer-substring (point) beg)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
971 (delete-region beg (point)))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
972 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
973 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
974 ;;; DEL C |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
975 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
976 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
977 (defun edt-delete-character (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
978 "Delete character under cursor. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
979 Argument NUM is the number of characters to delete." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
980 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
981 (edt-check-prefix num) |
57 | 982 (setq edt-last-deleted-chars |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
983 (buffer-substring (point) (min (point-max) (+ (point) num)))) |
57 | 984 (delete-region (point) (min (point-max) (+ (point) num)))) |
985 | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
986 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
987 ;;; DELETE CHAR |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
988 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
989 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
990 (defun edt-delete-previous-character (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
991 "Delete character in front of cursor. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
992 Argument NUM is the number of characters to delete." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
993 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
994 (edt-check-prefix num) |
57 | 995 (setq edt-last-deleted-chars |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
996 (buffer-substring (max (point-min) (- (point) num)) (point))) |
57 | 997 (delete-region (max (point-min) (- (point) num)) (point))) |
998 | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
999 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1000 ;;; UND L |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1001 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1002 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1003 (defun edt-undelete-line () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1004 "Undelete previous deleted line(s)." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1005 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1006 (point-to-register 1) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1007 (insert edt-last-deleted-lines) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1008 (register-to-point 1)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1009 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1010 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1011 ;;; UND W |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1012 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1013 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1014 (defun edt-undelete-word () |
11442 | 1015 "Undelete previous deleted word(s)." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1016 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1017 (point-to-register 1) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1018 (insert edt-last-deleted-words) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1019 (register-to-point 1)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1020 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1021 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1022 ;;; UND C |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1023 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1024 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1025 (defun edt-undelete-character () |
11442 | 1026 "Undelete previous deleted character(s)." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1027 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1028 (point-to-register 1) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1029 (insert edt-last-deleted-chars) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1030 (register-to-point 1)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1031 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1032 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1033 ;;; REPLACE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1034 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1035 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1036 (defun edt-replace () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1037 "Replace marked section with last CUT (killed) text." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1038 (interactive "*") |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1039 (if (edt-check-match) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1040 (replace-match (car kill-ring-yank-pointer)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1041 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1042 (exchange-point-and-mark) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1043 (let ((beg (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1044 (exchange-point-and-mark) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1045 (delete-region beg (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1046 (yank)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1047 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1048 ;;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1049 ;;; SUBS |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1050 ;;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1051 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1052 (defun edt-substitute (num) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1053 "Replace the selected region with the contents of the CUT buffer and. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1054 Repeat the most recent FIND command. (The Emacs kill ring is used as |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1055 the CUT buffer.) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1056 Argument NUM is the repeat count. A positive value indicates the of times |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1057 to repeat the substitution. A negative argument means replace all occurances |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1058 of the search text." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1059 (interactive "p") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1060 (cond ((or edt-select-mode (edt-check-match)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1061 (while (and (not (= num 0)) (or edt-select-mode (edt-check-match))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1062 (edt-replace) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1063 (edt-find-next) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1064 (setq num (1- num)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1065 (t |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1066 (error "No selection active")))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1067 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1068 (defun edt-set-match nil |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1069 "Set markers at match beginning and end." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1070 ;; Add one to beginning mark so it stays with the first character of |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1071 ;; the string even if characters are added just before the string. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1072 (setq edt-match-beginning-mark (copy-marker (1+ (match-beginning 0)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1073 (setq edt-match-end-mark (copy-marker (match-end 0)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1074 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1075 (defun edt-unset-match nil |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1076 "Unset match beginning and end markers." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1077 (set-marker edt-match-beginning-mark nil) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1078 (set-marker edt-match-end-mark nil)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1079 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1080 (defun edt-match-beginning nil |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1081 "Return the location of the last match beginning." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1082 (1- (marker-position edt-match-beginning-mark))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1083 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1084 (defun edt-match-end nil |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1085 "Return the location of the last match end." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1086 (marker-position edt-match-end-mark)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1087 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1088 (defun edt-check-match nil |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1089 "Return t if point is between edt-match markers. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1090 Otherwise sets the edt-match markers to nil and returns nil." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1091 ;; make sure 1- marker is in this buffer |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1092 ;; 2- point is at or after beginning marker |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1093 ;; 3- point is before ending marker, or in the case of |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1094 ;; zero length regions (like bol, or eol) that the |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1095 ;; beginning, end, and point are equal. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1096 (cond ((and |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1097 (equal (marker-buffer edt-match-beginning-mark) (current-buffer)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1098 (>= (point) (1- (marker-position edt-match-beginning-mark))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1099 (or |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1100 (< (point) (marker-position edt-match-end-mark)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1101 (and (= (1- (marker-position edt-match-beginning-mark)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1102 (marker-position edt-match-end-mark)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1103 (= (marker-position edt-match-end-mark) (point))))) t) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1104 (t |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1105 (edt-unset-match) nil))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1106 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1107 (defun edt-show-match-markers nil |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1108 "Show the values of the match markers." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1109 (interactive) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1110 (if (markerp edt-match-beginning-mark) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1111 (let ((beg (marker-position edt-match-beginning-mark))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1112 (message "(%s, %s) in %s -- current %s in %s" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1113 (if beg (1- beg) nil) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1114 (marker-position edt-match-end-mark) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1115 (marker-buffer edt-match-end-mark) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1116 (point) (current-buffer))))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1117 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1118 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1119 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1120 ;;; ADVANCE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1121 ;;; |
57 | 1122 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1123 (defun edt-advance () |
11442 | 1124 "Set movement direction forward. |
1125 Also, execute command specified if in Minibuffer." | |
57 | 1126 (interactive) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1127 (setq edt-direction-string edt-forward-string) |
11586
fba74d054979
(edt-advance, edt-backup): Use force-mode-line-update.
Karl Heuer <kwzh@gnu.org>
parents:
11442
diff
changeset
|
1128 (force-mode-line-update) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1129 (if (string-equal " *Minibuf" |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1130 (substring (buffer-name) 0 (min (length (buffer-name)) 9))) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1131 (exit-minibuffer)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1132 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1133 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1134 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1135 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1136 ;;; BACKUP |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1137 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1138 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1139 (defun edt-backup () |
11442 | 1140 "Set movement direction backward. |
1141 Also, execute command specified if in Minibuffer." | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1142 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1143 (setq edt-direction-string edt-backward-string) |
11586
fba74d054979
(edt-advance, edt-backup): Use force-mode-line-update.
Karl Heuer <kwzh@gnu.org>
parents:
11442
diff
changeset
|
1144 (force-mode-line-update) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1145 (if (string-equal " *Minibuf" |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1146 (substring (buffer-name) 0 (min (length (buffer-name)) 9))) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1147 (exit-minibuffer)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1148 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1149 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1150 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1151 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1152 ;;; CHNGCASE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1153 ;;; |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1154 ;; This function is based upon Jeff Kowalski's case-flip function in his |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1155 ;; tpu.el. |
57 | 1156 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1157 (defun edt-change-case (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1158 "Change the case of specified characters. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1159 If text selection IS active, then characters between the cursor and mark are |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1160 changed. If text selection is NOT active, there are two cases. First, if the |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1161 current direction is ADVANCE, then the prefix number of character(s) under and |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1162 following cursor are changed. Second, if the current direction is BACKUP, then |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1163 the prefix number of character(s) before the cursor are changed. Accepts a |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1164 positive prefix for the number of characters to change, but the prefix is |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1165 ignored if text selection is active. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1166 Argument NUM is the numbers of consecutive characters to change." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1167 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1168 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1169 (if edt-select-mode |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1170 (let ((end (max (mark) (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1171 (point-save (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1172 (goto-char (min (point) (mark))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1173 (while (not (eq (point) end)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1174 (funcall (if (<= ?a (following-char)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1175 'upcase-region 'downcase-region) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1176 (point) (1+ (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1177 (forward-char 1)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1178 (goto-char point-save)) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1179 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1180 (if (string= edt-direction-string edt-backward-string) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1181 (backward-char num)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1182 (while (> num 0) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1183 (funcall (if (<= ?a (following-char)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1184 'upcase-region 'downcase-region) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1185 (point) (1+ (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1186 (forward-char 1) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1187 (setq num (1- num)))))) |
57 | 1188 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1189 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1190 ;;; DEFINE KEY |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1191 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1192 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1193 (defun edt-define-key () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1194 "Assign an interactively-callable function to a specified key sequence. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1195 The current key definition is saved in `edt-last-replaced-key-definition'. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1196 Use `edt-restore-key' to restore last replaced key definition." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1197 (interactive) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1198 (if edt-x-emacs19-p (setq zmacs-region-stays t)) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1199 (let (edt-function |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1200 edt-key-definition) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1201 (setq edt-key-definition |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1202 (read-key-sequence "Press the key to be defined: ")) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1203 (if (if edt-gnu-emacs19-p |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1204 (string-equal "\C-m" edt-key-definition) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1205 (string-equal "\C-m" (events-to-keys edt-key-definition))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1206 (message "Key not defined") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1207 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1208 (setq edt-function (read-command "Enter command name: ")) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1209 (if (string-equal "" edt-function) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1210 (message "Key not defined") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1211 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1212 (setq edt-last-replaced-key-definition |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1213 (lookup-key (current-global-map) edt-key-definition)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1214 (define-key (current-global-map) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1215 edt-key-definition edt-function))))))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1216 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1217 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1218 ;;; FORM FEED INSERT |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1219 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1220 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1221 (defun edt-form-feed-insert (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1222 "Insert form feed character at cursor position. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1223 Argument NUM is the number of form feeds to insert." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1224 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1225 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1226 (while (> num 0) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1227 (insert ?\f) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1228 (setq num (1- num)))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1229 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1230 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1231 ;;; TAB INSERT |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1232 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1233 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1234 (defun edt-tab-insert (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1235 "Insert tab character at cursor position. |
42686 | 1236 Argument NUM is the number of tabs to insert." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1237 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1238 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1239 (while (> num 0) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1240 (insert ?\t) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1241 (setq num (1- num)))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1242 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1243 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1244 ;;; Check Prefix |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1245 ;;; |
57 | 1246 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1247 (defun edt-check-prefix (num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1248 "Indicate error if prefix is not positive. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1249 Argument NUM is the prefix value tested." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1250 (if (<= num 0) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1251 (error "Prefix must be positive"))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1252 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1253 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1254 ;;; Check Selection |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1255 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1256 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1257 (defun edt-check-selection () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1258 "Indicate error if EDT selection is not active." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1259 (if (not edt-select-mode) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1260 (error "Selection NOT active"))) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1261 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1262 ;;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1263 ;;; Scroll Margins |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1264 ;;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1265 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1266 (defun edt-top-check (beg lines) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1267 "Enforce scroll margin at the top of screen. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1268 Argument BEG is the starting line number before cursor was moved. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1269 Argument LINES is the number of lines the cursor moved toward the top." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1270 (let ((margin (/ (* (window-height) edt-top-scroll-margin) 100))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1271 (cond ((< beg margin) (recenter beg)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1272 ((< (- beg lines) margin) (recenter margin))))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1273 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1274 (defun edt-bottom-check (beg lines) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1275 "Enforce scroll margin at the bottom of screen. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1276 Argument BEG is the starting line number before cursor was moved. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1277 Argument LINES is the number of lines the cursor moved toward the bottom." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1278 (let* ((height (window-height)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1279 (margin (+ 1 (/ (* height edt-bottom-scroll-margin) 100))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1280 ;; subtract 1 from height because it includes mode line |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1281 (difference (- height margin 1))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1282 (cond ((> beg difference) (recenter beg)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1283 ((and edt-x-emacs19-p (> (+ beg lines 1) difference)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1284 (recenter (- margin))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1285 ((> (+ beg lines) difference) (recenter (- margin)))))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1286 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1287 (defun edt-current-line nil |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1288 "Return the vertical position of point in the selected window. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1289 Top line is 0. Counts each text line only once, even if it wraps." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1290 (+ (count-lines (window-start) (point)) (if (= (current-column) 0) 1 0) -1)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1291 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1292 ;;;###autoload |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1293 (defun edt-set-scroll-margins (top bottom) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1294 "Set scroll margins. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1295 Argument TOP is the top margin in number of lines or percent of window. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1296 Argument BOTTOM is the bottom margin in number of lines or percent of window." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1297 (interactive |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1298 "sEnter top scroll margin (N lines or N%% or RETURN for current value): \ |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1299 \nsEnter bottom scroll margin (N lines or N%% or RETURN for current value): ") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1300 ;; set top scroll margin |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1301 (or (string= top "") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1302 (if (string= "%" (substring top -1)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1303 (setq edt-top-scroll-margin (string-to-int top)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1304 (setq edt-top-scroll-margin |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1305 (/ (1- (+ (* (string-to-int top) 100) (window-height))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1306 (window-height))))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1307 ;; set bottom scroll margin |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1308 (or (string= bottom "") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1309 (if (string= "%" (substring bottom -1)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1310 (setq edt-bottom-scroll-margin (string-to-int bottom)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1311 (setq edt-bottom-scroll-margin |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1312 (/ (1- (+ (* (string-to-int bottom) 100) (window-height))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1313 (window-height))))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1314 ;; report scroll margin settings if running interactively |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1315 (and (interactive-p) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1316 (message "Scroll margins set. Top = %s%%, Bottom = %s%%" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1317 edt-top-scroll-margin edt-bottom-scroll-margin))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1318 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1319 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1320 ;;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1321 ;;;; ENHANCEMENTS AND ADDITIONS FOR EDT KEYPAD MODE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1322 ;;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1323 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1324 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1325 ;;; Several enhancements and additions to EDT keypad mode commands are |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1326 ;;; provided here. Some of these have been motivated by similar |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1327 ;;; TPU/EVE and EVE-Plus commands. Others are new. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1328 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1329 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1330 ;;; CHANGE DIRECTION |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1331 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1332 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1333 (defun edt-change-direction () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1334 "Toggle movement direction." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1335 (interactive) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1336 (if (equal edt-direction-string edt-forward-string) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1337 (edt-backup) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1338 (edt-advance))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1339 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1340 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1341 ;;; TOGGLE SELECT |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1342 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1343 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1344 (defun edt-toggle-select () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1345 "Toggle to start (or cancel) text selection." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1346 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1347 (if edt-select-mode |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1348 (edt-reset) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1349 (edt-select))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1350 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1351 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1352 ;;; SENTENCE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1353 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1354 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1355 (defun edt-sentence-forward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1356 "Move forward to start of next sentence. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1357 Argument NUM is the positive number of sentences to move." |
57 | 1358 (interactive "p") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1359 (edt-check-prefix num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1360 (let* ((left nil) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1361 (beg (edt-current-line)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1362 (height (window-height)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1363 (top-percent |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1364 (if (= 0 edt-top-scroll-margin) 10 edt-top-scroll-margin)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1365 (bottom-percent |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1366 (if (= 0 edt-bottom-scroll-margin) 15 edt-bottom-scroll-margin)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1367 (top-margin (/ (* height top-percent) 100)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1368 (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1369 (bottom-margin (max beg (- height bottom-up-margin 1))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1370 (top (save-excursion (move-to-window-line top-margin) (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1371 (bottom (save-excursion (move-to-window-line bottom-margin) (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1372 (far (save-excursion |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1373 (goto-char bottom) (forward-line (- height 2)) (point)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1374 (if (eobp) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1375 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1376 (error "End of buffer")) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1377 (progn |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1378 (forward-sentence num) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1379 (forward-word 1) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1380 (backward-sentence))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1381 (cond((> (point) far) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1382 (setq left (save-excursion (forward-line height))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1383 (if (= 0 left) (recenter top-margin) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1384 (recenter (- left bottom-up-margin)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1385 (t |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1386 (and (> (point) bottom) (recenter bottom-margin))))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1387 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
57 | 1388 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1389 (defun edt-sentence-backward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1390 "Move backward to next sentence beginning. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1391 Argument NUM is the positive number of sentences to move." |
57 | 1392 (interactive "p") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1393 (edt-check-prefix num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1394 (let* ((left nil) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1395 (beg (edt-current-line)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1396 (height (window-height)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1397 (top-percent |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1398 (if (= 0 edt-top-scroll-margin) 10 edt-top-scroll-margin)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1399 (bottom-percent |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1400 (if (= 0 edt-bottom-scroll-margin) 15 edt-bottom-scroll-margin)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1401 (top-margin (/ (* height top-percent) 100)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1402 (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1403 (bottom-margin (max beg (- height bottom-up-margin 1))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1404 (top (save-excursion (move-to-window-line top-margin) (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1405 (bottom (save-excursion (move-to-window-line bottom-margin) (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1406 (far (save-excursion |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1407 (goto-char bottom) (forward-line (- height 2)) (point)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1408 (if (eobp) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1409 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1410 (error "End of buffer")) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1411 (backward-sentence num)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1412 (and (< (point) top) (recenter (min beg top-margin)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1413 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
57 | 1414 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1415 (defun edt-sentence (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1416 "Move in current direction to next sentence. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1417 Argument NUM is the positive number of sentences to move." |
57 | 1418 (interactive "p") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1419 (if (equal edt-direction-string edt-forward-string) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1420 (edt-sentence-forward num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1421 (edt-sentence-backward num))) |
57 | 1422 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1423 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1424 ;;; PARAGRAPH |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1425 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1426 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1427 (defun edt-paragraph-forward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1428 "Move forward to beginning of paragraph. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1429 Argument NUM is the positive number of paragraphs to move." |
57 | 1430 (interactive "p") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1431 (edt-check-prefix num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1432 (let* ((left nil) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1433 (beg (edt-current-line)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1434 (height (window-height)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1435 (top-percent |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1436 (if (= 0 edt-top-scroll-margin) 10 edt-top-scroll-margin)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1437 (bottom-percent |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1438 (if (= 0 edt-bottom-scroll-margin) 15 edt-bottom-scroll-margin)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1439 (top-margin (/ (* height top-percent) 100)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1440 (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1441 (bottom-margin (max beg (- height bottom-up-margin 1))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1442 (top (save-excursion (move-to-window-line top-margin) (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1443 (bottom (save-excursion (move-to-window-line bottom-margin) (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1444 (far (save-excursion |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1445 (goto-char bottom) (forward-line (- height 2)) (point)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1446 (while (> num 0) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1447 (forward-paragraph (+ num 1)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1448 (start-of-paragraph-text) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1449 (if (eolp) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1450 (next-line 1)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1451 (setq num (1- num))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1452 (cond((> (point) far) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1453 (setq left (save-excursion (forward-line height))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1454 (if (= 0 left) (recenter top-margin) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1455 (recenter (- left bottom-up-margin)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1456 (t |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1457 (and (> (point) bottom) (recenter bottom-margin))))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1458 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
57 | 1459 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1460 (defun edt-paragraph-backward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1461 "Move backward to beginning of paragraph. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1462 Argument NUM is the positive number of paragraphs to move." |
57 | 1463 (interactive "p") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1464 (edt-check-prefix num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1465 (let* ((left nil) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1466 (beg (edt-current-line)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1467 (height (window-height)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1468 (top-percent |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1469 (if (= 0 edt-top-scroll-margin) 10 edt-top-scroll-margin)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1470 (bottom-percent |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1471 (if (= 0 edt-bottom-scroll-margin) 15 edt-bottom-scroll-margin)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1472 (top-margin (/ (* height top-percent) 100)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1473 (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1474 (bottom-margin (max beg (- height bottom-up-margin 1))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1475 (top (save-excursion (move-to-window-line top-margin) (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1476 (bottom (save-excursion (move-to-window-line bottom-margin) (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1477 (far (save-excursion |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1478 (goto-char bottom) (forward-line (- height 2)) (point)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1479 (while (> num 0) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1480 (start-of-paragraph-text) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1481 (setq num (1- num))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1482 (and (< (point) top) (recenter (min beg top-margin)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1483 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
57 | 1484 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1485 (defun edt-paragraph (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1486 "Move in current direction to next paragraph. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1487 Argument NUM is the positive number of paragraphs to move." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1488 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1489 (if (equal edt-direction-string edt-forward-string) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1490 (edt-paragraph-forward num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1491 (edt-paragraph-backward num))) |
57 | 1492 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1493 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1494 ;;; RESTORE KEY |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1495 ;;; |
57 | 1496 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1497 (defun edt-restore-key () |
11442 | 1498 "Restore last replaced key definition. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1499 Definition is stored in `edt-last-replaced-key-definition'." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1500 (interactive) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1501 (if edt-x-emacs19-p (setq zmacs-region-stays t)) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1502 (if edt-last-replaced-key-definition |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1503 (progn |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1504 (let (edt-key-definition) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1505 (set 'edt-key-definition |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1506 (read-key-sequence "Press the key to be restored: ")) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1507 (if (if edt-gnu-emacs19-p |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1508 (string-equal "\C-m" edt-key-definition) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1509 (string-equal "\C-m" (events-to-keys edt-key-definition))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1510 (message "Key not restored") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1511 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1512 (define-key (current-global-map) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1513 edt-key-definition edt-last-replaced-key-definition) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1514 (if edt-gnu-emacs19-p |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1515 (message "Key definition for %s has been restored." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1516 edt-key-definition) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1517 (message "Key definition for %s has been restored." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1518 (events-to-keys edt-key-definition))))))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1519 (error "No replaced key definition to restore!"))) |
57 | 1520 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1521 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1522 ;;; WINDOW TOP |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1523 ;;; |
57 | 1524 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1525 (defun edt-window-top () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1526 "Move the cursor to the top of the window." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1527 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1528 (let ((start-column (current-column))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1529 (move-to-window-line 0) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1530 (move-to-column start-column)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1531 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1532 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1533 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1534 ;;; WINDOW BOTTOM |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1535 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1536 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1537 (defun edt-window-bottom () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1538 "Move the cursor to the bottom of the window." |
57 | 1539 (interactive) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1540 (let ((start-column (current-column))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1541 (move-to-window-line (- (window-height) 2)) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1542 (move-to-column start-column)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1543 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1544 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1545 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1546 ;;; SCROLL WINDOW LINE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1547 ;;; |
57 | 1548 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1549 (defun edt-scroll-window-forward-line () |
11442 | 1550 "Move window forward one line leaving cursor at position in window." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1551 (interactive) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1552 (scroll-up 1) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1553 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1554 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1555 (defun edt-scroll-window-backward-line () |
11442 | 1556 "Move window backward one line leaving cursor at position in window." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1557 (interactive) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1558 (scroll-down 1) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1559 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1560 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1561 (defun edt-scroll-line () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1562 "Move window one line in current direction." |
57 | 1563 (interactive) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1564 (if (equal edt-direction-string edt-forward-string) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1565 (edt-scroll-window-forward-line) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1566 (edt-scroll-window-backward-line))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1567 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1568 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1569 ;;; SCROLL WINDOW |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1570 ;;; |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1571 ;;; Scroll a window (less one line) at a time. Leave cursor in center of |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1572 ;;; window. |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1573 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1574 (defun edt-scroll-window-forward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1575 "Scroll forward one window in buffer, less one line. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1576 Argument NUM is the positive number of windows to move." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1577 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1578 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1579 (scroll-up (- (* (window-height) num) 2)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1580 (edt-line-forward (/ (- (window-height) 1) 2))) |
57 | 1581 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1582 (defun edt-scroll-window-backward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1583 "Scroll backward one window in buffer, less one line. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1584 Argument NUM is the positive number of windows to move." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1585 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1586 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1587 (scroll-down (- (* (window-height) num) 2)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1588 (edt-line-backward (/ (- (window-height) 1) 2))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1589 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1590 (defun edt-scroll-window (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1591 "Scroll one window in buffer, less one line, in current direction. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1592 Argument NUM is the positive number of windows to move." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1593 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1594 (if (equal edt-direction-string edt-forward-string) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1595 (edt-scroll-window-forward num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1596 (edt-scroll-window-backward num))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1597 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1598 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1599 ;;; LINE TO BOTTOM OF WINDOW |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1600 ;;; |
57 | 1601 |
1602 (defun edt-line-to-bottom-of-window () | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1603 "Move the current line to the bottom of the window." |
57 | 1604 (interactive) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1605 (recenter -1) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1606 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
57 | 1607 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1608 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1609 ;;; LINE TO TOP OF WINDOW |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1610 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1611 |
57 | 1612 (defun edt-line-to-top-of-window () |
1613 "Move the current line to the top of the window." | |
1614 (interactive) | |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1615 (recenter 0) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1616 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
57 | 1617 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1618 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1619 ;;; LINE TO MIDDLE OF WINDOW |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1620 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1621 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1622 (defun edt-line-to-middle-of-window () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1623 "Move window so line with cursor is in the middle of the window." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1624 (interactive) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1625 (recenter '(4)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1626 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1627 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1628 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1629 ;;; GOTO PERCENTAGE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1630 ;;; |
57 | 1631 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1632 (defun edt-goto-percentage (num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1633 "Move to specified percentage in buffer from top of buffer. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1634 Argument NUM is the percentage into the buffer to move." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1635 (interactive "NGoto-percentage: ") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1636 (if (or (> num 100) (< num 0)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1637 (error "Percentage %d out of range 0 < percent < 100" num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1638 (goto-char (/ (* (point-max) num) 100))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1639 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1640 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1641 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1642 ;;; FILL REGION |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1643 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1644 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1645 (defun edt-fill-region () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1646 "Fill selected text." |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1647 (interactive "*") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1648 (edt-check-selection) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1649 (fill-region (point) (mark))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1650 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1651 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1652 ;;; INDENT OR FILL REGION |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1653 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1654 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1655 (defun edt-indent-or-fill-region () |
57 | 1656 "Fill region in text modes, indent region in programming language modes." |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1657 (interactive "*") |
10872
adc2429d1531
(edt-indent-or-fill-region): Remove ^ from paragraph-start & paragraph-separate.
Boris Goldowsky <boris@gnu.org>
parents:
10689
diff
changeset
|
1658 (if (string= paragraph-start "$\\|\f") |
57 | 1659 (indent-region (point) (mark) nil) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1660 (fill-region (point) (mark)))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1661 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1662 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1663 ;;; MARK SECTION WISELY |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1664 ;;; |
57 | 1665 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1666 (defun edt-mark-section-wisely () |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1667 "Mark the section in a manner consistent with the `major-mode'. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1668 Uses `mark-defun' for emacs-lisp and Lisp, |
57 | 1669 mark-c-function for C, |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1670 mark-fortran-subsystem for fortran, |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1671 and `mark-paragraph' for other modes." |
57 | 1672 (interactive) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1673 (if edt-select-mode |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1674 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1675 (edt-reset)) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1676 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1677 (cond ((or (eq major-mode 'emacs-lisp-mode) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1678 (eq major-mode 'lisp-mode)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1679 (mark-defun) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1680 (message "Lisp defun selected")) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1681 ((eq major-mode 'c-mode) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1682 (mark-c-function) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1683 (message "C function selected")) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1684 ((eq major-mode 'fortran-mode) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1685 (mark-fortran-subprogram) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1686 (message "Fortran subprogram selected")) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1687 (t (mark-paragraph) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1688 (message "Paragraph selected")))))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1689 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1690 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1691 ;;; COPY |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1692 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1693 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1694 (defun edt-copy () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1695 "Copy selected region to kill ring, but don't delete it!" |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1696 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1697 (edt-check-selection) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1698 (copy-region-as-kill (mark) (point)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1699 (edt-reset) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1700 (message "Selected text COPIED to kill ring")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1701 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1702 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1703 ;;; CUT or COPY |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1704 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1705 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1706 (defun edt-cut-or-copy () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1707 "Cuts (or copies) selected text to kill ring. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1708 Cuts selected text if `buffer-read-only' is nil. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1709 Copies selected text if `buffer-read-only' is t." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1710 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1711 (if buffer-read-only |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1712 (edt-copy) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1713 (edt-cut))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1714 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1715 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1716 ;;; DELETE ENTIRE LINE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1717 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1718 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1719 (defun edt-delete-entire-line () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1720 "Delete entire line regardless of cursor position in the line." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1721 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1722 (beginning-of-line) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1723 (edt-delete-line 1)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1724 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1725 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1726 ;;; DUPLICATE LINE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1727 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1728 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1729 (defun edt-duplicate-line (num) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1730 "Duplicate the line of text containing the cursor. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1731 Argument NUM is the number of times to duplicate the line." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1732 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1733 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1734 (let ((old-column (current-column)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1735 (count num)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1736 (edt-delete-entire-line) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1737 (edt-undelete-line) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1738 (while (> count 0) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1739 (edt-undelete-line) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1740 (setq count (1- count))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1741 (edt-line-forward num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1742 (move-to-column old-column))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1743 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1744 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1745 ;;; DUPLICATE WORD |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1746 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1747 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1748 (defun edt-duplicate-word() |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1749 "Duplicate word (or rest of word) found directly above cursor, if any." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1750 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1751 (let ((start (point)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1752 (start-column (current-column))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1753 (forward-line -1) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1754 (move-to-column start-column) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1755 (if (and (not (equal start (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1756 (not (eolp))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1757 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1758 (if (and (equal ?\t (preceding-char)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1759 (< start-column (current-column))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1760 (backward-char)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1761 (let ((beg (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1762 (edt-one-word-forward) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1763 (setq edt-last-copied-word (buffer-substring beg (point)))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1764 (forward-line) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1765 (move-to-column start-column) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1766 (insert edt-last-copied-word)) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1767 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1768 (if (not (equal start (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1769 (forward-line)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1770 (move-to-column start-column) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1771 (error "Nothing to duplicate!"))))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1772 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1773 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1774 ;;; KEY NOT ASSIGNED |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1775 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1776 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1777 (defun edt-key-not-assigned () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1778 "Displays message that key has not been assigned to a function." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1779 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1780 (error "Key not assigned")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1781 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1782 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1783 ;;; TOGGLE CAPITALIZATION OF WORD |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1784 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1785 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1786 (defun edt-toggle-capitalization-of-word () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1787 "Toggle the capitalization of the current word and move forward to next." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1788 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1789 (edt-one-word-forward) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1790 (edt-one-word-backward) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1791 (edt-change-case 1) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1792 (edt-one-word-backward) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1793 (edt-one-word-forward)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1794 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1795 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1796 ;;; ELIMINATE ALL TABS |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1797 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1798 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1799 (defun edt-eliminate-all-tabs () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1800 "Convert all tabs to spaces in the entire buffer." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1801 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1802 (untabify (point-min) (point-max)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1803 (message "TABS converted to SPACES")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1804 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1805 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1806 ;;; DISPLAY THE TIME |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1807 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1808 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1809 (defun edt-display-the-time () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1810 "Display the current time." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1811 (interactive) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1812 (if edt-x-emacs19-p (setq zmacs-region-stays t)) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1813 (set 'time-string (current-time-string)) |
14346
4a609420dfc1
(edt-display-the-time): Pass proper format string to message.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
1814 (message "%s" time-string)) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1815 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1816 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1817 ;;; LEARN |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1818 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1819 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1820 (defun edt-learn () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1821 "Learn a sequence of key strokes to bind to a key." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1822 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1823 (if (eq defining-kbd-macro t) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1824 (edt-remember) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1825 (start-kbd-macro nil))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1826 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1827 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1828 ;;; REMEMBER |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1829 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1830 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1831 (defun edt-remember () |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1832 "Store the sequence of key strokes started by `edt-learn' to a key." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1833 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1834 (if (eq defining-kbd-macro nil) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1835 (error "Nothing to remember!") |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1836 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1837 (end-kbd-macro nil) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1838 (let (edt-key-definition) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1839 (set 'edt-key-definition |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1840 (read-key-sequence "Enter key for binding: ")) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1841 (if (if edt-gnu-emacs19-p |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1842 (string-equal "\C-m" edt-key-definition) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1843 (string-equal "\C-m" (events-to-keys edt-key-definition))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1844 (message "Key sequence not remembered") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1845 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1846 (set 'edt-learn-macro-count (+ edt-learn-macro-count 1)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1847 (setq edt-last-replaced-key-definition |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1848 (lookup-key (current-global-map) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1849 edt-key-definition)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1850 (define-key (current-global-map) edt-key-definition |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1851 (name-last-kbd-macro |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1852 (intern (concat "last-learned-sequence-" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1853 (int-to-string edt-learn-macro-count))))))))))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1854 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1855 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1856 ;;; EXIT |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1857 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1858 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1859 (defun edt-exit () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1860 "Save current buffer, ask to save other buffers, and then exit Emacs." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1861 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1862 (save-buffer) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1863 (save-buffers-kill-emacs)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1864 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1865 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1866 ;;; QUIT |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1867 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1868 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1869 (defun edt-quit () |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1870 "Quit Emacs without saving buffer modifications. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1871 Warn user that modifications will be lost." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1872 (interactive) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1873 (let ((list (buffer-list)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1874 (working t)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1875 (while (and list working) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1876 (let ((buffer (car list))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1877 (if (and (buffer-file-name buffer) (buffer-modified-p buffer)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1878 (if (edt-y-or-n-p |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1879 "Modifications will not be saved, continue quitting? ") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1880 (kill-emacs) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1881 (setq working nil))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1882 (setq list (cdr list)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1883 (if working (kill-emacs)))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1884 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1885 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1886 ;;; SPLIT WINDOW |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1887 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1888 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1889 (defun edt-split-window () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1890 "Split current window and place cursor in the new window." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1891 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1892 (split-window) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1893 (other-window 1) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1894 (if edt-x-emacs19-p (setq zmacs-region-stays t))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1895 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1896 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1897 ;;; COPY RECTANGLE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1898 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1899 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1900 (defun edt-copy-rectangle () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1901 "Copy a rectangle of text between mark and cursor to register." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1902 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1903 (edt-check-selection) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1904 (copy-rectangle-to-register 3 (region-beginning) (region-end) nil) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1905 (edt-reset) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1906 (message "Selected rectangle COPIED to register")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1907 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1908 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1909 ;;; CUT RECTANGLE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1910 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1911 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1912 (defun edt-cut-rectangle-overstrike-mode () |
11442 | 1913 "Cut a rectangle of text between mark and cursor to register. |
1914 Replace cut characters with spaces and moving cursor back to | |
1915 upper left corner." | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1916 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1917 (edt-check-selection) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1918 (setq edt-rect-start-point (region-beginning)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1919 (picture-clear-rectangle-to-register (region-beginning) (region-end) 3) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1920 (set-window-point (get-buffer-window (window-buffer)) edt-rect-start-point) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1921 (message "Selected rectangle CUT to register")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1922 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1923 (defun edt-cut-rectangle-insert-mode () |
11442 | 1924 "Cut a rectangle of text between mark and cursor to register. |
1925 Move cursor back to upper left corner." | |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1926 (interactive "*") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1927 (edt-check-selection) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1928 (setq edt-rect-start-point (region-beginning)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1929 (picture-clear-rectangle-to-register (region-beginning) (region-end) 3 t) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1930 (fixup-whitespace) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1931 (set-window-point (get-buffer-window (window-buffer)) edt-rect-start-point) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1932 (message "Selected rectangle CUT to register")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1933 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1934 (defun edt-cut-rectangle () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1935 "Cut a rectangular region of text to register. |
11442 | 1936 If overwrite mode is active, cut text is replaced with whitespace." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1937 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1938 (if overwrite-mode |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1939 (edt-cut-rectangle-overstrike-mode) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1940 (edt-cut-rectangle-insert-mode))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1941 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1942 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1943 ;;; PASTE RECTANGLE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1944 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1945 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1946 (defun edt-paste-rectangle-overstrike-mode () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1947 "Paste a rectangular region of text from register, replacing text at cursor." |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1948 (interactive "*") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1949 (picture-yank-rectangle-from-register 3)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1950 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1951 (defun edt-paste-rectangle-insert-mode () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1952 "Paste previously deleted rectangular region, inserting text at cursor." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1953 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1954 (picture-yank-rectangle-from-register 3 t)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1955 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1956 (defun edt-paste-rectangle () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1957 "Paste a rectangular region of text. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1958 If overwrite mode is active, existing text is replace with text from register." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1959 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1960 (if overwrite-mode |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1961 (edt-paste-rectangle-overstrike-mode) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1962 (edt-paste-rectangle-insert-mode))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1963 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1964 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1965 ;;; DOWNCASE REGION |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1966 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1967 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1968 (defun edt-lowercase () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1969 "Change specified characters to lower case. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1970 If text selection IS active, then characters between the cursor and |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1971 mark are changed. If text selection is NOT active, there are two |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1972 situations. If the current direction is ADVANCE, then the word under |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1973 the cursor is changed to lower case and the cursor is moved to rest at |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1974 the beginning of the next word. If the current direction is BACKUP, |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1975 the word prior to the word under the cursor is changed to lower case |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1976 and the cursor is left to rest at the beginning of that word." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1977 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1978 (if edt-select-mode |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1979 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1980 (downcase-region (mark) (point))) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1981 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1982 ;; Move to beginning of current word. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1983 (if (and |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1984 (not (bobp)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1985 (not (eobp)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1986 (not (bolp)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1987 (not (eolp)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1988 (not (eq ?\ (char-syntax (preceding-char)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1989 (not (memq (preceding-char) edt-word-entities)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1990 (not (memq (following-char) edt-word-entities))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1991 (edt-one-word-backward)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1992 (if (equal edt-direction-string edt-backward-string) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1993 (edt-one-word-backward)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1994 (let ((beg (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1995 (edt-one-word-forward) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1996 (downcase-region beg (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1997 (if (equal edt-direction-string edt-backward-string) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
1998 (edt-one-word-backward))))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1999 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2000 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2001 ;;; UPCASE REGION |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2002 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2003 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2004 (defun edt-uppercase () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2005 "Change specified characters to upper case. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2006 If text selection IS active, then characters between the cursor and |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2007 mark are changed. If text selection is NOT active, there are two |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2008 situations. If the current direction is ADVANCE, then the word under |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2009 the cursor is changed to upper case and the cursor is moved to rest at |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2010 the beginning of the next word. If the current direction is BACKUP, |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2011 the word prior to the word under the cursor is changed to upper case |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2012 and the cursor is left to rest at the beginning of that word." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2013 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2014 (if edt-select-mode |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2015 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2016 (upcase-region (mark) (point))) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2017 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2018 ;; Move to beginning of current word. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2019 (if (and |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2020 (not (bobp)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2021 (not (eobp)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2022 (not (bolp)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2023 (not (eolp)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2024 (not (eq ?\ (char-syntax (preceding-char)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2025 (not (memq (preceding-char) edt-word-entities)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2026 (not (memq (following-char) edt-word-entities))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2027 (edt-one-word-backward)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2028 (if (equal edt-direction-string edt-backward-string) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2029 (edt-one-word-backward)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2030 (let ((beg (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2031 (edt-one-word-forward) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2032 (upcase-region beg (point))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2033 (if (equal edt-direction-string edt-backward-string) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2034 (edt-one-word-backward))))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2035 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2036 ;;; |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2037 ;;; Functions used in loading LK-201 key mapping file. |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2038 ;;; |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2039 (defvar edt-last-answer nil |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2040 "Most recent response to `edt-y-or-n-p'.") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2041 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2042 (defun edt-y-or-n-p (prompt &optional not-yes) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2043 "Prompt for a y or n answer with positive default. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2044 Like Emacs `y-or-n-p', also accepts space as y and DEL as n. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2045 Argument PROMPT is the prompt string. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2046 Optional argument NOT-YES changes the default to negative." |
14346
4a609420dfc1
(edt-display-the-time): Pass proper format string to message.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
2047 (message "%s[%s]" prompt (if not-yes "n" "y")) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2048 (let ((doit t)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2049 (while doit |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2050 (setq doit nil) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2051 (let ((ans (read-char))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2052 (cond ((or (= ans ?y) (= ans ?Y) (= ans ?\ )) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2053 (setq edt-last-answer t)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2054 ((or (= ans ?n) (= ans ?N) (= ans ?\C-?)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2055 (setq edt-last-answer nil)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2056 ((= ans ?\r) (setq edt-last-answer (not not-yes))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2057 (t |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2058 (setq doit t) (beep) |
14346
4a609420dfc1
(edt-display-the-time): Pass proper format string to message.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
2059 (message "Please answer y or n. %s[%s]" |
4a609420dfc1
(edt-display-the-time): Pass proper format string to message.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
2060 prompt (if not-yes "n" "y"))))))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2061 edt-last-answer) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2062 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2063 ;;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2064 ;;; INITIALIZATION COMMANDS. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2065 ;;; |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2066 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2067 ;;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2068 ;;; Function used to load LK-201 key mapping file generated by edt-mapper.el. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2069 ;;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2070 (defun edt-load-keys (file) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2071 "Load the LK-201 key mapping FILE generated by edt-mapper.el. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2072 If FILE is nil, which is the normal case, try to load a default file. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2073 The default file names are based upon the window system, terminal |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2074 type, and version of Emacs in use: GNU Emacs or XEmacs (aka Lucid |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2075 Emacs). If a default file does not exist, ask user if one should be |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2076 created." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2077 (interactive "fKey definition file: ") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2078 (cond (file |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2079 (setq file (expand-file-name file))) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2080 (edt-keys-file |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2081 (setq file (expand-file-name edt-keys-file))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2082 (t |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2083 (setq file |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2084 (expand-file-name |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2085 (concat |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2086 "~/.edt-" edt-emacs-variant |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2087 (if edt-term (concat "-" edt-term)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2088 (if edt-xserver (concat "-" edt-xserver)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2089 (if edt-window-system |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2090 (concat "-" (upcase (symbol-name edt-window-system)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2091 "-keys"))))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2092 (cond ((file-readable-p file) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2093 (load-file file)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2094 (t |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2095 (switch-to-buffer "*scratch*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2096 (erase-buffer) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2097 (insert " |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2098 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2099 Ack!! You're running the Enhanced EDT Emulation without loading an |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2100 EDT key mapping file. To create an EDT key mapping file, run the |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2101 edt-mapper.el program. It is safest to run it from an Emacs loaded |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2102 without any of your own customizations found in your .emacs file, etc. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2103 The reason for this is that some user customizations confuse edt-mapper. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2104 You can do this by quitting Emacs and then invoking Emacs again as |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2105 follows: |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2106 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2107 emacs -q -l edt-mapper.el |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2108 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2109 [NOTE: If you do nothing out of the ordinary in your .emacs file, and |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2110 the search for edt-mapper.el is successful, you can try running it now.] |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2111 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2112 The file edt-mapper.el includes these same directions on how to |
16426
0db426a80aff
(edt-load-xkeys): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
14346
diff
changeset
|
2113 use it! Perhaps it's lying around here someplace. \n ") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2114 (let ((file "edt-mapper.el") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2115 (found nil) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2116 (path nil) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2117 (search-list (append (list (expand-file-name ".")) load-path))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2118 (while (and (not found) search-list) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2119 (setq path (concat (car search-list) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2120 (if (string-match "/$" (car search-list)) "" "/") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2121 file)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2122 (if (and (file-exists-p path) (not (file-directory-p path))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2123 (setq found t)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2124 (setq search-list (cdr search-list))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2125 (cond (found |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2126 (insert (format |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2127 "Ah yes, there it is, in \n\n %s \n\n" path)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2128 (if (edt-y-or-n-p "Do you want to run it now? ") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2129 (load-file path) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2130 (error "EDT Emulation not configured"))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2131 (t |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2132 (insert "Nope, I can't seem to find it. :-(\n\n") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2133 (sit-for 20) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2134 (error "EDT Emulation not configured"))))))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2135 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2136 ;;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2137 ;;; Turning the EDT Emulation on and off. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2138 ;;; |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2139 |
258 | 2140 ;;;###autoload |
57 | 2141 (defun edt-emulation-on () |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2142 "Turn on EDT Emulation." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2143 (interactive) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2144 ;; If using pc window system (MS-DOS), set terminal type to pc. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2145 ;; If not a window system (GNU) or a tty window system (XEmacs), |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2146 ;; get terminal type. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2147 (if (eq edt-window-system 'pc) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2148 (setq edt-term "pc") |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2149 (if (or (not edt-window-system) (eq edt-window-system 'tty)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2150 (setq edt-term (getenv "TERM")))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2151 ;; Look for for terminal configuration file for this terminal type. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2152 ;; Otherwise, load the user's custom configuration file. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2153 (if (or (not edt-window-system) (memq edt-window-system '(pc tty))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2154 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2155 ;; Load terminal-specific configuration file, if it exists for this |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2156 ;; terminal type. Note: All DEC VT series terminals are supported |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2157 ;; by the same terminal configuration file: edt-vt100.el. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2158 (if (string-equal "vt" (substring edt-term 0 (min (length edt-term) 2))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2159 (setq edt-term "vt100")) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2160 (let ((term edt-term) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2161 hyphend) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2162 (while (and term |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2163 (not (load (concat "edt-" term) t t))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2164 ;; Strip off last hyphen and what follows, then try again |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2165 (if (setq hyphend (string-match "[-_][^-_]+$" term)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2166 (setq term (substring term 0 hyphend)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2167 (setq term nil))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2168 ;; If no terminal-specific configuration file exists, load user's |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2169 ;; custom EDT terminal configuration file. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2170 ;; If this is a pc running MS-DOS, then custom configuration files |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2171 ;; are not supported. So, if the file is missing, issue an error |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2172 ;; message. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2173 (if (null term) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2174 (if (equal edt-term "pc") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2175 (error "Unable to find EDT terminal specific file edt-pc.el") |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2176 (edt-load-keys nil)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2177 (setq edt-term term)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2178 (edt-load-keys nil)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2179 ;; Make highlighting of selected text work properly for EDT commands. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2180 (if edt-gnu-emacs19-p |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2181 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2182 (setq edt-orig-transient-mark-mode transient-mark-mode) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2183 (add-hook 'activate-mark-hook |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2184 (function |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2185 (lambda () |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2186 (edt-select-mode t)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2187 (add-hook 'deactivate-mark-hook |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2188 (function |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2189 (lambda () |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2190 (edt-select-mode nil))))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2191 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2192 (add-hook 'zmacs-activate-region-hook |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2193 (function |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2194 (lambda () |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2195 (edt-select-mode t)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2196 (add-hook 'zmacs-deactivate-region-hook |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2197 (function |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2198 (lambda () |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2199 (edt-select-mode nil)))))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2200 ;; Load user's EDT custom key bindings file, if it exists. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2201 ;; Otherwise, use the default bindings. |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2202 (if (load "edt-user" t t) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2203 (edt-user-emulation-setup) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2204 (edt-default-emulation-setup))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2205 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2206 (defun edt-emulation-off() |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2207 "Select original global key bindings, disabling EDT Emulation." |
57 | 2208 (interactive) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2209 (use-global-map global-map) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2210 (if (not edt-keep-current-page-delimiter) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2211 (setq page-delimiter edt-orig-page-delimiter)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2212 (setq edt-direction-string "") |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2213 (setq edt-select-mode-current nil) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2214 (edt-reset) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2215 (force-mode-line-update t) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2216 (if edt-gnu-emacs19-p |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2217 (setq transient-mark-mode edt-orig-transient-mark-mode)) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2218 (message "Original key bindings restored; EDT Emulation disabled")) |
57 | 2219 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2220 (defun edt-default-emulation-setup (&optional user-setup) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2221 "Setup emulation of DEC's EDT editor. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2222 Optional argument USER-SETUP non-nil means called from function |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2223 `edt-user-emulation-setup'." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2224 ;; Setup default EDT global map by copying global map bindings. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2225 ;; This preserves ESC and C-x prefix bindings and other bindings we |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2226 ;; wish to retain in EDT emulation mode keymaps. It also permits |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2227 ;; customization of these bindings in the EDT global maps without |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2228 ;; disturbing the original bindings in global-map. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2229 (fset 'edt-default-ESC-prefix (copy-keymap 'ESC-prefix)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2230 (setq edt-default-global-map (copy-keymap (current-global-map))) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2231 (if edt-gnu-emacs19-p |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2232 (define-key edt-default-global-map "\e" 'edt-default-ESC-prefix) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2233 (define-key edt-default-global-map [escape] 'edt-default-ESC-prefix)) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2234 (define-prefix-command 'edt-default-gold-map) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2235 (edt-setup-default-bindings) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2236 ;; If terminal has additional function keys, the terminal-specific |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2237 ;; initialization file can assign bindings to them via the optional |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2238 ;; function edt-setup-extra-default-bindings. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2239 (if (fboundp 'edt-setup-extra-default-bindings) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2240 (edt-setup-extra-default-bindings)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2241 ;; Variable needed by edt-learn. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2242 (setq edt-learn-macro-count 0) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2243 ;; Display EDT text selection active within the mode line |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2244 (or (assq 'edt-select-mode minor-mode-alist) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2245 (setq minor-mode-alist |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2246 (cons '(edt-select-mode edt-select-mode) minor-mode-alist))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2247 ;; Display EDT direction of motion within the mode line |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2248 (or (assq 'edt-direction-string minor-mode-alist) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2249 (setq minor-mode-alist |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2250 (cons |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2251 '(edt-direction-string edt-direction-string) minor-mode-alist))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2252 (if user-setup |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2253 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2254 (setq edt-user-map-configured t) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2255 (fset 'edt-emulation-on (symbol-function 'edt-select-user-global-map))) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2256 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2257 (fset 'edt-emulation-on (symbol-function 'edt-select-default-global-map)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2258 (edt-select-default-global-map)))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2259 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2260 (defun edt-user-emulation-setup () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2261 "Setup user custom emulation of DEC's EDT editor." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2262 ;; Initialize EDT default bindings. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2263 (edt-default-emulation-setup t) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2264 ;; Setup user EDT global map by copying default EDT global map bindings. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2265 (fset 'edt-user-ESC-prefix (copy-keymap 'edt-default-ESC-prefix)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2266 (setq edt-user-global-map (copy-keymap edt-default-global-map)) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2267 (if edt-gnu-emacs19-p |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2268 (define-key edt-user-global-map "\e" 'edt-user-ESC-prefix) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2269 (define-key edt-user-global-map [escape] 'edt-user-ESC-prefix)) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2270 ;; If terminal has additional function keys, the user's initialization |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2271 ;; file can assign bindings to them via the optional |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2272 ;; function edt-setup-extra-default-bindings. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2273 (define-prefix-command 'edt-user-gold-map) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2274 (fset 'edt-user-gold-map (copy-keymap 'edt-default-gold-map)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2275 (edt-setup-user-bindings) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2276 (edt-select-user-global-map)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2277 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2278 (defun edt-select-default-global-map() |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2279 "Select default EDT emulation key bindings." |
57 | 2280 (interactive) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2281 (if edt-gnu-emacs19-p |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2282 (transient-mark-mode 1)) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2283 (use-global-map edt-default-global-map) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2284 (if (not edt-keep-current-page-delimiter) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2285 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2286 (setq edt-orig-page-delimiter page-delimiter) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2287 (setq page-delimiter "\f"))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2288 (setq edt-default-map-active t) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2289 (edt-advance) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2290 (setq edt-select-mode-current 'edt-select-mode-string) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2291 (edt-reset) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2292 (message "Default EDT keymap active")) |
57 | 2293 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2294 (defun edt-select-user-global-map() |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2295 "Select user EDT emulation custom key bindings." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2296 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2297 (if edt-user-map-configured |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2298 (progn |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2299 (if edt-gnu-emacs19-p |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2300 (transient-mark-mode 1)) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2301 (use-global-map edt-user-global-map) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2302 (if (not edt-keep-current-page-delimiter) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2303 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2304 (setq edt-orig-page-delimiter page-delimiter) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2305 (setq page-delimiter "\f"))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2306 (setq edt-default-map-active nil) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2307 (edt-advance) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2308 (setq edt-select-mode-current 'edt-select-mode-string) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2309 (edt-reset) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2310 (message "User EDT custom keymap active")) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2311 (error "User EDT custom keymap NOT configured!"))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2312 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2313 (defun edt-switch-global-maps () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2314 "Toggle between default EDT keymap and user EDT keymap." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2315 (interactive) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2316 (if edt-default-map-active |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2317 (edt-select-user-global-map) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2318 (edt-select-default-global-map))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2319 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2320 ;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2321 ;; Functions used to set up DEFAULT bindings to EDT emulation functions. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2322 ;; |
57 | 2323 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2324 (defun edt-bind-function-key-default (function-key binding gold-binding) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2325 "Binds LK-201 function keys to default bindings in the EDT Emulator. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2326 Argument FUNCTION-KEY is the name of the function key or keypad function key. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2327 Argument BINDING is the Emacs function to be bound to <KEY>. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2328 Argument GOLD-BINDING is the Emacs function to be bound to GOLD <KEY>." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2329 (let ((key (cdr (assoc function-key *EDT-keys*)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2330 (if (and key (not (equal key ""))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2331 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2332 (define-key edt-default-global-map key binding) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2333 (define-key 'edt-default-gold-map key gold-binding))))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2334 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2335 (defun edt-bind-key-default (key binding) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2336 "Bind key sequences to default bindings in the EDT Emulator. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2337 Argument KEY is the name of a standard key or a function key. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2338 Argument BINDING is the Emacs function to be bound to <KEY>." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2339 (define-key edt-default-global-map key binding)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2340 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2341 (defun edt-bind-gold-key-default (key gold-binding) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2342 "Binds <GOLD> key sequences to default bindings in the EDT Emulator. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2343 Argument KEY is the name of a standard key or a function key. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2344 Argument GOLD-BINDING is the Emacs function to be bound to GOLD <KEY>." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2345 (define-key 'edt-default-gold-map key gold-binding)) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2346 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2347 ;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2348 ;; Functions used to set up USER CUSTOM bindings to EDT emulation functions. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2349 ;; |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2350 (defun edt-bind-function-key (function-key binding gold-binding) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2351 "Binds LK-201 function keys to custom bindings in the EDT Emulator. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2352 Argument FUNCTION-KEY is the name of the function key or keypad function key. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2353 Argument BINDING is the Emacs function to be bound to <KEY>. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2354 Argument GOLD-BINDING is the Emacs function to be bound to GOLD <KEY>." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2355 (let ((key (cdr (assoc function-key *EDT-keys*)))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2356 (if (and key (not (equal key ""))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2357 (progn |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2358 (define-key edt-user-global-map key binding) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2359 (define-key 'edt-user-gold-map key gold-binding))))) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2360 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2361 (defun edt-bind-key (key binding) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2362 "Bind standard key sequences to custom bindings in the EDT Emulator. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2363 Argument KEY is the name of a key. It can be a standard key or a function key. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2364 Argument BINDING is the Emacs function to be bound to <KEY>." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2365 (define-key edt-user-global-map key binding)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2366 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2367 ;; For backward compatibility to existing edt-user.el files. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2368 (fset 'edt-bind-standard-key (symbol-function 'edt-bind-key)) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2369 |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2370 (defun edt-bind-gold-key (key gold-binding) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2371 "Binds <GOLD> standard key sequences to custom bindings in the EDT Emulator. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2372 Argument KEY is the name of a standard key or a function key. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2373 Argument GOLD-BINDING is the Emacs function to be bound to GOLD <KEY>." |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2374 (define-key 'edt-user-gold-map key gold-binding)) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2375 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2376 (defun edt-setup-default-bindings () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2377 "Assigns default EDT Emulation keyboard bindings." |
3479
7cda082508c9
(GOLD-prefix): Define *after* GOLD-map.
Richard M. Stallman <rms@gnu.org>
parents:
2570
diff
changeset
|
2378 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2379 ;; Function Key Bindings: Regular and GOLD. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2380 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2381 ;; VT100/VT200/VT300 PF1 (GOLD), PF2, PF3, PF4 Keys |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2382 (edt-bind-function-key-default "PF1" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2383 'edt-default-gold-map 'edt-mark-section-wisely) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2384 (edt-bind-function-key-default "PF2" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2385 'edt-electric-keypad-help 'describe-function) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2386 (edt-bind-function-key-default "PF3" 'edt-find-next 'edt-find) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2387 (edt-bind-function-key-default "PF4" 'edt-delete-line 'edt-undelete-line) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2388 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2389 ;; VT100/VT200/VT300 Arrow Keys |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2390 (edt-bind-function-key-default "UP" 'edt-previous-line 'edt-window-top) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2391 (edt-bind-function-key-default "DOWN" 'edt-next-line 'edt-window-bottom) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2392 (edt-bind-function-key-default "LEFT" 'backward-char 'edt-sentence-backward) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2393 (edt-bind-function-key-default "RIGHT" 'forward-char 'edt-sentence-forward) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2394 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2395 ;; VT100/VT200/VT300 Keypad Keys |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2396 (edt-bind-function-key-default "KP0" 'edt-line 'open-line) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2397 (edt-bind-function-key-default "KP1" 'edt-word 'edt-change-case) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2398 (edt-bind-function-key-default "KP2" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2399 'edt-end-of-line 'edt-delete-to-end-of-line) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2400 (edt-bind-function-key-default "KP3" 'edt-character 'quoted-insert) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2401 (edt-bind-function-key-default "KP4" 'edt-advance 'edt-bottom) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2402 (edt-bind-function-key-default "KP5" 'edt-backup 'edt-top) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2403 (edt-bind-function-key-default "KP6" 'edt-cut 'yank) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2404 (edt-bind-function-key-default "KP7" 'edt-page 'execute-extended-command) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2405 (edt-bind-function-key-default "KP8" 'edt-sect 'edt-fill-region) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2406 (edt-bind-function-key-default "KP9" 'edt-append 'edt-replace) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2407 (edt-bind-function-key-default "KP-" 'edt-delete-word 'edt-undelete-word) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2408 (edt-bind-function-key-default "KP," |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2409 'edt-delete-character 'edt-undelete-character) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2410 (edt-bind-function-key-default "KPP" 'edt-select 'edt-reset) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2411 (edt-bind-function-key-default "KPE" 'other-window 'edt-substitute) |
57 | 2412 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2413 ;; VT200/VT300 Function Keys |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2414 ;; (F1 through F5, on the VT220, are not programmable, so we skip |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2415 ;; making default bindings to those keys. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2416 (edt-bind-function-key-default "FIND" 'edt-find-next 'edt-find) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2417 (edt-bind-function-key-default "INSERT" 'yank 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2418 (edt-bind-function-key-default "REMOVE" 'edt-cut 'edt-copy) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2419 (edt-bind-function-key-default "SELECT" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2420 'edt-toggle-select 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2421 (edt-bind-function-key-default "NEXT" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2422 'edt-sect-forward 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2423 (edt-bind-function-key-default "PREVIOUS" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2424 'edt-sect-backward 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2425 (edt-bind-function-key-default "F6" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2426 'edt-key-not-assigned 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2427 (edt-bind-function-key-default "F7" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2428 'edt-copy-rectangle 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2429 (edt-bind-function-key-default "F8" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2430 'edt-cut-rectangle-overstrike-mode 'edt-paste-rectangle-overstrike-mode) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2431 (edt-bind-function-key-default "F9" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2432 'edt-cut-rectangle-insert-mode 'edt-paste-rectangle-insert-mode) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2433 (edt-bind-function-key-default "F10" 'edt-cut-rectangle 'edt-paste-rectangle) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2434 ;; Under X, the F11 key can be bound. If using a VT-200 or higher terminal, |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2435 ;; the default emacs terminal support causes the VT F11 key to seem as if it |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2436 ;; is an ESC key when in emacs. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2437 (edt-bind-function-key-default "F11" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2438 'edt-key-not-assigned 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2439 (edt-bind-function-key-default "F12" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2440 'edt-beginning-of-line 'delete-other-windows) ;BS |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2441 (edt-bind-function-key-default "F13" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2442 'edt-delete-to-beginning-of-word 'edt-key-not-assigned) ;LF |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2443 (edt-bind-function-key-default "F14" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2444 'edt-key-not-assigned 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2445 (edt-bind-function-key-default "HELP" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2446 'edt-electric-keypad-help 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2447 (edt-bind-function-key-default "DO" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2448 'execute-extended-command 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2449 (edt-bind-function-key-default "F17" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2450 'edt-key-not-assigned 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2451 (edt-bind-function-key-default "F18" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2452 'edt-key-not-assigned 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2453 (edt-bind-function-key-default "F19" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2454 'edt-key-not-assigned 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2455 (edt-bind-function-key-default "F20" |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2456 'edt-key-not-assigned 'edt-key-not-assigned) |
57 | 2457 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2458 ;; Control key bindings: Regular and GOLD |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2459 ;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2460 ;; Standard EDT control key bindings conflict with standard Emacs |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2461 ;; control key bindings. Normally, the standard Emacs control key |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2462 ;; bindings are left unchanged in the default EDT mode. However, if |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2463 ;; the variable edt-use-EDT-control-key-bindings is set to true |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2464 ;; before invoking edt-emulation-on for the first time, then the |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2465 ;; standard EDT bindings (with some enhancements) as defined here are |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2466 ;; used, instead. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2467 (if edt-use-EDT-control-key-bindings |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2468 (progn |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2469 (edt-bind-key-default "\C-a" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2470 (edt-bind-key-default "\C-b" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2471 ;; Leave binding of C-c to an Emacs prefix key. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2472 (edt-bind-key-default "\C-d" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2473 (edt-bind-key-default "\C-e" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2474 (edt-bind-key-default "\C-f" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2475 ;; Leave binding of C-g to the Emacs keyboard-quit |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2476 (edt-bind-key-default "\C-h" 'edt-beginning-of-line) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2477 (edt-bind-key-default "\C-i" 'edt-tab-insert) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2478 (edt-bind-key-default "\C-j" 'edt-delete-to-beginning-of-word) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2479 (edt-bind-key-default "\C-k" 'edt-define-key) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2480 (edt-bind-gold-key-default "\C-k" 'edt-restore-key) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2481 (edt-bind-key-default "\C-l" 'edt-form-feed-insert) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2482 ;; Leave binding of C-m to newline. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2483 (edt-bind-key-default "\C-n" 'edt-set-screen-width-80) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2484 (edt-bind-key-default "\C-o" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2485 (edt-bind-key-default "\C-p" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2486 (edt-bind-key-default "\C-q" 'edt-key-not-assigned) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2487 ;; Leave binding of C-r to isearch-backward. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2488 ;; Leave binding of C-s to isearch-forward. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2489 (edt-bind-key-default "\C-t" 'edt-display-the-time) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2490 (edt-bind-key-default "\C-u" 'edt-delete-to-beginning-of-line) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2491 (edt-bind-key-default "\C-v" 'redraw-display) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2492 (edt-bind-key-default "\C-w" 'edt-set-screen-width-132) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2493 ;; Leave binding of C-x as original prefix key. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2494 (edt-bind-key-default "\C-y" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2495 ;; Leave binding of C-z to suspend-emacs. |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2496 ) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2497 ) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2498 |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2499 ;; GOLD bindings for a few keys. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2500 (edt-bind-gold-key-default "\C-g" 'keyboard-quit); Just in case. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2501 (edt-bind-gold-key-default "\C-h" 'help-for-help); Just in case. |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2502 (edt-bind-gold-key-default [f1] 'help-for-help) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2503 (edt-bind-gold-key-default [help] 'help-for-help) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2504 (edt-bind-gold-key-default "\C-\\" 'split-window-vertically) |
57 | 2505 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2506 ;; GOLD bindings for regular keys. |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2507 (edt-bind-gold-key-default "a" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2508 (edt-bind-gold-key-default "A" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2509 (edt-bind-gold-key-default "b" 'buffer-menu) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2510 (edt-bind-gold-key-default "B" 'buffer-menu) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2511 (edt-bind-gold-key-default "c" 'compile) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2512 (edt-bind-gold-key-default "C" 'compile) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2513 (edt-bind-gold-key-default "d" 'delete-window) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2514 (edt-bind-gold-key-default "D" 'delete-window) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2515 (edt-bind-gold-key-default "e" 'edt-exit) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2516 (edt-bind-gold-key-default "E" 'edt-exit) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2517 (edt-bind-gold-key-default "f" 'find-file) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2518 (edt-bind-gold-key-default "F" 'find-file) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2519 (edt-bind-gold-key-default "g" 'find-file-other-window) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2520 (edt-bind-gold-key-default "G" 'find-file-other-window) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2521 (edt-bind-gold-key-default "h" 'edt-electric-keypad-help) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2522 (edt-bind-gold-key-default "H" 'edt-electric-keypad-help) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2523 (edt-bind-gold-key-default "i" 'insert-file) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2524 (edt-bind-gold-key-default "I" 'insert-file) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2525 (edt-bind-gold-key-default "j" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2526 (edt-bind-gold-key-default "J" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2527 (edt-bind-gold-key-default "k" 'edt-toggle-capitalization-of-word) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2528 (edt-bind-gold-key-default "K" 'edt-toggle-capitalization-of-word) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2529 (edt-bind-gold-key-default "l" 'edt-lowercase) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2530 (edt-bind-gold-key-default "L" 'edt-lowercase) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2531 (edt-bind-gold-key-default "m" 'save-some-buffers) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2532 (edt-bind-gold-key-default "M" 'save-some-buffers) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2533 (edt-bind-gold-key-default "n" 'next-error) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2534 (edt-bind-gold-key-default "N" 'next-error) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2535 (edt-bind-gold-key-default "o" 'switch-to-buffer-other-window) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2536 (edt-bind-gold-key-default "O" 'switch-to-buffer-other-window) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2537 (edt-bind-gold-key-default "p" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2538 (edt-bind-gold-key-default "P" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2539 (edt-bind-gold-key-default "q" 'edt-quit) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2540 (edt-bind-gold-key-default "Q" 'edt-quit) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2541 (edt-bind-gold-key-default "r" 'revert-buffer) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2542 (edt-bind-gold-key-default "R" 'revert-buffer) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2543 (edt-bind-gold-key-default "s" 'save-buffer) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2544 (edt-bind-gold-key-default "S" 'save-buffer) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2545 (edt-bind-gold-key-default "t" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2546 (edt-bind-gold-key-default "T" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2547 (edt-bind-gold-key-default "u" 'edt-uppercase) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2548 (edt-bind-gold-key-default "U" 'edt-uppercase) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2549 (edt-bind-gold-key-default "v" 'find-file-other-window) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2550 (edt-bind-gold-key-default "V" 'find-file-other-window) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2551 (edt-bind-gold-key-default "w" 'write-file) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2552 (edt-bind-gold-key-default "W" 'write-file) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2553 (edt-bind-gold-key-default "x" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2554 (edt-bind-gold-key-default "X" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2555 (edt-bind-gold-key-default "y" 'edt-emulation-off) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2556 (edt-bind-gold-key-default "Y" 'edt-emulation-off) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2557 (edt-bind-gold-key-default "z" 'edt-switch-global-maps) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2558 (edt-bind-gold-key-default "Z" 'edt-switch-global-maps) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2559 (edt-bind-gold-key-default "1" 'delete-other-windows) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2560 (edt-bind-gold-key-default "!" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2561 (edt-bind-gold-key-default "2" 'edt-split-window) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2562 (edt-bind-gold-key-default "@" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2563 (edt-bind-gold-key-default "3" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2564 (edt-bind-gold-key-default "#" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2565 (edt-bind-gold-key-default "4" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2566 (edt-bind-gold-key-default "$" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2567 (edt-bind-gold-key-default "5" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2568 (edt-bind-gold-key-default "%" 'edt-goto-percentage) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2569 (edt-bind-gold-key-default "6" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2570 (edt-bind-gold-key-default "^" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2571 (edt-bind-gold-key-default "7" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2572 (edt-bind-gold-key-default "&" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2573 (edt-bind-gold-key-default "8" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2574 (edt-bind-gold-key-default "*" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2575 (edt-bind-gold-key-default "9" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2576 (edt-bind-gold-key-default "(" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2577 (edt-bind-gold-key-default "0" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2578 (edt-bind-gold-key-default ")" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2579 (edt-bind-gold-key-default " " 'undo) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2580 (edt-bind-gold-key-default "," 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2581 (edt-bind-gold-key-default "<" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2582 (edt-bind-gold-key-default "." 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2583 (edt-bind-gold-key-default ">" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2584 (edt-bind-gold-key-default "/" 'query-replace) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2585 (edt-bind-gold-key-default "?" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2586 (edt-bind-gold-key-default "\\" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2587 (edt-bind-gold-key-default "|" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2588 (edt-bind-gold-key-default ";" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2589 (edt-bind-gold-key-default ":" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2590 (edt-bind-gold-key-default "'" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2591 (edt-bind-gold-key-default "\"" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2592 (edt-bind-gold-key-default "-" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2593 (edt-bind-gold-key-default "_" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2594 (edt-bind-gold-key-default "=" 'goto-line) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2595 (edt-bind-gold-key-default "+" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2596 (edt-bind-gold-key-default "[" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2597 (edt-bind-gold-key-default "{" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2598 (edt-bind-gold-key-default "]" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2599 (edt-bind-gold-key-default "}" 'edt-key-not-assigned) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2600 (edt-bind-gold-key-default "`" 'what-line) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2601 (edt-bind-gold-key-default "~" 'edt-key-not-assigned) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2602 ) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2603 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2604 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2605 ;;; DEFAULT EDT KEYPAD HELP |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2606 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2607 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2608 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2609 ;;; Upper case commands in the keypad diagram below indicate that the |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2610 ;;; emulation should look and feel very much like EDT. Lower case |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2611 ;;; commands are enhancements and/or additions to the EDT keypad |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2612 ;;; commands or are native Emacs commands. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2613 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2614 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2615 (defun edt-keypad-help () |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2616 "DEFAULT EDT Keypad Active. |
57 | 2617 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2618 F7: Copy Rectangle +----------+----------+----------+----------+ |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2619 F8: Cut Rect Overstrike |Prev Line |Next Line |Bkwd Char |Frwd Char | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2620 G-F8: Paste Rect Overstrike | (UP) | (DOWN) | (LEFT) | (RIGHT) | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2621 F9: Cut Rect Insert |Window Top|Window Bot|Bkwd Sent |Frwd Sent | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2622 G-F9: Paste Rect Insert +----------+----------+----------+----------+ |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2623 F10: Cut Rectangle |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2624 G-F10: Paste Rectangle |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2625 F11: ESC |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2626 F12: Begining of Line +----------+----------+----------+----------+ |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2627 G-F12: Delete Other Windows | GOLD | HELP | FNDNXT | DEL L | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2628 F13: Delete to Begin of Word | (PF1) | (PF2) | (PF3) | (PF4) | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2629 HELP: Keypad Help |Mark Wisel|Desc Funct| FIND | UND L | |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2630 G-HELP: Emacs Help +----------+----------+----------+----------+ |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2631 DO: Execute extended command | PAGE | SECT | APPEND | DEL W | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2632 C-g: Keyboard Quit | (7) | (8) | (9) | (-) | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2633 G-C-g: Keyboard Quit |Ex Ext Cmd|Fill Regio| REPLACE | UND W | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2634 C-h: Beginning of Line +----------+----------+----------+----------+ |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2635 G-C-h: Emacs Help | ADVANCE | BACKUP | CUT | DEL C | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2636 C-i: Tab Insert | (4) | (5) | (6) | (,) | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2637 C-j: Delete to Begin of Word | BOTTOM | TOP | Yank | UND C | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2638 C-k: Define Key +----------+----------+----------+----------+ |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2639 G-C-k: Restore Key | WORD | EOL | CHAR | Next | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2640 C-l: Form Feed Insert | (1) | (2) | (3) | Window | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2641 C-n: Set Screen Width 80 | CHNGCASE | DEL EOL |Quoted Ins| ! |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2642 C-r: Isearch Backward +---------------------+----------+ (ENTER) | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2643 C-s: Isearch Forward | LINE | SELECT | ! |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2644 C-t: Display the Time | (0) | (.) | SUBS | |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2645 C-u: Delete to Begin of Line | Open Line | RESET | | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2646 C-v: Redraw Display +---------------------+----------+----------+ |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2647 C-w: Set Screen Width 132 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2648 C-z: Suspend Emacs +----------+----------+----------+ |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2649 G-C-\\: Split Window | FNDNXT | Yank | CUT | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2650 | (FIND) | (INSERT) | (REMOVE) | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2651 G-b: Buffer Menu | FIND | | COPY | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2652 G-c: Compile +----------+----------+----------+ |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2653 G-d: Delete Window |SELECT/RES|SECT BACKW|SECT FORWA| |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2654 G-e: Exit | (SELECT) |(PREVIOUS)| (NEXT) | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2655 G-f: Find File | | | | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2656 G-g: Find File Other Window +----------+----------+----------+ |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2657 G-h: Keypad Help |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2658 G-i: Insert File |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2659 G-k: Toggle Capitalization Word |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2660 G-l: Downcase Region |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2661 G-m: Save Some Buffers |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2662 G-n: Next Error |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2663 G-o: Switch to Next Window |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2664 G-q: Quit |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2665 G-r: Revert File |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2666 G-s: Save Buffer |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2667 G-u: Upcase Region |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2668 G-v: Find File Other Window |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2669 G-w: Write file |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2670 G-y: EDT Emulation OFF |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2671 G-z: Switch to User EDT Key Bindings |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2672 G-1: Delete Other Windows |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2673 G-2: Split Window |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2674 G-%: Go to Percentage |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2675 G- : Undo (GOLD Spacebar) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2676 G-=: Go to Line |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2677 G-`: What line |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2678 G-/: Query-Replace" |
57 | 2679 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2680 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2681 (describe-function 'edt-keypad-help)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2682 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2683 (defun edt-electric-helpify (fun) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2684 (let ((name "*Help*")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2685 (if (save-window-excursion |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2686 (let* ((p (symbol-function 'print-help-return-message)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2687 (b (get-buffer name)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2688 (m (buffer-modified-p b))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2689 (and b (not (get-buffer-window b)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2690 (setq b nil)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2691 (unwind-protect |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2692 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2693 (message "%s..." (capitalize (symbol-name fun))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2694 (and b |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2695 (save-excursion |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2696 (set-buffer b) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2697 (set-buffer-modified-p t))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2698 (fset 'print-help-return-message 'ignore) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2699 (call-interactively fun) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2700 (and (get-buffer name) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2701 (get-buffer-window (get-buffer name)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2702 (or (not b) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2703 (not (eq b (get-buffer name))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2704 (not (buffer-modified-p b))))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2705 (fset 'print-help-return-message p) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2706 (and b (buffer-name b) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2707 (save-excursion |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2708 (set-buffer b) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2709 (set-buffer-modified-p m)))))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2710 (with-electric-help 'delete-other-windows name t)))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2711 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2712 (defun edt-electric-keypad-help () |
11442 | 2713 "Display default EDT bindings." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2714 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2715 (edt-electric-helpify 'edt-keypad-help)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2716 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2717 (defun edt-electric-user-keypad-help () |
11442 | 2718 "Display user custom EDT bindings." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2719 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2720 (edt-electric-helpify 'edt-user-keypad-help)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2721 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2722 ;;; |
13058
1d26583f8c2b
(edt-set-screen-width-80, edt-set-screen-width-132):
Karl Heuer <kwzh@gnu.org>
parents:
12421
diff
changeset
|
2723 ;;; EDT emulation screen width commands. |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2724 ;;; |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2725 ;; Some terminals require modification of terminal attributes when |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2726 ;; changing the number of columns displayed, hence the fboundp tests |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2727 ;; below. These functions are defined in the corresponding terminal |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2728 ;; specific file, if needed. |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2729 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2730 (defun edt-set-screen-width-80 () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2731 "Set screen width to 80 columns." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2732 (interactive) |
13058
1d26583f8c2b
(edt-set-screen-width-80, edt-set-screen-width-132):
Karl Heuer <kwzh@gnu.org>
parents:
12421
diff
changeset
|
2733 (if (fboundp 'edt-set-term-width-80) |
1d26583f8c2b
(edt-set-screen-width-80, edt-set-screen-width-132):
Karl Heuer <kwzh@gnu.org>
parents:
12421
diff
changeset
|
2734 (edt-set-term-width-80)) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2735 (set-frame-width nil 80) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2736 (message "Terminal width 80")) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2737 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2738 (defun edt-set-screen-width-132 () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2739 "Set screen width to 132 columns." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2740 (interactive) |
13058
1d26583f8c2b
(edt-set-screen-width-80, edt-set-screen-width-132):
Karl Heuer <kwzh@gnu.org>
parents:
12421
diff
changeset
|
2741 (if (fboundp 'edt-set-term-width-132) |
1d26583f8c2b
(edt-set-screen-width-80, edt-set-screen-width-132):
Karl Heuer <kwzh@gnu.org>
parents:
12421
diff
changeset
|
2742 (edt-set-term-width-132)) |
35124
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2743 (set-frame-width nil 132) |
0b78d7b101c2
Update to version 4.0. Provide support for
Gerd Moellmann <gerd@gnu.org>
parents:
18943
diff
changeset
|
2744 (message "Terminal width 132")) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2745 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2746 (provide 'edt) |
660
08eb386dd0f3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
258
diff
changeset
|
2747 |
08eb386dd0f3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
258
diff
changeset
|
2748 ;;; edt.el ends here |