annotate lisp/emulators/edt.el @ 147:e186c2b7192d xemacs-20-2

Added tag r20-2p1 for changeset 2af401a6ecca
author cvs
date Mon, 13 Aug 2007 09:34:48 +0200
parents 6608ceec7cf8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1 ;;; edt.el --- Enhanced EDT Keypad Mode Emulation for GNU Emacs 19
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
3 ;; Copyright (C) 1986, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
5 ;; Author: Kevin Gallagher <kgallagh@spd.dsccc.com>
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
6 ;; Maintainer: Kevin Gallagher <kgallagh@spd.dsccc.com>
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
7 ;; Keywords: emulations
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; along with XEmacs; see the file COPYING. If not, write to the Free
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
24 ;; 02111-1307, USA.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
25
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
26 ;;; Synched up with: FSF 19.34
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
27
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
28 ;;; Usage:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
29
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
30 ;; See edt-user.doc in the Emacs etc directory.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
31
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
32 ;; Maintainer's note: There was a very old edt.el here that wouldn't even
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
33 ;; load, so I replaced it completely with the newer one from 19.34. -sb
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
34 ;; ====================================================================
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
35
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
36 ;;; Electric Help functions are used for keypad help displays. A few
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
37 ;;; picture functions are used in rectangular cut and paste commands.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
38 (require 'ehelp)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
39 (require 'picture)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
40
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
41 ;;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
42 ;;;; VARIABLES and CONSTANTS
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
43 ;;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
44
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
45 (defvar edt-last-deleted-lines ""
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
46 "Last text deleted by an EDT emulation line delete command.")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
47
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
48 (defvar edt-last-deleted-words ""
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
49 "Last text deleted by an EDT emulation word delete command.")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
50
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
51 (defvar edt-last-deleted-chars ""
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
52 "Last text deleted by an EDT emulation character delete command.")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
53
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
54 (defvar edt-last-replaced-key-definition ""
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
55 "Key definition replaced with edt-define-key or edt-learn command.")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
56
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
57 (defvar edt-direction-string ""
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
58 "String indicating current direction of movement.")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
59
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
60 (defvar edt-select-mode nil
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
61 "Non-nil means select mode is active.")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
62
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
63 (defvar edt-select-mode-text ""
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
64 "Text displayed in mode line when select mode is active.")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
65
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
66 (defconst edt-select-mode-string " Select"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
67 "String to indicate select mode is active.")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
68
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
69 (defconst edt-forward-string " ADVANCE"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
70 "Direction string in mode line to indicate forward movement.")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
71
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
72 (defconst edt-backward-string " BACKUP"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
73 "Direction string in mode line to indicate backward movement.")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
74
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
75 (defvar edt-default-map-active nil
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
76 "Non-nil indicates that default EDT emulation key bindings are active.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
77 Nil means user-defined custom bindings are active.")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
78
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
79 (defvar edt-user-map-configured nil
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
80 "Non-nil indicates that user custom EDT key bindings are configured.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
81 This means that an edt-user.el file was found in the user's load-path.")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
82
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
83 (defvar edt-keep-current-page-delimiter nil
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
84 "Non-nil leaves current value of page-delimiter unchanged.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
85 Nil causes the page-delimiter variable to be set to to \"\\f\"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
86 when edt-emulation-on is first invoked. Original value is restored
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
87 when edt-emulation-off is called.")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
88
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
89 (defvar edt-use-EDT-control-key-bindings nil
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
90 "Non-nil causes the control key bindings to be replaced with EDT bindings.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
91 Nil (the default) means EDT control key bindings are not used and the current
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
92 control key bindings are retained for use in the EDT emulation.")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
93
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
94 (defvar edt-word-entities '(?\t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
95 "*Specifies the list of EDT word entity characters.")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
96
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
97 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
98 ;;; Emacs version identifiers - currently referenced by
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
99 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
100 ;;; o edt-emulation-on o edt-load-xkeys
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
101 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
102 (defconst edt-emacs19-p (not (string-lessp emacs-version "19"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
103 "Non-nil if we are running Lucid or GNU Emacs version 19.")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
104
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
105 (defconst edt-lucid-emacs19-p
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
106 (and edt-emacs19-p (string-match "Lucid" emacs-version))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
107 "Non-nil if we are running Lucid Emacs version 19.")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
108
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
109 (defconst edt-gnu-emacs19-p (and edt-emacs19-p (not edt-lucid-emacs19-p))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
110 "Non-nil if we are running GNU Emacs version 19.")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
111
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
112 (defvar edt-xkeys-file nil
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
113 "File mapping X function keys to LK-201 keyboard function and keypad keys.")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
114
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
115 ;;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
116 ;;;; EDT Emulation Commands
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
117 ;;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
118
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
119 ;;; Almost all of EDT's keypad mode commands have equivalent
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
120 ;;; counterparts in Emacs. Some behave the same way in Emacs as they
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
121 ;;; do in EDT, but most do not.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
122 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
123 ;;; The following Emacs functions emulate, where practical, the exact
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
124 ;;; behavior of the corresponding EDT keypad mode commands. In a few
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
125 ;;; cases, the emulation is not exact, but it is close enough for most
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
126 ;;; EDT die-hards.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
127 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
128 ;;; In a very few cases, we chose to use the superior Emacs way of
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
129 ;;; handling things. For example, we do not emulate the EDT SUBS
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
130 ;;; command. Instead, we chose to use the superior Emacs
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
131 ;;; query-replace function.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
132 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
133
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
134 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
135 ;;; PAGE
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
136 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
137 ;;; Emacs uses the regexp assigned to page-delimiter to determine what
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
138 ;;; marks a page break. This is normally "^\f", which causes the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
139 ;;; edt-page command to ignore form feeds not located at the beginning
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
140 ;;; of a line. To emulate the EDT PAGE command exactly,
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
141 ;;; page-delimiter is set to "\f" when EDT emulation is turned on, and
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
142 ;;; restored to its original value when EDT emulation is turned off.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
143 ;;; But this can be overridden if the EDT definition is not desired by
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
144 ;;; placing
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
145 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
146 ;;; (setq edt-keep-current-page-delimiter t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
147 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
148 ;;; in your .emacs file.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
149
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
150 (defun edt-page-forward (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
151 "Move forward to just after next page delimiter.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
152 Accepts a positive prefix argument for the number of page delimiters to move."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
153 (interactive "p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
154 (edt-check-prefix num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
155 (if (eobp)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
156 (error "End of buffer")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
157 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
158 (forward-page num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
159 (if (eobp)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
160 (edt-line-to-bottom-of-window)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
161 (edt-line-to-top-of-window)))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
162
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
163 (defun edt-page-backward (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
164 "Move backward to just after previous page delimiter.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
165 Accepts a positive prefix argument for the number of page delimiters to move."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
166 (interactive "p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
167 (edt-check-prefix num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
168 (if (bobp)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
169 (error "Beginning of buffer")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
170 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
171 (backward-page num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
172 (edt-line-to-top-of-window))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
173
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
174 (defun edt-page (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
175 "Move in current direction to next page delimiter.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
176 Accepts a positive prefix argument for the number of page delimiters to move."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
177 (interactive "p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
178 (if (equal edt-direction-string edt-forward-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
179 (edt-page-forward num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
180 (edt-page-backward num)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
181
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
182 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
183 ;;; SECT
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
184 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
185 ;;; EDT defaults a section size to be 16 lines of its one and only
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
186 ;;; 24-line window. That's two-thirds of the window at a time. The
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
187 ;;; EDT SECT commands moves the cursor, not the window.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
188 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
189 ;;; This emulation of EDT's SECT moves the cursor approximately two-thirds
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
190 ;;; of the current window at a time.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
191
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
192 (defun edt-sect-forward (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
193 "Move cursor forward two-thirds of a window.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
194 Accepts a positive prefix argument for the number of sections to move."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
195 (interactive "p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
196 (edt-check-prefix num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
197 (edt-line-forward (* (* (/ (- (window-height) 1) 3) 2) num)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
198
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
199 (defun edt-sect-backward (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
200 "Move cursor backward two-thirds of a window.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
201 Accepts a positive prefix argument for the number of sections to move."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
202 (interactive "p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
203 (edt-check-prefix num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
204 (edt-line-backward (* (* (/ (- (window-height) 1) 3) 2) num)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
205
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
206 (defun edt-sect (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
207 "Move in current direction a full window.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
208 Accepts a positive prefix argument for the number windows to move."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
209 (interactive "p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
210 (if (equal edt-direction-string edt-forward-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
211 (edt-sect-forward num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
212 (edt-sect-backward num)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
213
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
214 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
215 ;;; BEGINNING OF LINE
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
216 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
217 ;;; EDT's beginning-of-line command is not affected by current
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
218 ;;; direction, for some unknown reason.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
219
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
220 (defun edt-beginning-of-line (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
221 "Move backward to next beginning of line mark.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
222 Accepts a positive prefix argument for the number of BOL marks to move."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
223 (interactive "p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
224 (edt-check-prefix num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
225 (if (bolp)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
226 (forward-line (* -1 num))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
227 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
228 (setq num (1- num))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
229 (forward-line (* -1 num)))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
230
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
231 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
232 ;;; EOL (End of Line)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
233 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
234
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
235 (defun edt-end-of-line-forward (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
236 "Move forward to next end of line mark.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
237 Accepts a positive prefix argument for the number of EOL marks to move."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
238 (interactive "p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
239 (edt-check-prefix num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
240 (forward-char)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
241 (end-of-line num))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
242
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
243 (defun edt-end-of-line-backward (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
244 "Move backward to next end of line mark.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
245 Accepts a positive prefix argument for the number of EOL marks to move."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
246 (interactive "p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
247 (edt-check-prefix num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
248 (end-of-line (1- num)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
249
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
250 (defun edt-end-of-line (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
251 "Move in current direction to next end of line mark.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
252 Accepts a positive prefix argument for the number of EOL marks to move."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
253 (interactive "p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
254 (if (equal edt-direction-string edt-forward-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
255 (edt-end-of-line-forward num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
256 (edt-end-of-line-backward num)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
257
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
258 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
259 ;;; WORD
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
260 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
261 ;;; This one is a tad messy. To emulate EDT's behavior everywhere in
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
262 ;;; the file (beginning of file, end of file, beginning of line, end
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
263 ;;; of line, etc.) it takes a bit of special handling.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
264 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
265 ;;; The variable edt-word-entities contains a list of characters which
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
266 ;;; are to be viewed as distinct words where ever they appear in the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
267 ;;; buffer. This emulates the EDT line mode command SET ENTITY WORD.
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
268
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
269
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
270 (defun edt-one-word-forward ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
271 "Move forward to first character of next word."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
272 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
273 (if (eobp)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
274 (error "End of buffer"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
275 (if (eolp)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
276 (forward-char)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
277 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
278 (if (memq (following-char) edt-word-entities)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
279 (forward-char)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
280 (while (and
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
281 (not (eolp))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
282 (not (eobp))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
283 (not (eq ?\ (char-syntax (following-char))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
284 (not (memq (following-char) edt-word-entities)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
285 (forward-char)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
286 (while (and
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
287 (not (eolp))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
288 (not (eobp))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
289 (eq ?\ (char-syntax (following-char)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
290 (not (memq (following-char) edt-word-entities)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
291 (forward-char)))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
292
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
293 (defun edt-one-word-backward ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
294 "Move backward to first character of previous word."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
295 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
296 (if (bobp)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
297 (error "Beginning of buffer"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
298 (if (bolp)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
299 (backward-char)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
300 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
301 (backward-char)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
302 (while (and
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
303 (not (bolp))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
304 (not (bobp))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
305 (eq ?\ (char-syntax (following-char)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
306 (not (memq (following-char) edt-word-entities)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
307 (backward-char))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
308 (if (not (memq (following-char) edt-word-entities))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
309 (while (and
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
310 (not (bolp))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
311 (not (bobp))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
312 (not (eq ?\ (char-syntax (preceding-char))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
313 (not (memq (preceding-char) edt-word-entities)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
314 (backward-char))))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
315
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
316 (defun edt-word-forward (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
317 "Move forward to first character of next word.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
318 Accepts a positive prefix argument for the number of words to move."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
319 (interactive "p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
320 (edt-check-prefix num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
321 (while (> num 0)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
322 (edt-one-word-forward)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
323 (setq num (1- num))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
324
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
325 (defun edt-word-backward (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
326 "Move backward to first character of previous word.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
327 Accepts a positive prefix argument for the number of words to move."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
328 (interactive "p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
329 (edt-check-prefix num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
330 (while (> num 0)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
331 (edt-one-word-backward)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
332 (setq num (1- num))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
333
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
334 (defun edt-word (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
335 "Move in current direction to first character of next word.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
336 Accepts a positive prefix argument for the number of words to move."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
337 (interactive "p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
338 (if (equal edt-direction-string edt-forward-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
339 (edt-word-forward num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
340 (edt-word-backward num)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
341
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
342 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
343 ;;; CHAR
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
344 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
345
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
346 (defun edt-character (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
347 "Move in current direction to next character.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
348 Accepts a positive prefix argument for the number of characters to move."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
349 (interactive "p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
350 (edt-check-prefix num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
351 (if (equal edt-direction-string edt-forward-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
352 (forward-char num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
353 (backward-char num)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
354
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
355 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
356 ;;; LINE
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
357 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
358 ;;; When direction is set to BACKUP, LINE behaves just like BEGINNING
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
359 ;;; OF LINE in EDT. So edt-line-backward is not really needed as a
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
360 ;;; separate function.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
361
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
362 (defun edt-line-backward (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
363 "Move backward to next beginning of line mark.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
364 Accepts a positive prefix argument for the number of BOL marks to move."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
365 (interactive "p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
366 (edt-beginning-of-line num))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
367
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
368 (defun edt-line-forward (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
369 "Move forward to next beginning of line mark.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
370 Accepts a positive prefix argument for the number of BOL marks to move."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
371 (interactive "p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
372 (edt-check-prefix num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
373 (forward-line num))
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
374
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
375 (defun edt-line (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
376 "Move in current direction to next beginning of line mark.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
377 Accepts a positive prefix argument for the number of BOL marks to move."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
378 (interactive "p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
379 (if (equal edt-direction-string edt-forward-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
380 (edt-line-forward num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
381 (edt-line-backward num)))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 4
diff changeset
382
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
383 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
384 ;;; TOP
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
385 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
386
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
387 (defun edt-top ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
388 "Move cursor to the beginning of buffer."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
389 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
390 (goto-char (point-min)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
391
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
392 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
393 ;;; BOTTOM
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
394 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
395
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
396 (defun edt-bottom ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
397 "Move cursor to the end of buffer."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
398 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
399 (goto-char (point-max))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
400 (edt-line-to-bottom-of-window))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
401
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
402 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
403 ;;; FIND
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
404 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
405
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
406 (defun edt-find-forward (&optional find)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
407 "Find first occurrence of a string in forward direction and save it."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
408 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
409 (if (not find)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
410 (set 'search-last-string (read-string "Search forward: ")))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
411 (if (search-forward search-last-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
412 (search-backward search-last-string)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
413
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
414 (defun edt-find-backward (&optional find)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
415 "Find first occurrence of a string in the backward direction and save it."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
416 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
417 (if (not find)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
418 (set 'search-last-string (read-string "Search backward: ")))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
419 (search-backward search-last-string))
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
420
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
421 (defun edt-find ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
422 "Find first occurrence of string in current direction and save it."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
423 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
424 (set 'search-last-string (read-string "Search: "))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
425 (if (equal edt-direction-string edt-forward-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
426 (edt-find-forward t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
427 (edt-find-backward t)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
428
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
429
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
430 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
431 ;;; FNDNXT
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
432 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
433
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
434 (defun edt-find-next-forward ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
435 "Find next occurrence of a string in forward direction."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
436 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
437 (forward-char 1)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
438 (if (search-forward search-last-string nil t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
439 (search-backward search-last-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
440 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
441 (backward-char 1)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
442 (error "Search failed: \"%s\"." search-last-string))))
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
443
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
444 (defun edt-find-next-backward ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
445 "Find next occurrence of a string in backward direction."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
446 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
447 (if (eq (search-backward search-last-string nil t) nil)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
448 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
449 (error "Search failed: \"%s\"." search-last-string))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
450
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
451 (defun edt-find-next ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
452 "Find next occurrence of a string in current direction."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
453 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
454 (if (equal edt-direction-string edt-forward-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
455 (edt-find-next-forward)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
456 (edt-find-next-backward)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
457
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
458 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
459 ;;; APPEND
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
460 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
461
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
462 (defun edt-append ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
463 "Append this kill region to last killed region."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
464 (interactive "*")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
465 (edt-check-selection)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
466 (append-next-kill)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
467 (kill-region (mark) (point))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
468 (message "Selected text APPENDED to kill ring"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
469
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
470 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
471 ;;; DEL L
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
472 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
473
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
474 (defun edt-delete-line (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
475 "Delete from cursor up to and including the end of line mark.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
476 Accepts a positive prefix argument for the number of lines to delete."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
477 (interactive "*p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
478 (edt-check-prefix num)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 (let ((beg (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 (forward-line num)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 (if (not (eq (preceding-char) ?\n))
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
482 (insert "\n"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 (setq edt-last-deleted-lines
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
484 (buffer-substring beg (point)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 (delete-region beg (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
487 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
488 ;;; DEL EOL
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
489 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
490
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
491 (defun edt-delete-to-end-of-line (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
492 "Delete from cursor up to but excluding the end of line mark.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
493 Accepts a positive prefix argument for the number of lines to delete."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
494 (interactive "*p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
495 (edt-check-prefix num)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 (let ((beg (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 (forward-char 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 (end-of-line num)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 (setq edt-last-deleted-lines
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
500 (buffer-substring beg (point)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 (delete-region beg (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
503 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
504 ;;; SELECT
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
505 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
506
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
507 (defun edt-select-mode (arg)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
508 "Turn EDT select mode off if ARG is nil; otherwise, turn EDT select mode on.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
509 In select mode, selected text is highlighted."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
510 (if arg
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
511 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
512 (make-local-variable 'edt-select-mode)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
513 (setq edt-select-mode 'edt-select-mode-text)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
514 (setq rect-start-point (window-point)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
515 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
516 (kill-local-variable 'edt-select-mode)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
517 (force-mode-line-update))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
518
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
519 (defun edt-select ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
520 "Set mark at cursor and start text selection."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
521 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
522 (set-mark-command nil))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
523
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
524 (defun edt-reset ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
525 "Cancel text selection."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
526 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
527 (deactivate-mark))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
528
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
529 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
530 ;;; CUT
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
531 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
532
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
533 (defun edt-cut ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
534 "Deletes selected text but copies to kill ring."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
535 (interactive "*")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
536 (edt-check-selection)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
537 (kill-region (mark) (point))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
538 (message "Selected text CUT to kill ring"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
539
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
540 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
541 ;;; DELETE TO BEGINNING OF LINE
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
542 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
543
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
544 (defun edt-delete-to-beginning-of-line (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
545 "Delete from cursor to beginning of line.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
546 Accepts a positive prefix argument for the number of lines to delete."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
547 (interactive "*p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
548 (edt-check-prefix num)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 (let ((beg (point)))
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
550 (edt-beginning-of-line num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
551 (setq edt-last-deleted-lines
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
552 (buffer-substring (point) beg))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 (delete-region beg (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
555 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
556 ;;; DEL W
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
557 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
558
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
559 (defun edt-delete-word (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
560 "Delete from cursor up to but excluding first character of next word.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
561 Accepts a positive prefix argument for the number of words to delete."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
562 (interactive "*p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
563 (edt-check-prefix num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
564 (let ((beg (point)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
565 (edt-word-forward num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
566 (setq edt-last-deleted-words (buffer-substring beg (point)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
567 (delete-region beg (point))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
568
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
569 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
570 ;;; DELETE TO BEGINNING OF WORD
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
571 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
572
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
573 (defun edt-delete-to-beginning-of-word (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
574 "Delete from cursor to beginning of word.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
575 Accepts a positive prefix argument for the number of words to delete."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
576 (interactive "*p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
577 (edt-check-prefix num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
578 (let ((beg (point)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
579 (edt-word-backward num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
580 (setq edt-last-deleted-words (buffer-substring (point) beg))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
581 (delete-region beg (point))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
582
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
583 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
584 ;;; DEL C
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
585 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
586
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
587 (defun edt-delete-character (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
588 "Delete character under cursor.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
589 Accepts a positive prefix argument for the number of characters to delete."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
590 (interactive "*p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
591 (edt-check-prefix num)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 (setq edt-last-deleted-chars
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
593 (buffer-substring (point) (min (point-max) (+ (point) num))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 (delete-region (point) (min (point-max) (+ (point) num))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
596 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
597 ;;; DELETE CHAR
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
598 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
599
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
600 (defun edt-delete-previous-character (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
601 "Delete character in front of cursor.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
602 Accepts a positive prefix argument for the number of characters to delete."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
603 (interactive "*p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
604 (edt-check-prefix num)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 (setq edt-last-deleted-chars
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
606 (buffer-substring (max (point-min) (- (point) num)) (point)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 (delete-region (max (point-min) (- (point) num)) (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
609 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
610 ;;; UND L
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
611 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
612
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
613 (defun edt-undelete-line ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
614 "Undelete previous deleted line(s)."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
615 (interactive "*")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
616 (point-to-register 1)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
617 (insert edt-last-deleted-lines)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
618 (register-to-point 1))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
619
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
620 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
621 ;;; UND W
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
622 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
623
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
624 (defun edt-undelete-word ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
625 "Undelete previous deleted word(s)."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
626 (interactive "*")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
627 (point-to-register 1)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
628 (insert edt-last-deleted-words)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
629 (register-to-point 1))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
630
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
631 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
632 ;;; UND C
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
633 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
634
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
635 (defun edt-undelete-character ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
636 "Undelete previous deleted character(s)."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
637 (interactive "*")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
638 (point-to-register 1)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
639 (insert edt-last-deleted-chars)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
640 (register-to-point 1))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
641
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
642 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
643 ;;; REPLACE
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
644 ;;;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
646 (defun edt-replace ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
647 "Replace marked section with last CUT (killed) text."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
648 (interactive "*")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
649 (exchange-point-and-mark)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
650 (let ((beg (point)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
651 (exchange-point-and-mark)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
652 (delete-region beg (point)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
653 (yank))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
654
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
655 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
656 ;;; ADVANCE
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
657 ;;;
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
658
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
659 (defun edt-advance ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
660 "Set movement direction forward.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
661 Also, execute command specified if in Minibuffer."
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
662 (interactive)
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
663 (setq edt-direction-string edt-forward-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
664 (force-mode-line-update)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
665 (if (string-equal " *Minibuf"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
666 (substring (buffer-name) 0 (min (length (buffer-name)) 9)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
667 (exit-minibuffer)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
668
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
669 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
670 ;;; BACKUP
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
671 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
672
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
673 (defun edt-backup ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
674 "Set movement direction backward.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
675 Also, execute command specified if in Minibuffer."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
676 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
677 (setq edt-direction-string edt-backward-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
678 (force-mode-line-update)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
679 (if (string-equal " *Minibuf"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
680 (substring (buffer-name) 0 (min (length (buffer-name)) 9)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
681 (exit-minibuffer)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
682
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
683 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
684 ;;; CHNGCASE
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
685 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
686 ;; This function is based upon Jeff Kowalski's case-flip function in his
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
687 ;; tpu.el.
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
688
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
689 (defun edt-change-case (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
690 "Change the case of specified characters.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
691 If text selection IS active, then characters between the cursor and mark are
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
692 changed. If text selection is NOT active, there are two cases. First, if the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
693 current direction is ADVANCE, then the prefix number of character(s) under and
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
694 following cursor are changed. Second, if the current direction is BACKUP, then
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
695 the prefix number of character(s) before the cursor are changed. Accepts a
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
696 positive prefix for the number of characters to change, but the prefix is
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
697 ignored if text selection is active."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
698 (interactive "*p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
699 (edt-check-prefix num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
700 (if edt-select-mode
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
701 (let ((end (max (mark) (point)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
702 (point-save (point)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
703 (goto-char (min (point) (mark)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
704 (while (not (eq (point) end))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
705 (funcall (if (<= ?a (following-char))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
706 'upcase-region 'downcase-region)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
707 (point) (1+ (point)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
708 (forward-char 1))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
709 (goto-char point-save))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
710 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
711 (if (string= edt-direction-string edt-backward-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
712 (backward-char num))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
713 (while (> num 0)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
714 (funcall (if (<= ?a (following-char))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
715 'upcase-region 'downcase-region)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
716 (point) (1+ (point)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
717 (forward-char 1)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
718 (setq num (1- num))))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
719
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
720 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
721 ;;; DEFINE KEY
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
722 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
723
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
724 (defun edt-define-key ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
725 "Assign an interactively-callable function to a specified key sequence.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
726 The current key definition is saved in edt-last-replaced-key-definition.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
727 Use edt-restore-key to restore last replaced key definition."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
728 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
729 (let (edt-function
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
730 edt-key-definition-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
731 (setq edt-key-definition-string
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
732 (read-key-sequence "Press the key to be defined: "))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
733 (if (string-equal "\C-m" edt-key-definition-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
734 (message "Key not defined")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
735 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
736 (setq edt-function (read-command "Enter command name: "))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
737 (if (string-equal "" edt-function)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
738 (message "Key not defined")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
739 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
740 (setq edt-last-replaced-key-definition
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
741 (lookup-key (current-global-map) edt-key-definition-string))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
742 (define-key (current-global-map)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
743 edt-key-definition-string edt-function)))))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
744
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
745 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
746 ;;; FORM FEED INSERT
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
747 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
748
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
749 (defun edt-form-feed-insert (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
750 "Insert form feed character at cursor position.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
751 Accepts a positive prefix argument for the number of form feeds to insert."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
752 (interactive "*p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
753 (edt-check-prefix num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
754 (while (> num 0)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
755 (insert ?\f)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
756 (setq num (1- num))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
758 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
759 ;;; TAB INSERT
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
760 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
761
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
762 (defun edt-tab-insert (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
763 "Insert tab character at cursor position.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
764 Accepts a positive prefix argument for the number of tabs to insert."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
765 (interactive "*p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
766 (edt-check-prefix num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
767 (while (> num 0)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
768 (insert ?\t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
769 (setq num (1- num))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
770
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
771 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
772 ;;; Check Prefix
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
773 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
774
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
775 (defun edt-check-prefix (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
776 "Indicate error if prefix is not positive."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
777 (if (<= num 0)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
778 (error "Prefix must be positive")))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
779
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
780 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
781 ;;; Check Selection
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
782 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
783
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
784 (defun edt-check-selection ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
785 "Indicate error if EDT selection is not active."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
786 (if (not edt-select-mode)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
787 (error "Selection NOT active")))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
788
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
789 ;;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
790 ;;;; ENHANCEMENTS AND ADDITIONS FOR EDT KEYPAD MODE
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
791 ;;;;
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
792
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
793 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
794 ;;; Several enhancements and additions to EDT keypad mode commands are
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
795 ;;; provided here. Some of these have been motivated by similar
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
796 ;;; TPU/EVE and EVE-Plus commands. Others are new.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
797
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
798 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
799 ;;; CHANGE DIRECTION
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
800 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
801
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
802 (defun edt-change-direction ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
803 "Toggle movement direction."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
804 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
805 (if (equal edt-direction-string edt-forward-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
806 (edt-backup)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
807 (edt-advance)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
808
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
809 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
810 ;;; TOGGLE SELECT
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
811 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
812
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
813 (defun edt-toggle-select ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
814 "Toggle to start (or cancel) text selection."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
815 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
816 (if edt-select-mode
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
817 (edt-reset)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
818 (edt-select)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
819
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
820 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
821 ;;; SENTENCE
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
822 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
823
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
824 (defun edt-sentence-forward (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
825 "Move forward to start of next sentence.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
826 Accepts a positive prefix argument for the number of sentences to move."
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 4
diff changeset
827 (interactive "p")
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
828 (edt-check-prefix num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
829 (if (eobp)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
830 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
831 (error "End of buffer"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
832 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
833 (forward-sentence num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
834 (edt-one-word-forward))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
836 (defun edt-sentence-backward (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
837 "Move backward to next sentence beginning.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
838 Accepts a positive prefix argument for the number of sentences to move."
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 4
diff changeset
839 (interactive "p")
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
840 (edt-check-prefix num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
841 (if (eobp)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
842 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
843 (error "End of buffer"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
844 (backward-sentence num)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
846 (defun edt-sentence (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
847 "Move in current direction to next sentence.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
848 Accepts a positive prefix argument for the number of sentences to move."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849 (interactive "p")
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
850 (if (equal edt-direction-string edt-forward-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
851 (edt-sentence-forward num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
852 (edt-sentence-backward num)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
854 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
855 ;;; PARAGRAPH
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
856 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
857
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
858 (defun edt-paragraph-forward (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
859 "Move forward to beginning of paragraph.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
860 Accepts a positive prefix argument for the number of paragraphs to move."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 (interactive "p")
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
862 (edt-check-prefix num)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863 (while (> num 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864 (next-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865 (forward-paragraph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
866 (previous-line 1)
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
867 (if (eolp)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
868 (next-line 1))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869 (setq num (1- num))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
871 (defun edt-paragraph-backward (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
872 "Move backward to beginning of paragraph.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
873 Accepts a positive prefix argument for the number of paragraphs to move."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874 (interactive "p")
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
875 (edt-check-prefix num)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876 (while (> num 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877 (backward-paragraph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878 (previous-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879 (if (eolp) (next-line 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 (setq num (1- num))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
882 (defun edt-paragraph (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
883 "Move in current direction to next paragraph.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
884 Accepts a positive prefix argument for the number of paragraph to move."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
885 (interactive "p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
886 (if (equal edt-direction-string edt-forward-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
887 (edt-paragraph-forward num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
888 (edt-paragraph-backward num)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
890 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
891 ;;; RESTORE KEY
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
892 ;;;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
894 (defun edt-restore-key ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
895 "Restore last replaced key definition.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
896 Definition is stored in edt-last-replaced-key-definition."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
897 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
898 (if edt-last-replaced-key-definition
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
899 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
900 (let (edt-key-definition-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
901 (set 'edt-key-definition-string
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
902 (read-key-sequence "Press the key to be restored: "))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
903 (if (string-equal "\C-m" edt-key-definition-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
904 (message "Key not restored")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
905 (define-key (current-global-map)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
906 edt-key-definition-string edt-last-replaced-key-definition))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
907 (error "No replaced key definition to restore!")))
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
908
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
909 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
910 ;;; WINDOW TOP
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
911 ;;;
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
912
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
913 (defun edt-window-top ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
914 "Move the cursor to the top of the window."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
915 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
916 (let ((start-column (current-column)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
917 (move-to-window-line 0)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
918 (move-to-column start-column)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
919
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
920 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
921 ;;; WINDOW BOTTOM
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
922 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
923
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
924 (defun edt-window-bottom ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
925 "Move the cursor to the bottom of the window."
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
926 (interactive)
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
927 (let ((start-column (current-column)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
928 (move-to-window-line (- (window-height) 2))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
929 (move-to-column start-column)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
930
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
931 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
932 ;;; SCROLL WINDOW LINE
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
933 ;;;
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
934
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
935 (defun edt-scroll-window-forward-line ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
936 "Move window forward one line leaving cursor at position in window."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
937 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
938 (scroll-up 1))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
939
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
940 (defun edt-scroll-window-backward-line ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
941 "Move window backward one line leaving cursor at position in window."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
942 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
943 (scroll-down 1))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
944
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
945 (defun edt-scroll-line ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
946 "Move window one line in current direction."
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 4
diff changeset
947 (interactive)
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
948 (if (equal edt-direction-string edt-forward-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
949 (edt-scroll-window-forward-line)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
950 (edt-scroll-window-backward-line)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
951
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
952 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
953 ;;; SCROLL WINDOW
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
954 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
955 ;;; Scroll a window (less one line) at a time. Leave cursor in center of
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
956 ;;; window.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
957
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
958 (defun edt-scroll-window-forward (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
959 "Scroll forward one window in buffer, less one line.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
960 Accepts a positive prefix argument for the number of windows to move."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
961 (interactive "p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
962 (edt-check-prefix num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
963 (scroll-up (- (* (window-height) num) 2))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
964 (edt-line-forward (/ (- (window-height) 1) 2)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
966 (defun edt-scroll-window-backward (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
967 "Scroll backward one window in buffer, less one line.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
968 Accepts a positive prefix argument for the number of windows to move."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
969 (interactive "p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
970 (edt-check-prefix num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
971 (scroll-down (- (* (window-height) num) 2))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
972 (edt-line-backward (/ (- (window-height) 1) 2)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
973
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
974 (defun edt-scroll-window (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
975 "Scroll one window in buffer, less one line, in current direction.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
976 Accepts a positive prefix argument for the number windows to move."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
977 (interactive "p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
978 (if (equal edt-direction-string edt-forward-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
979 (edt-scroll-window-forward num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
980 (edt-scroll-window-backward num)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
981
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
982 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
983 ;;; LINE TO BOTTOM OF WINDOW
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
984 ;;;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986 (defun edt-line-to-bottom-of-window ()
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
987 "Move the current line to the bottom of the window."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989 (recenter -1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
991 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
992 ;;; LINE TO TOP OF WINDOW
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
993 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
994
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
995 (defun edt-line-to-top-of-window ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
996 "Move the current line to the top of the window."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
997 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
998 (recenter 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
999
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1000 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1001 ;;; LINE TO MIDDLE OF WINDOW
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1002 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1003
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1004 (defun edt-line-to-middle-of-window ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1005 "Move window so line with cursor is in the middle of the window."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1006 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1007 (recenter '(4)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1008
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1009 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1010 ;;; GOTO PERCENTAGE
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1011 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1012
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1013 (defun edt-goto-percentage (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1014 "Move to specified percentage in buffer from top of buffer."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1015 (interactive "NGoto-percentage: ")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1016 (if (or (> num 100) (< num 0))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1017 (error "Percentage %d out of range 0 < percent < 100" num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1018 (goto-char (/ (* (point-max) num) 100))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1019
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1020 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1021 ;;; FILL REGION
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1022 ;;;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1023
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1024 (defun edt-fill-region ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1025 "Fill selected text."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1026 (interactive "*")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1027 (edt-check-selection)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1028 (fill-region (point) (mark)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1029
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1030 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1031 ;;; INDENT OR FILL REGION
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1032 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1033
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1034 (defun edt-indent-or-fill-region ()
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1035 "Fill region in text modes, indent region in programming language modes."
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1036 (interactive "*")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1037 (if (string= paragraph-start "$\\|\f")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1038 (indent-region (point) (mark) nil)
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1039 (fill-region (point) (mark))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1040
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1041 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1042 ;;; MARK SECTION WISELY
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1043 ;;;
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
1044
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1045 (defun edt-mark-section-wisely ()
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1046 "Mark the section in a manner consistent with the major-mode.
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1047 Uses mark-defun for emacs-lisp and lisp,
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1048 mark-c-function for C,
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1049 mark-fortran-subsystem for fortran,
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1050 and mark-paragraph for other modes."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1051 (interactive)
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1052 (if edt-select-mode
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1053 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1054 (edt-reset))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1055 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1056 (cond ((or (eq major-mode 'emacs-lisp-mode)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1057 (eq major-mode 'lisp-mode))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1058 (mark-defun)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1059 (message "Lisp defun selected"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1060 ((eq major-mode 'c-mode)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1061 (mark-c-function)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1062 (message "C function selected"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1063 ((eq major-mode 'fortran-mode)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1064 (mark-fortran-subprogram)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1065 (message "Fortran subprogram selected"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1066 (t (mark-paragraph)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1067 (message "Paragraph selected"))))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1068
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1069 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1070 ;;; COPY
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1071 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1072
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1073 (defun edt-copy ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1074 "Copy selected region to kill ring, but don't delete it!"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1075 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1076 (edt-check-selection)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1077 (copy-region-as-kill (mark) (point))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1078 (edt-reset)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1079 (message "Selected text COPIED to kill ring"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1080
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1081 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1082 ;;; CUT or COPY
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1083 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1084
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1085 (defun edt-cut-or-copy ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1086 "Cuts (or copies) selected text to kill ring.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1087 Cuts selected text if buffer-read-only is nil.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1088 Copies selected text if buffer-read-only is t."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1089 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1090 (if buffer-read-only
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1091 (edt-copy)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1092 (edt-cut)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1093
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1094 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1095 ;;; DELETE ENTIRE LINE
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1096 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1097
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1098 (defun edt-delete-entire-line ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1099 "Delete entire line regardless of cursor position in the line."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1100 (interactive "*")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1101 (beginning-of-line)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1102 (edt-delete-line 1))
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
1103
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1104 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1105 ;;; DUPLICATE LINE
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1106 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1107
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1108 (defun edt-duplicate-line (num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1109 "Duplicate a line of text.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1110 Accepts a positive prefix argument for the number times to duplicate the line."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1111 (interactive "*p")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1112 (edt-check-prefix num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1113 (let ((old-column (current-column))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1114 (count num))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1115 (edt-delete-entire-line)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1116 (edt-undelete-line)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1117 (while (> count 0)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1118 (edt-undelete-line)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1119 (setq count (1- count)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1120 (edt-line-forward num)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1121 (move-to-column old-column)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1122
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1123 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1124 ;;; DUPLICATE WORD
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1125 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1126
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1127 (defun edt-duplicate-word()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1128 "Duplicate word (or rest of word) found directly above cursor, if any."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1129 (interactive "*")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1130 (let ((start (point))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1131 (start-column (current-column)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1132 (forward-line -1)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1133 (move-to-column start-column)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1134 (if (and (not (equal start (point)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1135 (not (eolp)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1136 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1137 (if (and (equal ?\t (preceding-char))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1138 (< start-column (current-column)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1139 (backward-char))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1140 (let ((beg (point)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1141 (edt-one-word-forward)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1142 (setq edt-last-copied-word (buffer-substring beg (point))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1143 (forward-line)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1144 (move-to-column start-column)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1145 (insert edt-last-copied-word))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1146 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1147 (if (not (equal start (point)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1148 (forward-line))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1149 (move-to-column start-column)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1150 (error "Nothing to duplicate!")))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1151
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1152 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1153 ;;; KEY NOT ASSIGNED
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1154 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1155
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1156 (defun edt-key-not-assigned ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1157 "Displays message that key has not been assigned to a function."
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
1158 (interactive)
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1159 (error "Key not assigned"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1160
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1161 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1162 ;;; TOGGLE CAPITALIZATION OF WORD
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1163 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1164
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1165 (defun edt-toggle-capitalization-of-word ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1166 "Toggle the capitalization of the current word and move forward to next."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1167 (interactive "*")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1168 (edt-one-word-forward)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1169 (edt-one-word-backward)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1170 (edt-change-case 1)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1171 (edt-one-word-backward)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1172 (edt-one-word-forward))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1173
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1174 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1175 ;;; ELIMINATE ALL TABS
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1176 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1177
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1178 (defun edt-eliminate-all-tabs ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1179 "Convert all tabs to spaces in the entire buffer."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1180 (interactive "*")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1181 (untabify (point-min) (point-max))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1182 (message "TABS converted to SPACES"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1183
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1184 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1185 ;;; DISPLAY THE TIME
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1186 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1187
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1188 (defun edt-display-the-time ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1189 "Display the current time."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1190 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1191 (set 'time-string (current-time-string))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1192 (message "%s" time-string))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1193
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1194 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1195 ;;; LEARN
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1196 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1197
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1198 (defun edt-learn ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1199 "Learn a sequence of key strokes to bind to a key."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1200 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1201 (if (eq defining-kbd-macro t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1202 (edt-remember)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1203 (start-kbd-macro nil)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1204
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1205 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1206 ;;; REMEMBER
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1207 ;;;
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
1208
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1209 (defun edt-remember ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1210 "Store the sequence of key strokes started by edt-learn to a key."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1211 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1212 (if (eq defining-kbd-macro nil)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1213 (error "Nothing to remember!")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1214 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1215 (end-kbd-macro nil)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1216 (let (edt-key-definition-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1217 (set 'edt-key-definition-string
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1218 (read-key-sequence "Enter key for binding: "))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1219 (if (string-equal "\C-m" edt-key-definition-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1220 (message "Key sequence not remembered")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1221 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1222 (set 'edt-learn-macro-count (+ edt-learn-macro-count 1))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1223 (setq edt-last-replaced-key-definition
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1224 (lookup-key (current-global-map)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1225 edt-key-definition-string))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1226 (define-key (current-global-map) edt-key-definition-string
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1227 (name-last-kbd-macro
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1228 (intern (concat "last-learned-sequence-"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1229 (int-to-string edt-learn-macro-count)))))))))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1230
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1231 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1232 ;;; EXIT
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1233 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1234
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1235 (defun edt-exit ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1236 "Save current buffer, ask to save other buffers, and then exit Emacs."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1237 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1238 (save-buffer)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1239 (save-buffers-kill-emacs))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1240
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1241 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1242 ;;; QUIT
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1243 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1244
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1245 (defun edt-quit ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1246 "Quit Emacs without saving changes."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1247 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1248 (kill-emacs))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1249
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1250 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1251 ;;; SPLIT WINDOW
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1252 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1253
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1254 (defun edt-split-window ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1255 "Split current window and place cursor in the new window."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1256 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1257 (split-window)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1258 (other-window 1))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1259
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1260 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1261 ;;; COPY RECTANGLE
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1262 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1263
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1264 (defun edt-copy-rectangle ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1265 "Copy a rectangle of text between mark and cursor to register."
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
1266 (interactive)
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1267 (edt-check-selection)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1268 (copy-rectangle-to-register 3 (region-beginning) (region-end) nil)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1269 (edt-reset)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1270 (message "Selected rectangle COPIED to register"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1271
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1272 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1273 ;;; CUT RECTANGLE
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1274 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1275
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1276 (defun edt-cut-rectangle-overstrike-mode ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1277 "Cut a rectangle of text between mark and cursor to register.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1278 Replace cut characters with spaces and moving cursor back to
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1279 upper left corner."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1280 (interactive "*")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1281 (edt-check-selection)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1282 (setq edt-rect-start-point (region-beginning))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1283 (picture-clear-rectangle-to-register (region-beginning) (region-end) 3)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1284 (set-window-point (get-buffer-window (window-buffer)) edt-rect-start-point)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1285 (message "Selected rectangle CUT to register"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1286
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1287 (defun edt-cut-rectangle-insert-mode ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1288 "Cut a rectangle of text between mark and cursor to register.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1289 Move cursor back to upper left corner."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1290 (interactive "*")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1291 (edt-check-selection)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1292 (setq edt-rect-start-point (region-beginning))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1293 (picture-clear-rectangle-to-register (region-beginning) (region-end) 3 t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1294 (fixup-whitespace)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1295 (set-window-point (get-buffer-window (window-buffer)) edt-rect-start-point)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1296 (message "Selected rectangle CUT to register"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1297
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1298 (defun edt-cut-rectangle ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1299 "Cut a rectangular region of text to register.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1300 If overwrite mode is active, cut text is replaced with whitespace."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1301 (interactive "*")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1302 (if overwrite-mode
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1303 (edt-cut-rectangle-overstrike-mode)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1304 (edt-cut-rectangle-insert-mode)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1305
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1306 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1307 ;;; PASTE RECTANGLE
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1308 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1309
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1310 (defun edt-paste-rectangle-overstrike-mode ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1311 "Paste a rectangular region of text from register, replacing text at cursor."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1312 (interactive "*")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1313 (picture-yank-rectangle-from-register 3))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1314
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1315 (defun edt-paste-rectangle-insert-mode ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1316 "Paste previously deleted rectangular region, inserting text at cursor."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1317 (interactive "*")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1318 (picture-yank-rectangle-from-register 3 t))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1319
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1320 (defun edt-paste-rectangle ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1321 "Paste a rectangular region of text.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1322 If overwrite mode is active, existing text is replace with text from register."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1323 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1324 (if overwrite-mode
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1325 (edt-paste-rectangle-overstrike-mode)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1326 (edt-paste-rectangle-insert-mode)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1327
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1328 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1329 ;;; DOWNCASE REGION
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1330 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1331
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1332 (defun edt-lowercase ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1333 "Change specified characters to lower case.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1334 If text selection IS active, then characters between the cursor and
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1335 mark are changed. If text selection is NOT active, there are two
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1336 situations. If the current direction is ADVANCE, then the word under
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1337 the cursor is changed to lower case and the cursor is moved to rest at
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1338 the beginning of the next word. If the current direction is BACKUP,
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1339 the word prior to the word under the cursor is changed to lower case
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1340 and the cursor is left to rest at the beginning of that word."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1341 (interactive "*")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1342 (if edt-select-mode
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1343 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1344 (downcase-region (mark) (point)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1345 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1346 ;; Move to beginning of current word.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1347 (if (and
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1348 (not (bobp))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1349 (not (eobp))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1350 (not (bolp))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1351 (not (eolp))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1352 (not (eq ?\ (char-syntax (preceding-char))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1353 (not (memq (preceding-char) edt-word-entities))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1354 (not (memq (following-char) edt-word-entities)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1355 (edt-one-word-backward))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1356 (if (equal edt-direction-string edt-backward-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1357 (edt-one-word-backward))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1358 (let ((beg (point)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1359 (edt-one-word-forward)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1360 (downcase-region beg (point)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1361 (if (equal edt-direction-string edt-backward-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1362 (edt-one-word-backward)))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1363
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1364 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1365 ;;; UPCASE REGION
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1366 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1367
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1368 (defun edt-uppercase ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1369 "Change specified characters to upper case.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1370 If text selection IS active, then characters between the cursor and
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1371 mark are changed. If text selection is NOT active, there are two
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1372 situations. If the current direction is ADVANCE, then the word under
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1373 the cursor is changed to upper case and the cursor is moved to rest at
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1374 the beginning of the next word. If the current direction is BACKUP,
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1375 the word prior to the word under the cursor is changed to upper case
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1376 and the cursor is left to rest at the beginning of that word."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1377 (interactive "*")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1378 (if edt-select-mode
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1379 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1380 (upcase-region (mark) (point)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1381 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1382 ;; Move to beginning of current word.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1383 (if (and
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1384 (not (bobp))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1385 (not (eobp))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1386 (not (bolp))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1387 (not (eolp))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1388 (not (eq ?\ (char-syntax (preceding-char))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1389 (not (memq (preceding-char) edt-word-entities))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1390 (not (memq (following-char) edt-word-entities)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1391 (edt-one-word-backward))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1392 (if (equal edt-direction-string edt-backward-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1393 (edt-one-word-backward))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1394 (let ((beg (point)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1395 (edt-one-word-forward)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1396 (upcase-region beg (point)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1397 (if (equal edt-direction-string edt-backward-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1398 (edt-one-word-backward)))))
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
1399
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1400
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1401 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1402 ;;; INITIALIZATION COMMANDS.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1403 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1404
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1405 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1406 ;;; Emacs version 19 X-windows key definition support
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1407 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1408 (defvar edt-last-answer nil
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1409 "Most recent response to edt-y-or-n-p.")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1410
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1411 (defun edt-y-or-n-p (prompt &optional not-yes)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1412 "Prompt for a y or n answer with positive default.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1413 Optional second argument NOT-YES changes default to negative.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1414 Like emacs y-or-n-p, also accepts space as y and DEL as n."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1415 (message "%s[%s]" prompt (if not-yes "n" "y"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1416 (let ((doit t))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1417 (while doit
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1418 (setq doit nil)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1419 (let ((ans (read-char)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1420 (cond ((or (= ans ?y) (= ans ?Y) (= ans ?\ ))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1421 (setq edt-last-answer t))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1422 ((or (= ans ?n) (= ans ?N) (= ans ?\C-?))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1423 (setq edt-last-answer nil))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1424 ((= ans ?\r) (setq edt-last-answer (not not-yes)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1425 (t
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1426 (setq doit t) (beep)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1427 (message "Please answer y or n. %s[%s]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1428 prompt (if not-yes "n" "y")))))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1429 edt-last-answer)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1430
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1431 (defun edt-load-xkeys (file)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1432 "Load the EDT X-windows key definitions FILE.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1433 If FILE is nil, try to load a default file. The default file names are
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1434 ~/.edt-xemacs-keys for XEmacs, and ~/.edt-gnu-keys for GNU emacs."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1435 (interactive "fX key definition file: ")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1436 (cond (file
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1437 (setq file (expand-file-name file)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1438 (edt-xkeys-file
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1439 (setq file (expand-file-name edt-xkeys-file)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1440 (edt-gnu-emacs19-p
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1441 (setq file (expand-file-name "~/.edt-gnu-keys")))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1442 (edt-lucid-emacs19-p
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1443 (setq file (expand-file-name "~/.edt-xemacs-keys"))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1444 (cond ((file-readable-p file)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1445 (load-file file))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1446 (t
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1447 (switch-to-buffer "*scratch*")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1448 (erase-buffer)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1449 (insert "
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1450
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1451 Ack!! You're running the Enhanced EDT Emulation under X-windows
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1452 without loading an EDT X key definition file. To create an EDT X
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1453 key definition file, run the edt-mapper.el program. But ONLY run
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1454 it from an XEmacs loaded without any of your own customizations
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1455 found in your .emacs file, etc. Some user customization confuse
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1456 the edt-mapper function. To do this, you need to invoke XEmacs
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1457 as follows:
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1458
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1459 xemacs -q -l edt-mapper.el
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1460
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1461 The file edt-mapper.el includes these same directions on how to
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1462 use it! Perhaps it's laying around here someplace. \n ")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1463 (let ((file "edt-mapper.el")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1464 (found nil)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1465 (path nil)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1466 (search-list (append (list (expand-file-name ".")) load-path)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1467 (while (and (not found) search-list)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1468 (setq path (concat (car search-list)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1469 (if (string-match "/$" (car search-list)) "" "/")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1470 file))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1471 (if (and (file-exists-p path) (not (file-directory-p path)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1472 (setq found t))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1473 (setq search-list (cdr search-list)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1474 (cond (found
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1475 (insert (format
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1476 "Ah yes, there it is, in \n\n %s \n\n" path))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1477 (if (edt-y-or-n-p "Do you want to run it now? ")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1478 (load-file path)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1479 (error "EDT Emulation not configured.")))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1480 (t
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1481 (insert "Nope, I can't seem to find it. :-(\n\n")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1482 (sit-for 20)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1483 (error "EDT Emulation not configured.")))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1484
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1485 ;;;###autoload
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1486 (defun edt-emulation-on ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1487 "Turn on EDT Emulation."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1488 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1489 ;; If using MS-DOS, need to load edt-pc.el
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1490 (if (eq system-type 'ms-dos)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1491 (setq edt-term "pc")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1492 (setq edt-term (getenv "TERM")))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1493 ;; All DEC VT series terminals are supported by loading edt-vt100.el
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1494 (if (string-equal "vt" (substring edt-term 0 (min (length edt-term) 2)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1495 (setq edt-term "vt100"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1496 ;; Load EDT terminal specific configuration file.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1497 (let ((term edt-term)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1498 hyphend)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1499 (while (and term
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1500 (not (load (concat "edt-" term) t t)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1501 ;; Strip off last hyphen and what follows, then try again
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1502 (if (setq hyphend (string-match "[-_][^-_]+$" term))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1503 (setq term (substring term 0 hyphend))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1504 (setq term nil)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1505 ;; Override terminal-specific file if running X Windows. X Windows support
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1506 ;; is handled differently in edt-load-xkeys
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1507 (if (eq window-system 'x)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1508 (edt-load-xkeys nil)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1509 (if (null term)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1510 (error "Unable to load EDT terminal specific file for %s" edt-term)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1511 (setq edt-term term))
138
6608ceec7cf8 Import from CVS: tag r20-2b3
cvs
parents: 72
diff changeset
1512 (when (boundp 'transient-mark-mode)
6608ceec7cf8 Import from CVS: tag r20-2b3
cvs
parents: 72
diff changeset
1513 (setq edt-orig-transient-mark-mode transient-mark-mode))
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1514 (add-hook 'activate-mark-hook
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1515 (function
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1516 (lambda ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1517 (edt-select-mode t))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1518 (add-hook 'deactivate-mark-hook
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1519 (function
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1520 (lambda ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1521 (edt-select-mode nil))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1522 (if (load "edt-user" t t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1523 (edt-user-emulation-setup)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1524 (edt-default-emulation-setup)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1525
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1526 (defun edt-emulation-off()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1527 "Select original global key bindings, disabling EDT Emulation."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1528 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1529 (use-global-map global-map)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1530 (if (not edt-keep-current-page-delimiter)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1531 (setq page-delimiter edt-orig-page-delimiter))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1532 (setq edt-direction-string "")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1533 (setq edt-select-mode-text nil)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1534 (edt-reset)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1535 (force-mode-line-update t)
138
6608ceec7cf8 Import from CVS: tag r20-2b3
cvs
parents: 72
diff changeset
1536 (when (boundp 'transient-mark-mode)
6608ceec7cf8 Import from CVS: tag r20-2b3
cvs
parents: 72
diff changeset
1537 (setq transient-mark-mode edt-orig-transient-mark-mode))
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1538 (message "Original key bindings restored; EDT Emulation disabled"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1539
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1540 (defun edt-default-emulation-setup (&optional user-setup)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1541 "Setup emulation of DEC's EDT editor."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1542 ;; Setup default EDT global map by copying global map bindings.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1543 ;; This preserves ESC and C-x prefix bindings and other bindings we
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1544 ;; wish to retain in EDT emulation mode keymaps. It also permits
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1545 ;; customization of these bindings in the EDT global maps without
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1546 ;; disturbing the original bindings in global-map.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1547 (fset 'edt-default-ESC-prefix (copy-keymap 'ESC-prefix))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1548 (setq edt-default-global-map (copy-keymap (current-global-map)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1549 (define-key edt-default-global-map "\e" 'edt-default-ESC-prefix)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1550 (define-prefix-command 'edt-default-gold-map)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1551 (edt-setup-default-bindings)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1552 ;; If terminal has additional function keys, the terminal-specific
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1553 ;; initialization file can assign bindings to them via the optional
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1554 ;; function edt-setup-extra-default-bindings.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1555 (if (fboundp 'edt-setup-extra-default-bindings)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1556 (edt-setup-extra-default-bindings))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1557 ;; Variable needed by edt-learn.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1558 (setq edt-learn-macro-count 0)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1559 ;; Display EDT text selection active within the mode line
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1560 (or (assq 'edt-select-mode minor-mode-alist)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1561 (setq minor-mode-alist
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1562 (cons '(edt-select-mode edt-select-mode) minor-mode-alist)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1563 ;; Display EDT direction of motion within the mode line
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1564 (or (assq 'edt-direction-string minor-mode-alist)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1565 (setq minor-mode-alist
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1566 (cons
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1567 '(edt-direction-string edt-direction-string) minor-mode-alist)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1568 (if user-setup
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1569 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1570 (setq edt-user-map-configured t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1571 (fset 'edt-emulation-on (symbol-function 'edt-select-user-global-map)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1572 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1573 (fset 'edt-emulation-on (symbol-function 'edt-select-default-global-map))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1574 (edt-select-default-global-map))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1575
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1576 (defun edt-user-emulation-setup ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1577 "Setup user custom emulation of DEC's EDT editor."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1578 ;; Initialize EDT default bindings.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1579 (edt-default-emulation-setup t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1580 ;; Setup user EDT global map by copying default EDT global map bindings.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1581 (fset 'edt-user-ESC-prefix (copy-keymap 'edt-default-ESC-prefix))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1582 (setq edt-user-global-map (copy-keymap edt-default-global-map))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1583 (define-key edt-user-global-map "\e" 'edt-user-ESC-prefix)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1584 ;; If terminal has additional function keys, the user's initialization
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1585 ;; file can assign bindings to them via the optional
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1586 ;; function edt-setup-extra-default-bindings.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1587 (define-prefix-command 'edt-user-gold-map)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1588 (fset 'edt-user-gold-map (copy-keymap 'edt-default-gold-map))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1589 (edt-setup-user-bindings)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1590 (edt-select-user-global-map))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1591
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1592 (defun edt-select-default-global-map()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1593 "Select default EDT emulation key bindings."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1594 (interactive)
138
6608ceec7cf8 Import from CVS: tag r20-2b3
cvs
parents: 72
diff changeset
1595 (when (fboundp 'transient-mark-mode)
6608ceec7cf8 Import from CVS: tag r20-2b3
cvs
parents: 72
diff changeset
1596 (transient-mark-mode 1))
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1597 (use-global-map edt-default-global-map)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1598 (if (not edt-keep-current-page-delimiter)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1599 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1600 (setq edt-orig-page-delimiter page-delimiter)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1601 (setq page-delimiter "\f")))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1602 (setq edt-default-map-active t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1603 (edt-advance)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1604 (setq edt-select-mode-text 'edt-select-mode-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1605 (edt-reset)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1606 (message "Default EDT keymap active"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1607
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1608 (defun edt-select-user-global-map()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1609 "Select user EDT emulation custom key bindings."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1610 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1611 (if edt-user-map-configured
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1612 (progn
138
6608ceec7cf8 Import from CVS: tag r20-2b3
cvs
parents: 72
diff changeset
1613 (when (fboundp 'transient-mark-mode)
6608ceec7cf8 Import from CVS: tag r20-2b3
cvs
parents: 72
diff changeset
1614 (transient-mark-mode 1))
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1615 (use-global-map edt-user-global-map)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1616 (if (not edt-keep-current-page-delimiter)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1617 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1618 (setq edt-orig-page-delimiter page-delimiter)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1619 (setq page-delimiter "\f")))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1620 (setq edt-default-map-active nil)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1621 (edt-advance)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1622 (setq edt-select-mode-text 'edt-select-mode-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1623 (edt-reset)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1624 (message "User EDT custom keymap active"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1625 (error "User EDT custom keymap NOT configured!")))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1626
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1627 (defun edt-switch-global-maps ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1628 "Toggle between default EDT keymap and user EDT keymap."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1629 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1630 (if edt-default-map-active
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1631 (edt-select-user-global-map)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1632 (edt-select-default-global-map)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1633
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1634 ;; There are three key binding functions needed: one for standard keys
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1635 ;; (used to bind control keys, primarily), one for Gold sequences of
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1636 ;; standard keys, and one for function keys.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1637
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1638 (defun edt-bind-gold-key (key gold-binding &optional default)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1639 "Binds commands to a gold key sequence in the EDT Emulator."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1640 (if default
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1641 (define-key 'edt-default-gold-map key gold-binding)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1642 (define-key 'edt-user-gold-map key gold-binding)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1643
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1644 (defun edt-bind-standard-key (key gold-binding &optional default)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1645 "Bind commands to a gold key sequence in the default EDT keymap."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1646 (if default
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1647 (define-key edt-default-global-map key gold-binding)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1648 (define-key edt-user-global-map key gold-binding)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1649
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1650 (defun edt-bind-function-key
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1651 (function-key binding gold-binding &optional default)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1652 "Binds function keys in the EDT Emulator."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1653 (catch 'edt-key-not-supported
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1654 (let ((key-vector (cdr (assoc function-key *EDT-keys*))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1655 (if (stringp key-vector)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1656 (throw 'edt-key-not-supported t))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1657 (if (not (null key-vector))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1658 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1659 (if default
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1660 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1661 (define-key edt-default-global-map key-vector binding)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1662 (define-key 'edt-default-gold-map key-vector gold-binding))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1663 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1664 (define-key edt-user-global-map key-vector binding)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1665 (define-key 'edt-user-gold-map key-vector gold-binding))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1666 (error "%s is not a legal function key name" function-key)))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1667
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1668 (defun edt-setup-default-bindings ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1669 "Assigns default EDT Emulation keyboard bindings."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1670
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1671 ;; Function Key Bindings: Regular and GOLD.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1672
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1673 ;; VT100/VT200/VT300 PF1 (GOLD), PF2, PF3, PF4 Keys
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1674 (edt-bind-function-key "PF1" 'edt-default-gold-map 'edt-mark-section-wisely t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1675 (edt-bind-function-key "PF2" 'edt-electric-keypad-help 'describe-function t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1676 (edt-bind-function-key "PF3" 'edt-find-next 'edt-find t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1677 (edt-bind-function-key "PF4" 'edt-delete-line 'edt-undelete-line t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1678
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1679 ;; VT100/VT200/VT300 Arrow Keys
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1680 (edt-bind-function-key "UP" 'previous-line 'edt-window-top t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1681 (edt-bind-function-key "DOWN" 'next-line 'edt-window-bottom t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1682 (edt-bind-function-key "LEFT" 'backward-char 'edt-sentence-backward t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1683 (edt-bind-function-key "RIGHT" 'forward-char 'edt-sentence-forward t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1684
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1685 ;; VT100/VT200/VT300 Keypad Keys
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1686 (edt-bind-function-key "KP0" 'edt-line 'open-line t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1687 (edt-bind-function-key "KP1" 'edt-word 'edt-change-case t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1688 (edt-bind-function-key "KP2" 'edt-end-of-line 'edt-delete-to-end-of-line t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1689 (edt-bind-function-key "KP3" 'edt-character 'quoted-insert t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1690 (edt-bind-function-key "KP4" 'edt-advance 'edt-bottom t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1691 (edt-bind-function-key "KP5" 'edt-backup 'edt-top t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1692 (edt-bind-function-key "KP6" 'edt-cut 'yank t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1693 (edt-bind-function-key "KP7" 'edt-page 'execute-extended-command t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1694 (edt-bind-function-key "KP8" 'edt-sect 'edt-fill-region t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1695 (edt-bind-function-key "KP9" 'edt-append 'edt-replace t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1696 (edt-bind-function-key "KP-" 'edt-delete-word 'edt-undelete-word t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1697 (edt-bind-function-key "KP," 'edt-delete-character 'edt-undelete-character t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1698 (edt-bind-function-key "KPP" 'edt-select 'edt-reset t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1699 (edt-bind-function-key "KPE" 'other-window 'query-replace t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1700
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1701 ;; VT200/VT300 Function Keys
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1702 ;; (F1 through F5, on the VT220, are not programmable, so we skip
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1703 ;; making default bindings to those keys.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1704 (edt-bind-function-key "FIND" 'edt-find-next 'edt-find t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1705 (edt-bind-function-key "INSERT" 'yank 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1706 (edt-bind-function-key "REMOVE" 'edt-cut 'edt-copy t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1707 (edt-bind-function-key "SELECT" 'edt-toggle-select 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1708 (edt-bind-function-key "NEXT" 'edt-sect-forward 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1709 (edt-bind-function-key "PREVIOUS" 'edt-sect-backward 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1710 (edt-bind-function-key "F6" 'edt-key-not-assigned 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1711 (edt-bind-function-key "F7" 'edt-copy-rectangle 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1712 (edt-bind-function-key "F8"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1713 'edt-cut-rectangle-overstrike-mode 'edt-paste-rectangle-overstrike-mode t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1714 (edt-bind-function-key "F9"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1715 'edt-cut-rectangle-insert-mode 'edt-paste-rectangle-insert-mode t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1716 (edt-bind-function-key "F10" 'edt-cut-rectangle 'edt-paste-rectangle t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1717 ;; Under X, the F11 key can be bound. If using a VT-200 or higher terminal,
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1718 ;; the default emacs terminal support causes the VT F11 key to seem as if it
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1719 ;; is an ESC key when in emacs.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1720 (edt-bind-function-key "F11"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1721 'edt-key-not-assigned 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1722 (edt-bind-function-key "F12"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1723 'edt-beginning-of-line 'delete-other-windows t) ;BS
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1724 (edt-bind-function-key "F13"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1725 'edt-delete-to-beginning-of-word 'edt-key-not-assigned t) ;LF
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1726 (edt-bind-function-key "F14" 'edt-key-not-assigned 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1727 (edt-bind-function-key "HELP" 'edt-electric-keypad-help 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1728 (edt-bind-function-key "DO" 'execute-extended-command 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1729 (edt-bind-function-key "F17" 'edt-key-not-assigned 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1730 (edt-bind-function-key "F18" 'edt-key-not-assigned 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1731 (edt-bind-function-key "F19" 'edt-key-not-assigned 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1732 (edt-bind-function-key "F20" 'edt-key-not-assigned 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1733
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1734 ;; Control key bindings: Regular and GOLD
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1735 ;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1736 ;; Standard EDT control key bindings conflict with standard Emacs
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1737 ;; control key bindings. Normally, the standard Emacs control key
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1738 ;; bindings are left unchanged in the default EDT mode. However, if
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1739 ;; the variable edt-use-EDT-control-key-bindings is set to true
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1740 ;; before invoking edt-emulation-on for the first time, then the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1741 ;; standard EDT bindings (with some enhancements) as defined here are
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1742 ;; used, instead.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1743 (if edt-use-EDT-control-key-bindings
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1744 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1745 (edt-bind-standard-key "\C-a" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1746 (edt-bind-standard-key "\C-b" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1747 ;; Leave binding of C-c as original prefix key.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1748 (edt-bind-standard-key "\C-d" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1749 (edt-bind-standard-key "\C-e" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1750 (edt-bind-standard-key "\C-f" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1751 ;; Leave binding of C-g to keyboard-quit
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1752 ; (edt-bind-standard-key "\C-g" 'keyboard-quit t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1753 ;; Standard EDT binding of C-h. To invoke Emacs help, use
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1754 ;; GOLD-C-h instead.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1755 (edt-bind-standard-key "\C-h" 'edt-beginning-of-line t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1756 (edt-bind-standard-key "\C-i" 'edt-tab-insert t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1757 (edt-bind-standard-key "\C-j" 'edt-delete-to-beginning-of-word t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1758 (edt-bind-standard-key "\C-k" 'edt-define-key t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1759 (edt-bind-gold-key "\C-k" 'edt-restore-key t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1760 (edt-bind-standard-key "\C-l" 'edt-form-feed-insert t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1761 ;; Leave binding of C-m to newline.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1762 (edt-bind-standard-key "\C-n" 'edt-set-screen-width-80 t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1763 (edt-bind-standard-key "\C-o" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1764 (edt-bind-standard-key "\C-p" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1765 (edt-bind-standard-key "\C-q" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1766 ;; Leave binding of C-r to isearch-backward.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1767 ;; Leave binding of C-s to isearch-forward.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1768 (edt-bind-standard-key "\C-t" 'edt-display-the-time t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1769 (edt-bind-standard-key "\C-u" 'edt-delete-to-beginning-of-line t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1770 (edt-bind-standard-key "\C-v" 'redraw-display t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1771 (edt-bind-standard-key "\C-w" 'edt-set-screen-width-132 t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1772 ;; Leave binding of C-x as original prefix key.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1773 (edt-bind-standard-key "\C-y" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1774 ; (edt-bind-standard-key "\C-z" 'suspend-emacs t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1775 )
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1776 )
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1777
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1778 ;; GOLD bindings for a few Control keys.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1779 (edt-bind-gold-key "\C-g" 'keyboard-quit t); Just in case.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1780 (edt-bind-gold-key "\C-h" 'help-for-help t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1781 (edt-bind-gold-key [f1] 'help-for-help t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1782 (edt-bind-gold-key [help] 'help-for-help t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1783 (edt-bind-gold-key "\C-\\" 'split-window-vertically t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1784
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1785 ;; GOLD bindings for regular keys.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1786 (edt-bind-gold-key "a" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1787 (edt-bind-gold-key "A" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1788 (edt-bind-gold-key "b" 'buffer-menu t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1789 (edt-bind-gold-key "B" 'buffer-menu t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1790 (edt-bind-gold-key "c" 'compile t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1791 (edt-bind-gold-key "C" 'compile t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1792 (edt-bind-gold-key "d" 'delete-window t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1793 (edt-bind-gold-key "D" 'delete-window t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1794 (edt-bind-gold-key "e" 'edt-exit t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1795 (edt-bind-gold-key "E" 'edt-exit t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1796 (edt-bind-gold-key "f" 'find-file t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1797 (edt-bind-gold-key "F" 'find-file t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1798 (edt-bind-gold-key "g" 'find-file-other-window t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1799 (edt-bind-gold-key "G" 'find-file-other-window t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1800 (edt-bind-gold-key "h" 'edt-electric-keypad-help t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1801 (edt-bind-gold-key "H" 'edt-electric-keypad-help t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1802 (edt-bind-gold-key "i" 'insert-file t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1803 (edt-bind-gold-key "I" 'insert-file t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1804 (edt-bind-gold-key "j" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1805 (edt-bind-gold-key "J" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1806 (edt-bind-gold-key "k" 'edt-toggle-capitalization-of-word t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1807 (edt-bind-gold-key "K" 'edt-toggle-capitalization-of-word t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1808 (edt-bind-gold-key "l" 'edt-lowercase t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1809 (edt-bind-gold-key "L" 'edt-lowercase t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1810 (edt-bind-gold-key "m" 'save-some-buffers t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1811 (edt-bind-gold-key "M" 'save-some-buffers t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1812 (edt-bind-gold-key "n" 'next-error t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1813 (edt-bind-gold-key "N" 'next-error t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1814 (edt-bind-gold-key "o" 'switch-to-buffer-other-window t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1815 (edt-bind-gold-key "O" 'switch-to-buffer-other-window t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1816 (edt-bind-gold-key "p" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1817 (edt-bind-gold-key "P" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1818 (edt-bind-gold-key "q" 'edt-quit t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1819 (edt-bind-gold-key "Q" 'edt-quit t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1820 (edt-bind-gold-key "r" 'revert-buffer t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1821 (edt-bind-gold-key "R" 'revert-buffer t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1822 (edt-bind-gold-key "s" 'save-buffer t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1823 (edt-bind-gold-key "S" 'save-buffer t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1824 (edt-bind-gold-key "t" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1825 (edt-bind-gold-key "T" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1826 (edt-bind-gold-key "u" 'edt-uppercase t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1827 (edt-bind-gold-key "U" 'edt-uppercase t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1828 (edt-bind-gold-key "v" 'find-file-other-window t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1829 (edt-bind-gold-key "V" 'find-file-other-window t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1830 (edt-bind-gold-key "w" 'write-file t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1831 (edt-bind-gold-key "W" 'write-file t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1832 (edt-bind-gold-key "x" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1833 (edt-bind-gold-key "X" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1834 (edt-bind-gold-key "y" 'edt-emulation-off t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1835 (edt-bind-gold-key "Y" 'edt-emulation-off t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1836 (edt-bind-gold-key "z" 'edt-switch-global-maps t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1837 (edt-bind-gold-key "Z" 'edt-switch-global-maps t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1838 (edt-bind-gold-key "1" 'delete-other-windows t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1839 (edt-bind-gold-key "!" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1840 (edt-bind-gold-key "2" 'edt-split-window t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1841 (edt-bind-gold-key "@" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1842 (edt-bind-gold-key "3" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1843 (edt-bind-gold-key "#" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1844 (edt-bind-gold-key "4" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1845 (edt-bind-gold-key "$" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1846 (edt-bind-gold-key "5" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1847 (edt-bind-gold-key "%" 'edt-goto-percentage t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1848 (edt-bind-gold-key "6" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1849 (edt-bind-gold-key "^" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1850 (edt-bind-gold-key "7" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1851 (edt-bind-gold-key "&" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1852 (edt-bind-gold-key "8" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1853 (edt-bind-gold-key "*" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1854 (edt-bind-gold-key "9" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1855 (edt-bind-gold-key "(" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1856 (edt-bind-gold-key "0" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1857 (edt-bind-gold-key ")" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1858 (edt-bind-gold-key " " 'undo t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1859 (edt-bind-gold-key "," 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1860 (edt-bind-gold-key "<" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1861 (edt-bind-gold-key "." 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1862 (edt-bind-gold-key ">" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1863 (edt-bind-gold-key "/" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1864 (edt-bind-gold-key "?" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1865 (edt-bind-gold-key "\\" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1866 (edt-bind-gold-key "|" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1867 (edt-bind-gold-key ";" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1868 (edt-bind-gold-key ":" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1869 (edt-bind-gold-key "'" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1870 (edt-bind-gold-key "\"" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1871 (edt-bind-gold-key "-" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1872 (edt-bind-gold-key "_" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1873 (edt-bind-gold-key "=" 'goto-line t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1874 (edt-bind-gold-key "+" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1875 (edt-bind-gold-key "[" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1876 (edt-bind-gold-key "{" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1877 (edt-bind-gold-key "]" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1878 (edt-bind-gold-key "}" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1879 (edt-bind-gold-key "`" 'what-line t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1880 (edt-bind-gold-key "~" 'edt-key-not-assigned t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1881 )
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1882
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1883 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1884 ;;; DEFAULT EDT KEYPAD HELP
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1885 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1886
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1887 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1888 ;;; Upper case commands in the keypad diagram below indicate that the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1889 ;;; emulation should look and feel very much like EDT. Lower case
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1890 ;;; commands are enhancements and/or additions to the EDT keypad
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1891 ;;; commands or are native Emacs commands.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1892 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1893
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1894 (defun edt-keypad-help ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1895 "
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1896 DEFAULT EDT Keypad Active
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1897
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1898 F7: Copy Rectangle +----------+----------+----------+----------+
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1899 F8: Cut Rect Overstrike |Prev Line |Next Line |Bkwd Char |Frwd Char |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1900 G-F8: Paste Rect Overstrike | (UP) | (DOWN) | (LEFT) | (RIGHT) |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1901 F9: Cut Rect Insert |Window Top|Window Bot|Bkwd Sent |Frwd Sent |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1902 G-F9: Paste Rect Insert +----------+----------+----------+----------+
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1903 F10: Cut Rectangle
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1904 G-F10: Paste Rectangle
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1905 F11: ESC
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1906 F12: Begining of Line +----------+----------+----------+----------+
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1907 G-F12: Delete Other Windows | GOLD | HELP | FNDNXT | DEL L |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1908 F13: Delete to Begin of Word | (PF1) | (PF2) | (PF3) | (PF4) |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1909 HELP: Keypad Help |Mark Wisel|Desc Funct| FIND | UND L |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1910 DO: Execute extended command +----------+----------+----------+----------+
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1911 | PAGE | SECT | APPEND | DEL W |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1912 C-g: Keyboard Quit | (7) | (8) | (9) | (-) |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1913 G-C-g: Keyboard Quit |Ex Ext Cmd|Fill Regio| REPLACE | UND W |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1914 C-h: Beginning of Line +----------+----------+----------+----------+
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1915 G-C-h: Emacs Help | ADVANCE | BACKUP | CUT | DEL C |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1916 C-i: Tab Insert | (4) | (5) | (6) | (,) |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1917 C-j: Delete to Begin of Word | BOTTOM | TOP | Yank | UND C |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1918 C-k: Define Key +----------+----------+----------+----------+
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1919 G-C-k: Restore Key | WORD | EOL | CHAR | Next |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1920 C-l: Form Feed Insert | (1) | (2) | (3) | Window |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1921 C-n: Set Screen Width 80 | CHNGCASE | DEL EOL |Quoted Ins| !
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1922 C-r: Isearch Backward +---------------------+----------+ (ENTER) |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1923 C-s: Isearch Forward | LINE | SELECT | !
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1924 C-t: Display the Time | (0) | (.) | Query |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1925 C-u: Delete to Begin of Line | Open Line | RESET | Replace |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1926 C-v: Redraw Display +---------------------+----------+----------+
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1927 C-w: Set Screen Width 132
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1928 C-z: Suspend Emacs +----------+----------+----------+
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1929 G-C-\\: Split Window | FNDNXT | Yank | CUT |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1930 | (FIND) | (INSERT) | (REMOVE) |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1931 G-b: Buffer Menu | FIND | | COPY |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1932 G-c: Compile +----------+----------+----------+
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1933 G-d: Delete Window |SELECT/RES|SECT BACKW|SECT FORWA|
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1934 G-e: Exit | (SELECT) |(PREVIOUS)| (NEXT) |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1935 G-f: Find File | | | |
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1936 G-g: Find File Other Window +----------+----------+----------+
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1937 G-h: Keypad Help
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1938 G-i: Insert File
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1939 G-k: Toggle Capitalization Word
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1940 G-l: Downcase Region
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1941 G-m: Save Some Buffers
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1942 G-n: Next Error
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1943 G-o: Switch to Next Window
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1944 G-q: Quit
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1945 G-r: Revert File
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1946 G-s: Save Buffer
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1947 G-u: Upcase Region
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1948 G-v: Find File Other Window
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1949 G-w: Write file
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1950 G-y: EDT Emulation OFF
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1951 G-z: Switch to User EDT Key Bindings
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1952 G-1: Delete Other Windows
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1953 G-2: Split Window
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1954 G-%: Go to Percentage
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1955 G- : Undo (GOLD Spacebar)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1956 G-=: Go to Line
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1957 G-`: What line"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1958
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1959 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1960 (describe-function 'edt-keypad-help))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1961
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1962 (defun edt-electric-helpify (fun)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1963 (let ((name "*Help*"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1964 (if (save-window-excursion
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1965 (let* ((p (symbol-function 'print-help-return-message))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1966 (b (get-buffer name))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1967 (m (buffer-modified-p b)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1968 (and b (not (get-buffer-window b))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1969 (setq b nil))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1970 (unwind-protect
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1971 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1972 (message "%s..." (capitalize (symbol-name fun)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1973 (and b
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1974 (save-excursion
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1975 (set-buffer b)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1976 (set-buffer-modified-p t)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1977 (fset 'print-help-return-message 'ignore)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1978 (call-interactively fun)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1979 (and (get-buffer name)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1980 (get-buffer-window (get-buffer name))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1981 (or (not b)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1982 (not (eq b (get-buffer name)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1983 (not (buffer-modified-p b)))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1984 (fset 'print-help-return-message p)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1985 (and b (buffer-name b)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1986 (save-excursion
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1987 (set-buffer b)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1988 (set-buffer-modified-p m))))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1989 (with-electric-help 'delete-other-windows name t))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1990
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1991 (defun edt-electric-keypad-help ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1992 "Display default EDT bindings."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1993 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1994 (edt-electric-helpify 'edt-keypad-help))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1995
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1996 (defun edt-electric-user-keypad-help ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1997 "Display user custom EDT bindings."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1998 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
1999 (edt-electric-helpify 'edt-user-keypad-help))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2000
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2001 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2002 ;;; EDT emulation screen width commands.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2003 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2004 ;; Some terminals require modification of terminal attributes when changing the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2005 ;; number of columns displayed, hence the fboundp tests below. These functions
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2006 ;; are defined in the corresponding terminal specific file, if needed.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2007
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2008 (defun edt-set-screen-width-80 ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2009 "Set screen width to 80 columns."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2010 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2011 (if (fboundp 'edt-set-term-width-80)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2012 (edt-set-term-width-80))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2013 (set-screen-width 80)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2014 (message "Screen width 80"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2015
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2016 (defun edt-set-screen-width-132 ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2017 "Set screen width to 132 columns."
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2018 (interactive)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2019 (if (fboundp 'edt-set-term-width-132)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2020 (edt-set-term-width-132))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2021 (set-screen-width 132)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2022 (message "Screen width 132"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2023
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2024 (provide 'edt)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2025
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
2026 ;;; edt.el ends here