annotate lisp/emulation/edt.el @ 13581:e69e87bdc813

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