Mercurial > emacs
annotate lisp/emulation/edt.el @ 28919:4f53731e6965
*** empty log message ***
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Mon, 15 May 2000 14:54:08 +0000 |
parents | 158d4f0bc094 |
children | 0b78d7b101c2 |
rev | line source |
---|---|
13337 | 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 |
18943 | 5 ;; Author: Kevin Gallagher <kevingal@onramp.net> |
6 ;; Maintainer: Kevin Gallagher <kevingal@onramp.net> | |
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 | 9 ;; This file is part of GNU Emacs. |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
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 | 14 ;; any later version. |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
14169 | 22 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 ;; Boston, MA 02111-1307, USA. | |
57 | 25 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
26 ;;; Usage: |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
27 |
11442 | 28 ;; 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
|
29 |
10689
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
32 ;;; 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
|
33 ;;; 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
|
34 (require 'ehelp) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
35 (require 'picture) |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
793
diff
changeset
|
36 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
37 ;;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
38 ;;;; VARIABLES and CONSTANTS |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
39 ;;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
40 |
57 | 41 (defvar edt-last-deleted-lines "" |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
42 "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
|
43 |
57 | 44 (defvar edt-last-deleted-words "" |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
45 "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
|
46 |
57 | 47 (defvar edt-last-deleted-chars "" |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
48 "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
|
49 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
50 (defvar edt-last-replaced-key-definition "" |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
51 "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
|
52 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
53 (defvar edt-direction-string "" |
11442 | 54 "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
|
55 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
56 (defvar edt-select-mode nil |
11442 | 57 "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
|
58 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
59 (defvar edt-select-mode-text "" |
11442 | 60 "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
|
61 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
62 (defconst edt-select-mode-string " Select" |
11442 | 63 "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
|
64 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
65 (defconst edt-forward-string " ADVANCE" |
11442 | 66 "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
|
67 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
68 (defconst edt-backward-string " BACKUP" |
11442 | 69 "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
|
70 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
71 (defvar edt-default-map-active nil |
11442 | 72 "Non-nil indicates that default EDT emulation key bindings are active. |
73 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
|
74 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
75 (defvar edt-user-map-configured nil |
11442 | 76 "Non-nil indicates that user custom EDT key bindings are configured. |
77 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
|
78 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
79 (defvar edt-keep-current-page-delimiter nil |
11442 | 80 "Non-nil leaves current value of page-delimiter unchanged. |
81 Nil causes the page-delimiter variable to be set to to \"\\f\" | |
82 when edt-emulation-on is first invoked. Original value is restored | |
83 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
|
84 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
85 (defvar edt-use-EDT-control-key-bindings nil |
11442 | 86 "Non-nil causes the control key bindings to be replaced with EDT bindings. |
87 Nil (the default) means EDT control key bindings are not used and the current | |
88 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
|
89 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
90 (defvar edt-word-entities '(?\t) |
11442 | 91 "*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
|
92 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
93 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
94 ;;; Emacs version identifiers - currently referenced by |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
95 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
96 ;;; 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
|
97 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
98 (defconst edt-emacs19-p (not (string-lessp emacs-version "19")) |
11442 | 99 "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
|
100 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
101 (defconst edt-lucid-emacs19-p |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
102 (and edt-emacs19-p (string-match "Lucid" emacs-version)) |
11442 | 103 "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
|
104 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
105 (defconst edt-gnu-emacs19-p (and edt-emacs19-p (not edt-lucid-emacs19-p)) |
11442 | 106 "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
|
107 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
108 (defvar edt-xkeys-file nil |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
109 "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
|
110 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
111 ;;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
112 ;;;; EDT Emulation Commands |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
115 ;;; 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
|
116 ;;; 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
|
117 ;;; 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
|
118 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
119 ;;; 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
|
120 ;;; 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
|
121 ;;; 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
|
122 ;;; EDT die-hards. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
123 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
124 ;;; 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
|
125 ;;; 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
|
126 ;;; 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
|
127 ;;; query-replace function. |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
131 ;;; PAGE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
132 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
133 ;;; 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
|
134 ;;; 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
|
135 ;;; 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
|
136 ;;; 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
|
137 ;;; 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
|
138 ;;; 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
|
139 ;;; 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
|
140 ;;; placing |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
141 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
142 ;;; (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
|
143 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
144 ;;; in your .emacs file. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
145 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
146 (defun edt-page-forward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
147 "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
|
148 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
|
149 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
150 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
151 (if (eobp) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
152 (error "End of buffer") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
153 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
154 (forward-page num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
155 (if (eobp) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
156 (edt-line-to-bottom-of-window) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
157 (edt-line-to-top-of-window))))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
158 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
159 (defun edt-page-backward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
160 "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
|
161 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
|
162 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
163 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
164 (if (bobp) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
165 (error "Beginning of buffer") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
166 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
167 (backward-page num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
168 (edt-line-to-top-of-window)))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
169 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
170 (defun edt-page (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
171 "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
|
172 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
|
173 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
174 (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
|
175 (edt-page-forward num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
176 (edt-page-backward num))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
179 ;;; SECT |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
180 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
181 ;;; 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
|
182 ;;; 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
|
183 ;;; 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
|
184 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
185 ;;; 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
|
186 ;;; 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
|
187 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
188 (defun edt-sect-forward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
189 "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
|
190 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
|
191 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
192 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
193 (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
|
194 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
195 (defun edt-sect-backward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
196 "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
|
197 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
|
198 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
199 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
200 (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
|
201 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
202 (defun edt-sect (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
203 "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
|
204 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
|
205 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
206 (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
|
207 (edt-sect-forward num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
208 (edt-sect-backward num))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
211 ;;; BEGINNING OF LINE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
212 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
213 ;;; 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
|
214 ;;; direction, for some unknown reason. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
215 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
216 (defun edt-beginning-of-line (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
217 "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
|
218 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
|
219 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
220 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
221 (if (bolp) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
222 (forward-line (* -1 num)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
223 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
224 (setq num (1- num)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
225 (forward-line (* -1 num))))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
228 ;;; EOL (End of Line) |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
231 (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
|
232 "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
|
233 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
|
234 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
235 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
236 (forward-char) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
237 (end-of-line num)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
238 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
239 (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
|
240 "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
|
241 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
|
242 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
243 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
244 (end-of-line (1- num))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
245 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
246 (defun edt-end-of-line (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
247 "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
|
248 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
|
249 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
250 (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
|
251 (edt-end-of-line-forward num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
252 (edt-end-of-line-backward num))) |
57 | 253 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
254 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
255 ;;; WORD |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
256 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
257 ;;; 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
|
258 ;;; 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
|
259 ;;; 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
|
260 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
261 ;;; 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
|
262 ;;; 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
|
263 ;;; 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
|
264 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
265 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
266 (defun edt-one-word-forward () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
267 "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
|
268 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
269 (if (eobp) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
270 (error "End of buffer")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
271 (if (eolp) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
272 (forward-char) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
273 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
274 (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
|
275 (forward-char) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
276 (while (and |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
277 (not (eolp)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
278 (not (eobp)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
279 (not (eq ?\ (char-syntax (following-char)))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
280 (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
|
281 (forward-char))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
282 (while (and |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
283 (not (eolp)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
284 (not (eobp)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
285 (eq ?\ (char-syntax (following-char))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
286 (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
|
287 (forward-char))))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
288 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
289 (defun edt-one-word-backward () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
290 "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
|
291 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
292 (if (bobp) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
293 (error "Beginning of buffer")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
294 (if (bolp) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
295 (backward-char) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
296 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
297 (backward-char) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
298 (while (and |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
299 (not (bolp)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
300 (not (bobp)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
301 (eq ?\ (char-syntax (following-char))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
302 (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
|
303 (backward-char)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
304 (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
|
305 (while (and |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
306 (not (bolp)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
307 (not (bobp)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
308 (not (eq ?\ (char-syntax (preceding-char)))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
309 (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
|
310 (backward-char)))))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
311 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
312 (defun edt-word-forward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
313 "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
|
314 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
|
315 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
316 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
317 (while (> num 0) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
318 (edt-one-word-forward) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
319 (setq num (1- num)))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
320 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
321 (defun edt-word-backward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
322 "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
|
323 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
|
324 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
325 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
326 (while (> num 0) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
327 (edt-one-word-backward) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
328 (setq num (1- num)))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
329 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
330 (defun edt-word (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
331 "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
|
332 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
|
333 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
334 (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
|
335 (edt-word-forward num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
336 (edt-word-backward num))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
339 ;;; CHAR |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
342 (defun edt-character (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
343 "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
|
344 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
|
345 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
346 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
347 (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
|
348 (forward-char num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
349 (backward-char num))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
352 ;;; LINE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
353 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
354 ;;; 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
|
355 ;;; 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
|
356 ;;; separate function. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
357 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
358 (defun edt-line-backward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
359 "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
|
360 Accepts a positive prefix argument for the number of BOL marks to move." |
57 | 361 (interactive "p") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
362 (edt-beginning-of-line num)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
363 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
364 (defun edt-line-forward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
365 "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
|
366 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
|
367 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
368 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
369 (forward-line num)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
370 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
371 (defun edt-line (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
372 "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
|
373 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
|
374 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
375 (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
|
376 (edt-line-forward num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
377 (edt-line-backward num))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
380 ;;; TOP |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
383 (defun edt-top () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
384 "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
|
385 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
386 (goto-char (point-min))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
389 ;;; BOTTOM |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
392 (defun edt-bottom () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
393 "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
|
394 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
395 (goto-char (point-max)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
396 (edt-line-to-bottom-of-window)) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
399 ;;; FIND |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
402 (defun edt-find-forward (&optional find) |
13978
2445061c92d4
(edt-find-forward, edt-find-backward, edt-find,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
403 "Find first occurrence 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
|
404 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
405 (if (not find) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
406 (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
|
407 (if (search-forward search-last-string) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
408 (search-backward search-last-string))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
409 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
410 (defun edt-find-backward (&optional find) |
13978
2445061c92d4
(edt-find-forward, edt-find-backward, edt-find,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
411 "Find first occurrence 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
|
412 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
413 (if (not find) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
414 (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
|
415 (search-backward search-last-string)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
416 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
417 (defun edt-find () |
13978
2445061c92d4
(edt-find-forward, edt-find-backward, edt-find,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
418 "Find first occurrence of string in current direction and save it." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
419 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
420 (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
|
421 (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
|
422 (edt-find-forward t) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
423 (edt-find-backward t))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
427 ;;; FNDNXT |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
430 (defun edt-find-next-forward () |
13978
2445061c92d4
(edt-find-forward, edt-find-backward, edt-find,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
431 "Find next occurrence of a string in forward direction." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
432 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
433 (forward-char 1) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
434 (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
|
435 (search-backward search-last-string) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
436 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
437 (backward-char 1) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
438 (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
|
439 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
440 (defun edt-find-next-backward () |
13978
2445061c92d4
(edt-find-forward, edt-find-backward, edt-find,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
441 "Find next occurrence of a string in backward direction." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
442 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
443 (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
|
444 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
445 (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
|
446 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
447 (defun edt-find-next () |
13978
2445061c92d4
(edt-find-forward, edt-find-backward, edt-find,
Karl Heuer <kwzh@gnu.org>
parents:
13337
diff
changeset
|
448 "Find next occurrence of a string in current direction." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
449 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
450 (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
|
451 (edt-find-next-forward) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
452 (edt-find-next-backward))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
455 ;;; APPEND |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
458 (defun edt-append () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
459 "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
|
460 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
461 (edt-check-selection) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
462 (append-next-kill) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
463 (kill-region (mark) (point)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
464 (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
|
465 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
466 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
467 ;;; DEL L |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
470 (defun edt-delete-line (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
471 "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
|
472 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
|
473 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
474 (edt-check-prefix num) |
57 | 475 (let ((beg (point))) |
476 (forward-line num) | |
477 (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
|
478 (insert "\n")) |
57 | 479 (setq edt-last-deleted-lines |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
480 (buffer-substring beg (point))) |
57 | 481 (delete-region beg (point)))) |
482 | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
483 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
484 ;;; DEL EOL |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
487 (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
|
488 "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
|
489 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
|
490 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
491 (edt-check-prefix num) |
57 | 492 (let ((beg (point))) |
493 (forward-char 1) | |
494 (end-of-line num) | |
495 (setq edt-last-deleted-lines | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
496 (buffer-substring beg (point))) |
57 | 497 (delete-region beg (point)))) |
498 | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
499 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
500 ;;; SELECT |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
503 (defun edt-select-mode (arg) |
11442 | 504 "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
|
505 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
|
506 (if arg |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
507 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
508 (make-local-variable 'edt-select-mode) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
509 (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
|
510 (setq rect-start-point (window-point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
511 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
512 (kill-local-variable 'edt-select-mode))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
513 (force-mode-line-update)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
514 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
515 (defun edt-select () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
516 "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
|
517 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
518 (set-mark-command nil)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
519 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
520 (defun edt-reset () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
521 "Cancel text selection." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
522 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
523 (deactivate-mark)) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
526 ;;; CUT |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
529 (defun edt-cut () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
530 "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
|
531 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
532 (edt-check-selection) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
533 (kill-region (mark) (point)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
534 (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
|
535 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
536 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
537 ;;; DELETE TO BEGINNING OF LINE |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
540 (defun edt-delete-to-beginning-of-line (num) |
11442 | 541 "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
|
542 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
|
543 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
544 (edt-check-prefix num) |
57 | 545 (let ((beg (point))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
546 (edt-beginning-of-line num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
547 (setq edt-last-deleted-lines |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
548 (buffer-substring (point) beg)) |
57 | 549 (delete-region beg (point)))) |
550 | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
551 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
552 ;;; DEL W |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
555 (defun edt-delete-word (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
556 "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
|
557 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
|
558 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
559 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
560 (let ((beg (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
561 (edt-word-forward num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
562 (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
|
563 (delete-region beg (point)))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
566 ;;; DELETE TO BEGINNING OF WORD |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
569 (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
|
570 "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
|
571 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
|
572 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
573 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
574 (let ((beg (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
575 (edt-word-backward num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
576 (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
|
577 (delete-region beg (point)))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
580 ;;; DEL C |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
583 (defun edt-delete-character (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
584 "Delete character under cursor. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
585 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
|
586 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
587 (edt-check-prefix num) |
57 | 588 (setq edt-last-deleted-chars |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
589 (buffer-substring (point) (min (point-max) (+ (point) num)))) |
57 | 590 (delete-region (point) (min (point-max) (+ (point) num)))) |
591 | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
592 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
593 ;;; DELETE CHAR |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
596 (defun edt-delete-previous-character (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
597 "Delete character in front of cursor. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
598 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
|
599 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
600 (edt-check-prefix num) |
57 | 601 (setq edt-last-deleted-chars |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
602 (buffer-substring (max (point-min) (- (point) num)) (point))) |
57 | 603 (delete-region (max (point-min) (- (point) num)) (point))) |
604 | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
605 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
606 ;;; UND L |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
609 (defun edt-undelete-line () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
610 "Undelete previous deleted line(s)." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
611 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
612 (point-to-register 1) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
613 (insert edt-last-deleted-lines) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
614 (register-to-point 1)) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
617 ;;; UND W |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
620 (defun edt-undelete-word () |
11442 | 621 "Undelete previous deleted word(s)." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
622 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
623 (point-to-register 1) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
624 (insert edt-last-deleted-words) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
625 (register-to-point 1)) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
628 ;;; UND C |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
631 (defun edt-undelete-character () |
11442 | 632 "Undelete previous deleted character(s)." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
633 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
634 (point-to-register 1) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
635 (insert edt-last-deleted-chars) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
636 (register-to-point 1)) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
639 ;;; REPLACE |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
642 (defun edt-replace () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
643 "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
|
644 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
645 (exchange-point-and-mark) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
646 (let ((beg (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
647 (exchange-point-and-mark) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
648 (delete-region beg (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
649 (yank)) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
652 ;;; ADVANCE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
653 ;;; |
57 | 654 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
655 (defun edt-advance () |
11442 | 656 "Set movement direction forward. |
657 Also, execute command specified if in Minibuffer." | |
57 | 658 (interactive) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
659 (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
|
660 (force-mode-line-update) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
661 (if (string-equal " *Minibuf" |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
662 (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
|
663 (exit-minibuffer))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
666 ;;; BACKUP |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
669 (defun edt-backup () |
11442 | 670 "Set movement direction backward. |
671 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
|
672 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
673 (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
|
674 (force-mode-line-update) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
675 (if (string-equal " *Minibuf" |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
676 (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
|
677 (exit-minibuffer))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
680 ;;; CHNGCASE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
681 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
682 ;; 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
|
683 ;; tpu.el. |
57 | 684 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
685 (defun edt-change-case (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
686 "Change the case of specified characters. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
687 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
|
688 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
|
689 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
|
690 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
|
691 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
|
692 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
|
693 ignored if text selection is active." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
694 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
695 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
696 (if edt-select-mode |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
697 (let ((end (max (mark) (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
698 (point-save (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
699 (goto-char (min (point) (mark))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
700 (while (not (eq (point) end)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
701 (funcall (if (<= ?a (following-char)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
702 'upcase-region 'downcase-region) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
703 (point) (1+ (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
704 (forward-char 1)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
705 (goto-char point-save)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
706 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
707 (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
|
708 (backward-char num)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
709 (while (> num 0) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
710 (funcall (if (<= ?a (following-char)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
711 'upcase-region 'downcase-region) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
712 (point) (1+ (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
713 (forward-char 1) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
714 (setq num (1- num)))))) |
57 | 715 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
716 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
717 ;;; DEFINE KEY |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
720 (defun edt-define-key () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
721 "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
|
722 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
|
723 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
|
724 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
725 (let (edt-function |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
726 edt-key-definition-string) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
727 (setq edt-key-definition-string |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
728 (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
|
729 (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
|
730 (message "Key not defined") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
731 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
732 (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
|
733 (if (string-equal "" edt-function) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
734 (message "Key not defined") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
735 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
736 (setq edt-last-replaced-key-definition |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
737 (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
|
738 (define-key (current-global-map) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
739 edt-key-definition-string edt-function))))))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
742 ;;; FORM FEED INSERT |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
745 (defun edt-form-feed-insert (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
746 "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
|
747 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
|
748 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
749 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
750 (while (> num 0) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
751 (insert ?\f) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
752 (setq num (1- num)))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
755 ;;; TAB INSERT |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
758 (defun edt-tab-insert (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
759 "Insert tab character at cursor position. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
760 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
|
761 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
762 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
763 (while (> num 0) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
764 (insert ?\t) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
765 (setq num (1- num)))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
768 ;;; Check Prefix |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
769 ;;; |
57 | 770 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
771 (defun edt-check-prefix (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
772 "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
|
773 (if (<= num 0) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
774 (error "Prefix must be positive"))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
777 ;;; Check Selection |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
780 (defun edt-check-selection () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
781 "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
|
782 (if (not edt-select-mode) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
783 (error "Selection NOT active"))) |
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 ;;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
786 ;;;; 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
|
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
790 ;;; 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
|
791 ;;; 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
|
792 ;;; 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
|
793 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
794 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
795 ;;; CHANGE DIRECTION |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
798 (defun edt-change-direction () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
799 "Toggle movement direction." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
800 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
801 (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
|
802 (edt-backup) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
803 (edt-advance))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
806 ;;; TOGGLE SELECT |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
809 (defun edt-toggle-select () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
810 "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
|
811 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
812 (if edt-select-mode |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
813 (edt-reset) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
814 (edt-select))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
817 ;;; SENTENCE |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
820 (defun edt-sentence-forward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
821 "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
|
822 Accepts a positive prefix argument for the number of sentences to move." |
57 | 823 (interactive "p") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
824 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
825 (if (eobp) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
826 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
827 (error "End of buffer")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
828 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
829 (forward-sentence num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
830 (edt-one-word-forward)))) |
57 | 831 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
832 (defun edt-sentence-backward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
833 "Move backward to next sentence beginning. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
834 Accepts a positive prefix argument for the number of sentences to move." |
57 | 835 (interactive "p") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
836 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
837 (if (eobp) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
838 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
839 (error "End of buffer")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
840 (backward-sentence num))) |
57 | 841 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
842 (defun edt-sentence (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
843 "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
|
844 Accepts a positive prefix argument for the number of sentences to move." |
57 | 845 (interactive "p") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
846 (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
|
847 (edt-sentence-forward num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
848 (edt-sentence-backward num))) |
57 | 849 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
850 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
851 ;;; PARAGRAPH |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
854 (defun edt-paragraph-forward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
855 "Move forward to beginning of paragraph. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
856 Accepts a positive prefix argument for the number of paragraphs to move." |
57 | 857 (interactive "p") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
858 (edt-check-prefix num) |
57 | 859 (while (> num 0) |
860 (next-line 1) | |
861 (forward-paragraph) | |
862 (previous-line 1) | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
863 (if (eolp) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
864 (next-line 1)) |
57 | 865 (setq num (1- num)))) |
866 | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
867 (defun edt-paragraph-backward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
868 "Move backward to beginning of paragraph. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
869 Accepts a positive prefix argument for the number of paragraphs to move." |
57 | 870 (interactive "p") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
871 (edt-check-prefix num) |
57 | 872 (while (> num 0) |
873 (backward-paragraph) | |
874 (previous-line 1) | |
875 (if (eolp) (next-line 1)) | |
876 (setq num (1- num)))) | |
877 | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
878 (defun edt-paragraph (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
879 "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
|
880 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
|
881 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
882 (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
|
883 (edt-paragraph-forward num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
884 (edt-paragraph-backward num))) |
57 | 885 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
886 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
887 ;;; RESTORE KEY |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
888 ;;; |
57 | 889 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
890 (defun edt-restore-key () |
11442 | 891 "Restore last replaced key definition. |
892 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
|
893 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
894 (if edt-last-replaced-key-definition |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
895 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
896 (let (edt-key-definition-string) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
897 (set 'edt-key-definition-string |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
898 (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
|
899 (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
|
900 (message "Key not restored") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
901 (define-key (current-global-map) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
902 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
|
903 (error "No replaced key definition to restore!"))) |
57 | 904 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
905 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
906 ;;; WINDOW TOP |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
907 ;;; |
57 | 908 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
909 (defun edt-window-top () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
910 "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
|
911 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
912 (let ((start-column (current-column))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
913 (move-to-window-line 0) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
914 (move-to-column start-column))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
917 ;;; WINDOW BOTTOM |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
918 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
919 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
920 (defun edt-window-bottom () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
921 "Move the cursor to the bottom of the window." |
57 | 922 (interactive) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
923 (let ((start-column (current-column))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
924 (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
|
925 (move-to-column start-column))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
928 ;;; SCROLL WINDOW LINE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
929 ;;; |
57 | 930 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
931 (defun edt-scroll-window-forward-line () |
11442 | 932 "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
|
933 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
934 (scroll-up 1)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
935 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
936 (defun edt-scroll-window-backward-line () |
11442 | 937 "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
|
938 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
939 (scroll-down 1)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
940 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
941 (defun edt-scroll-line () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
942 "Move window one line in current direction." |
57 | 943 (interactive) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
944 (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
|
945 (edt-scroll-window-forward-line) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
946 (edt-scroll-window-backward-line))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
947 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
948 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
949 ;;; SCROLL WINDOW |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
950 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
951 ;;; 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
|
952 ;;; window. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
953 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
954 (defun edt-scroll-window-forward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
955 "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
|
956 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
|
957 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
958 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
959 (scroll-up (- (* (window-height) num) 2)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
960 (edt-line-forward (/ (- (window-height) 1) 2))) |
57 | 961 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
962 (defun edt-scroll-window-backward (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
963 "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
|
964 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
|
965 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
966 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
967 (scroll-down (- (* (window-height) num) 2)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
968 (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
|
969 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
970 (defun edt-scroll-window (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
971 "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
|
972 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
|
973 (interactive "p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
974 (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
|
975 (edt-scroll-window-forward num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
976 (edt-scroll-window-backward num))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
979 ;;; LINE TO BOTTOM OF WINDOW |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
980 ;;; |
57 | 981 |
982 (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
|
983 "Move the current line to the bottom of the window." |
57 | 984 (interactive) |
985 (recenter -1)) | |
986 | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
987 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
988 ;;; LINE TO TOP OF WINDOW |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
989 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
990 |
57 | 991 (defun edt-line-to-top-of-window () |
992 "Move the current line to the top of the window." | |
993 (interactive) | |
994 (recenter 0)) | |
995 | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
996 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
997 ;;; LINE TO MIDDLE OF WINDOW |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1000 (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
|
1001 "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
|
1002 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1003 (recenter '(4))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1006 ;;; GOTO PERCENTAGE |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1007 ;;; |
57 | 1008 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1009 (defun edt-goto-percentage (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1010 "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
|
1011 (interactive "NGoto-percentage: ") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1012 (if (or (> num 100) (< num 0)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1013 (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
|
1014 (goto-char (/ (* (point-max) num) 100)))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1017 ;;; FILL REGION |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1020 (defun edt-fill-region () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1021 "Fill selected text." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1022 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1023 (edt-check-selection) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1024 (fill-region (point) (mark))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1027 ;;; INDENT OR FILL REGION |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1030 (defun edt-indent-or-fill-region () |
57 | 1031 "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
|
1032 (interactive "*") |
10872
adc2429d1531
(edt-indent-or-fill-region): Remove ^ from paragraph-start & paragraph-separate.
Boris Goldowsky <boris@gnu.org>
parents:
10689
diff
changeset
|
1033 (if (string= paragraph-start "$\\|\f") |
57 | 1034 (indent-region (point) (mark) nil) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1035 (fill-region (point) (mark)))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1038 ;;; MARK SECTION WISELY |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1039 ;;; |
57 | 1040 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1041 (defun edt-mark-section-wisely () |
57 | 1042 "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
|
1043 Uses mark-defun for emacs-lisp and lisp, |
57 | 1044 mark-c-function for C, |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1045 mark-fortran-subsystem for fortran, |
57 | 1046 and mark-paragraph for other modes." |
1047 (interactive) | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1048 (if edt-select-mode |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1049 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1050 (edt-reset)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1051 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1052 (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
|
1053 (eq major-mode 'lisp-mode)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1054 (mark-defun) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1055 (message "Lisp defun selected")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1056 ((eq major-mode 'c-mode) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1057 (mark-c-function) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1058 (message "C function selected")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1059 ((eq major-mode 'fortran-mode) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1060 (mark-fortran-subprogram) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1061 (message "Fortran subprogram selected")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1062 (t (mark-paragraph) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1063 (message "Paragraph selected")))))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1066 ;;; COPY |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1069 (defun edt-copy () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1070 "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
|
1071 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1072 (edt-check-selection) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1073 (copy-region-as-kill (mark) (point)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1074 (edt-reset) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1075 (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
|
1076 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1077 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1078 ;;; CUT or COPY |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1081 (defun edt-cut-or-copy () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1082 "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
|
1083 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
|
1084 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
|
1085 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1086 (if buffer-read-only |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1087 (edt-copy) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1088 (edt-cut))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1091 ;;; DELETE ENTIRE LINE |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1094 (defun edt-delete-entire-line () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1095 "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
|
1096 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1097 (beginning-of-line) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1098 (edt-delete-line 1)) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1101 ;;; DUPLICATE LINE |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1104 (defun edt-duplicate-line (num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1105 "Duplicate a line of text. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1106 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
|
1107 (interactive "*p") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1108 (edt-check-prefix num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1109 (let ((old-column (current-column)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1110 (count num)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1111 (edt-delete-entire-line) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1112 (edt-undelete-line) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1113 (while (> count 0) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1114 (edt-undelete-line) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1115 (setq count (1- count))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1116 (edt-line-forward num) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1117 (move-to-column old-column))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1118 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1119 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1120 ;;; DUPLICATE WORD |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1123 (defun edt-duplicate-word() |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1124 "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
|
1125 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1126 (let ((start (point)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1127 (start-column (current-column))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1128 (forward-line -1) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1129 (move-to-column start-column) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1130 (if (and (not (equal start (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1131 (not (eolp))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1132 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1133 (if (and (equal ?\t (preceding-char)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1134 (< start-column (current-column))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1135 (backward-char)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1136 (let ((beg (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1137 (edt-one-word-forward) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1138 (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
|
1139 (forward-line) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1140 (move-to-column start-column) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1141 (insert edt-last-copied-word)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1142 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1143 (if (not (equal start (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1144 (forward-line)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1145 (move-to-column start-column) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1146 (error "Nothing to duplicate!"))))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1149 ;;; KEY NOT ASSIGNED |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1150 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1151 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1152 (defun edt-key-not-assigned () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1153 "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
|
1154 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1155 (error "Key not assigned")) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1158 ;;; TOGGLE CAPITALIZATION OF WORD |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1161 (defun edt-toggle-capitalization-of-word () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1162 "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
|
1163 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1164 (edt-one-word-forward) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1165 (edt-one-word-backward) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1166 (edt-change-case 1) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1167 (edt-one-word-backward) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1168 (edt-one-word-forward)) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1171 ;;; ELIMINATE ALL TABS |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1174 (defun edt-eliminate-all-tabs () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1175 "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
|
1176 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1177 (untabify (point-min) (point-max)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1178 (message "TABS converted to SPACES")) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1181 ;;; DISPLAY THE TIME |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1184 (defun edt-display-the-time () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1185 "Display the current time." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1186 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1187 (set 'time-string (current-time-string)) |
14346
4a609420dfc1
(edt-display-the-time): Pass proper format string to message.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
1188 (message "%s" time-string)) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1189 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1190 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1191 ;;; LEARN |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1194 (defun edt-learn () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1195 "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
|
1196 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1197 (if (eq defining-kbd-macro t) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1198 (edt-remember) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1199 (start-kbd-macro nil))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1202 ;;; REMEMBER |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1205 (defun edt-remember () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1206 "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
|
1207 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1208 (if (eq defining-kbd-macro nil) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1209 (error "Nothing to remember!") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1210 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1211 (end-kbd-macro nil) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1212 (let (edt-key-definition-string) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1213 (set 'edt-key-definition-string |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1214 (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
|
1215 (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
|
1216 (message "Key sequence not remembered") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1217 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1218 (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
|
1219 (setq edt-last-replaced-key-definition |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1220 (lookup-key (current-global-map) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1221 edt-key-definition-string)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1222 (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
|
1223 (name-last-kbd-macro |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1224 (intern (concat "last-learned-sequence-" |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1225 (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
|
1226 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1227 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1228 ;;; EXIT |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1229 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1230 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1231 (defun edt-exit () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1232 "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
|
1233 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1234 (save-buffer) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1235 (save-buffers-kill-emacs)) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1238 ;;; QUIT |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1241 (defun edt-quit () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1242 "Quit Emacs without saving changes." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1243 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1244 (kill-emacs)) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1247 ;;; SPLIT WINDOW |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1250 (defun edt-split-window () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1251 "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
|
1252 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1253 (split-window) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1254 (other-window 1)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1255 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1256 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1257 ;;; COPY RECTANGLE |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1260 (defun edt-copy-rectangle () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1261 "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
|
1262 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1263 (edt-check-selection) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1264 (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
|
1265 (edt-reset) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1266 (message "Selected rectangle COPIED to register")) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1269 ;;; CUT RECTANGLE |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1272 (defun edt-cut-rectangle-overstrike-mode () |
11442 | 1273 "Cut a rectangle of text between mark and cursor to register. |
1274 Replace cut characters with spaces and moving cursor back to | |
1275 upper left corner." | |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1276 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1277 (edt-check-selection) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1278 (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
|
1279 (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
|
1280 (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
|
1281 (message "Selected rectangle CUT to register")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1282 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1283 (defun edt-cut-rectangle-insert-mode () |
11442 | 1284 "Cut a rectangle of text between mark and cursor to register. |
1285 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
|
1286 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1287 (edt-check-selection) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1288 (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
|
1289 (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
|
1290 (fixup-whitespace) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1291 (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
|
1292 (message "Selected rectangle CUT to register")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1293 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1294 (defun edt-cut-rectangle () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1295 "Cut a rectangular region of text to register. |
11442 | 1296 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
|
1297 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1298 (if overwrite-mode |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1299 (edt-cut-rectangle-overstrike-mode) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1300 (edt-cut-rectangle-insert-mode))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1303 ;;; PASTE RECTANGLE |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1306 (defun edt-paste-rectangle-overstrike-mode () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1307 "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
|
1308 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1309 (picture-yank-rectangle-from-register 3)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1310 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1311 (defun edt-paste-rectangle-insert-mode () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1312 "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
|
1313 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1314 (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
|
1315 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1316 (defun edt-paste-rectangle () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1317 "Paste a rectangular region of text. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1318 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
|
1319 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1320 (if overwrite-mode |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1321 (edt-paste-rectangle-overstrike-mode) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1322 (edt-paste-rectangle-insert-mode))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1323 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1324 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1325 ;;; DOWNCASE REGION |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1328 (defun edt-lowercase () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1329 "Change specified characters to lower case. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1330 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
|
1331 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
|
1332 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
|
1333 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
|
1334 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
|
1335 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
|
1336 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
|
1337 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1338 (if edt-select-mode |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1339 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1340 (downcase-region (mark) (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1341 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1342 ;; Move to beginning of current word. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1343 (if (and |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1344 (not (bobp)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1345 (not (eobp)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1346 (not (bolp)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1347 (not (eolp)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1348 (not (eq ?\ (char-syntax (preceding-char)))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1349 (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
|
1350 (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
|
1351 (edt-one-word-backward)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1352 (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
|
1353 (edt-one-word-backward)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1354 (let ((beg (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1355 (edt-one-word-forward) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1356 (downcase-region beg (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1357 (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
|
1358 (edt-one-word-backward))))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1361 ;;; UPCASE REGION |
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1364 (defun edt-uppercase () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1365 "Change specified characters to upper case. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1366 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
|
1367 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
|
1368 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
|
1369 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
|
1370 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
|
1371 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
|
1372 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
|
1373 (interactive "*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1374 (if edt-select-mode |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1375 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1376 (upcase-region (mark) (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1377 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1378 ;; Move to beginning of current word. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1379 (if (and |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1380 (not (bobp)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1381 (not (eobp)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1382 (not (bolp)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1383 (not (eolp)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1384 (not (eq ?\ (char-syntax (preceding-char)))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1385 (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
|
1386 (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
|
1387 (edt-one-word-backward)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1388 (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
|
1389 (edt-one-word-backward)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1390 (let ((beg (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1391 (edt-one-word-forward) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1392 (upcase-region beg (point))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1393 (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
|
1394 (edt-one-word-backward))))) |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1398 ;;; INITIALIZATION COMMANDS. |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1402 ;;; 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
|
1403 ;;; |
11442 | 1404 (defvar edt-last-answer nil |
1405 "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
|
1406 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1407 (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
|
1408 "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
|
1409 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
|
1410 Like emacs y-or-n-p, also accepts space as y and DEL as n." |
14346
4a609420dfc1
(edt-display-the-time): Pass proper format string to message.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
1411 (message "%s[%s]" prompt (if not-yes "n" "y")) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1412 (let ((doit t)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1413 (while doit |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1414 (setq doit nil) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1415 (let ((ans (read-char))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1416 (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
|
1417 (setq edt-last-answer t)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1418 ((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
|
1419 (setq edt-last-answer nil)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1420 ((= 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
|
1421 (t |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1422 (setq doit t) (beep) |
14346
4a609420dfc1
(edt-display-the-time): Pass proper format string to message.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
1423 (message "Please answer y or n. %s[%s]" |
4a609420dfc1
(edt-display-the-time): Pass proper format string to message.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
1424 prompt (if not-yes "n" "y"))))))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1425 edt-last-answer) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1426 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1427 (defun edt-load-xkeys (file) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1428 "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
|
1429 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
|
1430 ~/.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
|
1431 (interactive "fX key definition file: ") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1432 (cond (file |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1433 (setq file (expand-file-name file))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1434 (edt-xkeys-file |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1435 (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
|
1436 (edt-gnu-emacs19-p |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1437 (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
|
1438 (edt-lucid-emacs19-p |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1439 (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
|
1440 (cond ((file-readable-p file) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1441 (load-file file)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1442 (t |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1443 (switch-to-buffer "*scratch*") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1444 (erase-buffer) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1445 (insert " |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1446 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1447 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
|
1448 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
|
1449 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
|
1450 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
|
1451 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
|
1452 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
|
1453 as follows: |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1454 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1455 emacs -q -l edt-mapper.el |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1456 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1457 The file edt-mapper.el includes these same directions on how to |
16426
0db426a80aff
(edt-load-xkeys): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
14346
diff
changeset
|
1458 use it! Perhaps it's lying around here someplace. \n ") |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1459 (let ((file "edt-mapper.el") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1460 (found nil) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1461 (path nil) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1462 (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
|
1463 (while (and (not found) search-list) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1464 (setq path (concat (car search-list) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1465 (if (string-match "/$" (car search-list)) "" "/") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1466 file)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1467 (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
|
1468 (setq found t)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1469 (setq search-list (cdr search-list))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1470 (cond (found |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1471 (insert (format |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1472 "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
|
1473 (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
|
1474 (load-file path) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1475 (error "EDT Emulation not configured."))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1476 (t |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1477 (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
|
1478 (sit-for 20) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1479 (error "EDT Emulation not configured."))))))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1480 |
258 | 1481 ;;;###autoload |
57 | 1482 (defun edt-emulation-on () |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1483 "Turn on EDT Emulation." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1484 (interactive) |
17601
2dd1c9442974
(edt-emulation-on): Load edt-pc.el under Windows.
Richard M. Stallman <rms@gnu.org>
parents:
16426
diff
changeset
|
1485 ;; If using MS-DOS or Windows, need to load edt-pc.el |
2dd1c9442974
(edt-emulation-on): Load edt-pc.el under Windows.
Richard M. Stallman <rms@gnu.org>
parents:
16426
diff
changeset
|
1486 (if (memq system-type '(ms-dos windows-nt)) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1487 (setq edt-term "pc") |
18022
85119f319971
(edt-emulation-on): Handle absence of TERM envvar.
Richard M. Stallman <rms@gnu.org>
parents:
17601
diff
changeset
|
1488 (setq edt-term (or (getenv "TERM") ""))) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1489 ;; 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
|
1490 (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
|
1491 (setq edt-term "vt100")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1492 ;; Load EDT terminal specific configuration file. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1493 (let ((term edt-term) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1494 hyphend) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1495 (while (and term |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1496 (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
|
1497 ;; 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
|
1498 (if (setq hyphend (string-match "[-_][^-_]+$" term)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1499 (setq term (substring term 0 hyphend)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1500 (setq term nil))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1501 ;; 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
|
1502 ;; 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
|
1503 (if (eq window-system 'x) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1504 (edt-load-xkeys nil) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1505 (if (null term) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1506 (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
|
1507 (setq edt-term term)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1508 (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
|
1509 (add-hook 'activate-mark-hook |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1510 (function |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1511 (lambda () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1512 (edt-select-mode t)))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1513 (add-hook 'deactivate-mark-hook |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1514 (function |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1515 (lambda () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1516 (edt-select-mode nil)))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1517 (if (load "edt-user" t t) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1518 (edt-user-emulation-setup) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1519 (edt-default-emulation-setup))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1520 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1521 (defun edt-emulation-off() |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1522 "Select original global key bindings, disabling EDT Emulation." |
57 | 1523 (interactive) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1524 (use-global-map global-map) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1525 (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
|
1526 (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
|
1527 (setq edt-direction-string "") |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1528 (setq edt-select-mode-text nil) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1529 (edt-reset) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1530 (force-mode-line-update t) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1531 (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
|
1532 (message "Original key bindings restored; EDT Emulation disabled")) |
57 | 1533 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1534 (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
|
1535 "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
|
1536 ;; 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
|
1537 ;; 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
|
1538 ;; 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
|
1539 ;; 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
|
1540 ;; 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
|
1541 (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
|
1542 (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
|
1543 (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
|
1544 (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
|
1545 (edt-setup-default-bindings) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1546 ;; 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
|
1547 ;; 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
|
1548 ;; function edt-setup-extra-default-bindings. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1549 (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
|
1550 (edt-setup-extra-default-bindings)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1551 ;; Variable needed by edt-learn. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1552 (setq edt-learn-macro-count 0) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1553 ;; 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
|
1554 (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
|
1555 (setq minor-mode-alist |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1556 (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
|
1557 ;; 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
|
1558 (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
|
1559 (setq minor-mode-alist |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1560 (cons |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1561 '(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
|
1562 (if user-setup |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1563 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1564 (setq edt-user-map-configured t) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1565 (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
|
1566 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1567 (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
|
1568 (edt-select-default-global-map)))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1569 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1570 (defun edt-user-emulation-setup () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1571 "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
|
1572 ;; Initialize EDT default bindings. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1573 (edt-default-emulation-setup t) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1574 ;; 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
|
1575 (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
|
1576 (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
|
1577 (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
|
1578 ;; 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
|
1579 ;; 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
|
1580 ;; function edt-setup-extra-default-bindings. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1581 (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
|
1582 (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
|
1583 (edt-setup-user-bindings) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1584 (edt-select-user-global-map)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1585 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1586 (defun edt-select-default-global-map() |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1587 "Select default EDT emulation key bindings." |
57 | 1588 (interactive) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1589 (transient-mark-mode 1) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1590 (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
|
1591 (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
|
1592 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1593 (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
|
1594 (setq page-delimiter "\f"))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1595 (setq edt-default-map-active t) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1596 (edt-advance) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1597 (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
|
1598 (edt-reset) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1599 (message "Default EDT keymap active")) |
57 | 1600 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1601 (defun edt-select-user-global-map() |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1602 "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
|
1603 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1604 (if edt-user-map-configured |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1605 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1606 (transient-mark-mode 1) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1607 (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
|
1608 (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
|
1609 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1610 (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
|
1611 (setq page-delimiter "\f"))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1612 (setq edt-default-map-active nil) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1613 (edt-advance) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1614 (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
|
1615 (edt-reset) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1616 (message "User EDT custom keymap active")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1617 (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
|
1618 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1619 (defun edt-switch-global-maps () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1620 "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
|
1621 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1622 (if edt-default-map-active |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1623 (edt-select-user-global-map) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1624 (edt-select-default-global-map))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1625 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1626 ;; 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
|
1627 ;; (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
|
1628 ;; standard keys, and one for function keys. |
57 | 1629 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1630 (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
|
1631 "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
|
1632 (if default |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1633 (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
|
1634 (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
|
1635 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1636 (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
|
1637 "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
|
1638 (if default |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1639 (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
|
1640 (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
|
1641 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1642 (defun edt-bind-function-key |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1643 (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
|
1644 "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
|
1645 (catch 'edt-key-not-supported |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1646 (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
|
1647 (if (stringp key-vector) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1648 (throw 'edt-key-not-supported t)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1649 (if (not (null key-vector)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1650 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1651 (if default |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1652 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1653 (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
|
1654 (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
|
1655 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1656 (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
|
1657 (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
|
1658 (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
|
1659 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1660 (defun edt-setup-default-bindings () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1661 "Assigns default EDT Emulation keyboard bindings." |
3479
7cda082508c9
(GOLD-prefix): Define *after* GOLD-map.
Richard M. Stallman <rms@gnu.org>
parents:
2570
diff
changeset
|
1662 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1663 ;; Function Key Bindings: Regular and GOLD. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1664 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1665 ;; 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
|
1666 (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
|
1667 (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
|
1668 (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
|
1669 (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
|
1670 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1671 ;; VT100/VT200/VT300 Arrow Keys |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1672 (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
|
1673 (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
|
1674 (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
|
1675 (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
|
1676 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1677 ;; VT100/VT200/VT300 Keypad Keys |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1678 (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
|
1679 (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
|
1680 (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
|
1681 (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
|
1682 (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
|
1683 (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
|
1684 (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
|
1685 (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
|
1686 (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
|
1687 (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
|
1688 (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
|
1689 (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
|
1690 (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
|
1691 (edt-bind-function-key "KPE" 'other-window 'query-replace t) |
57 | 1692 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1693 ;; VT200/VT300 Function Keys |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1694 ;; (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
|
1695 ;; making default bindings to those keys. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1696 (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
|
1697 (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
|
1698 (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
|
1699 (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
|
1700 (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
|
1701 (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
|
1702 (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
|
1703 (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
|
1704 (edt-bind-function-key "F8" |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1705 '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
|
1706 (edt-bind-function-key "F9" |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1707 '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
|
1708 (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
|
1709 ;; 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
|
1710 ;; 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
|
1711 ;; 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
|
1712 (edt-bind-function-key "F11" |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1713 '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
|
1714 (edt-bind-function-key "F12" |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1715 '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
|
1716 (edt-bind-function-key "F13" |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1717 '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
|
1718 (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
|
1719 (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
|
1720 (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
|
1721 (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
|
1722 (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
|
1723 (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
|
1724 (edt-bind-function-key "F20" 'edt-key-not-assigned 'edt-key-not-assigned t) |
57 | 1725 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1726 ;; Control key bindings: Regular and GOLD |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1727 ;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1728 ;; 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
|
1729 ;; 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
|
1730 ;; 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
|
1731 ;; 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
|
1732 ;; 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
|
1733 ;; 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
|
1734 ;; used, instead. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1735 (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
|
1736 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1737 (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
|
1738 (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
|
1739 ;; 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
|
1740 (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
|
1741 (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
|
1742 (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
|
1743 ;; 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
|
1744 ; (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
|
1745 ;; 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
|
1746 ;; GOLD-C-h instead. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1747 (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
|
1748 (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
|
1749 (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
|
1750 (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
|
1751 (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
|
1752 (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
|
1753 ;; 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
|
1754 (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
|
1755 (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
|
1756 (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
|
1757 (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
|
1758 ;; 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
|
1759 ;; 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
|
1760 (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
|
1761 (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
|
1762 (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
|
1763 (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
|
1764 ;; 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
|
1765 (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
|
1766 ; (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
|
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 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1770 ;; 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
|
1771 (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
|
1772 (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
|
1773 (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
|
1774 (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
|
1775 (edt-bind-gold-key "\C-\\" 'split-window-vertically t) |
57 | 1776 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1777 ;; GOLD bindings for regular keys. |
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 "A" 'edt-key-not-assigned 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 "B" 'buffer-menu 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 "C" 'compile 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 "D" 'delete-window 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 "E" 'edt-exit 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 "F" 'find-file 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 "G" 'find-file-other-window 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 "H" 'edt-electric-keypad-help 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 "I" 'insert-file 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 "J" 'edt-key-not-assigned 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 "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
|
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 "L" 'edt-lowercase 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 "M" 'save-some-buffers 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 "N" 'next-error 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 "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
|
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 "P" 'edt-key-not-assigned 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) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1811 (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
|
1812 (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
|
1813 (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
|
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 "S" 'save-buffer 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 "T" 'edt-key-not-assigned 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 "U" 'edt-uppercase 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 "V" 'find-file-other-window 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 "W" 'write-file 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 "X" 'edt-key-not-assigned 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 "Y" 'edt-emulation-off 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 "Z" 'edt-switch-global-maps t) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1830 (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
|
1831 (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
|
1832 (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
|
1833 (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
|
1834 (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
|
1835 (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
|
1836 (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
|
1837 (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
|
1838 (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
|
1839 (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
|
1840 (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
|
1841 (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
|
1842 (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
|
1843 (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
|
1844 (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
|
1845 (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
|
1846 (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
|
1847 (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
|
1848 (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
|
1849 (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
|
1850 (edt-bind-gold-key " " 'undo 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 "_" 'edt-key-not-assigned t) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1865 (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
|
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 "}" 'edt-key-not-assigned t) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1871 (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
|
1872 (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
|
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1876 ;;; DEFAULT EDT KEYPAD HELP |
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 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1880 ;;; 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
|
1881 ;;; 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
|
1882 ;;; 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
|
1883 ;;; commands or are native Emacs commands. |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1884 ;;; |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1885 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1886 (defun edt-keypad-help () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1887 " |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1888 DEFAULT EDT Keypad Active |
57 | 1889 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1890 F7: Copy Rectangle +----------+----------+----------+----------+ |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1891 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
|
1892 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
|
1893 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
|
1894 G-F9: Paste Rect Insert +----------+----------+----------+----------+ |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1895 F10: Cut Rectangle |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1896 G-F10: Paste Rectangle |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1897 F11: ESC |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1898 F12: Begining of Line +----------+----------+----------+----------+ |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1899 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
|
1900 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
|
1901 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
|
1902 DO: Execute extended command +----------+----------+----------+----------+ |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1903 | PAGE | SECT | APPEND | DEL W | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1904 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
|
1905 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
|
1906 C-h: Beginning of Line +----------+----------+----------+----------+ |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1907 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
|
1908 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
|
1909 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
|
1910 C-k: Define Key +----------+----------+----------+----------+ |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1911 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
|
1912 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
|
1913 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
|
1914 C-r: Isearch Backward +---------------------+----------+ (ENTER) | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1915 C-s: Isearch Forward | LINE | SELECT | ! |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1916 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
|
1917 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
|
1918 C-v: Redraw Display +---------------------+----------+----------+ |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1919 C-w: Set Screen Width 132 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1920 C-z: Suspend Emacs +----------+----------+----------+ |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1921 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
|
1922 | (FIND) | (INSERT) | (REMOVE) | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1923 G-b: Buffer Menu | FIND | | COPY | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1924 G-c: Compile +----------+----------+----------+ |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1925 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
|
1926 G-e: Exit | (SELECT) |(PREVIOUS)| (NEXT) | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1927 G-f: Find File | | | | |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1928 G-g: Find File Other Window +----------+----------+----------+ |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1929 G-h: Keypad Help |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1930 G-i: Insert File |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1931 G-k: Toggle Capitalization Word |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1932 G-l: Downcase Region |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1933 G-m: Save Some Buffers |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1934 G-n: Next Error |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1935 G-o: Switch to Next Window |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1936 G-q: Quit |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1937 G-r: Revert File |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1938 G-s: Save Buffer |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1939 G-u: Upcase Region |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1940 G-v: Find File Other Window |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1941 G-w: Write file |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1942 G-y: EDT Emulation OFF |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1943 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
|
1944 G-1: Delete Other Windows |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1945 G-2: Split Window |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1946 G-%: Go to Percentage |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1947 G- : Undo (GOLD Spacebar) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1948 G-=: Go to Line |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1949 G-`: What line" |
57 | 1950 |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1951 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1952 (describe-function 'edt-keypad-help)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1953 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1954 (defun edt-electric-helpify (fun) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1955 (let ((name "*Help*")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1956 (if (save-window-excursion |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1957 (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
|
1958 (b (get-buffer name)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1959 (m (buffer-modified-p b))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1960 (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
|
1961 (setq b nil)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1962 (unwind-protect |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1963 (progn |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1964 (message "%s..." (capitalize (symbol-name fun))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1965 (and b |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1966 (save-excursion |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1967 (set-buffer b) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1968 (set-buffer-modified-p t))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1969 (fset 'print-help-return-message 'ignore) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1970 (call-interactively fun) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1971 (and (get-buffer name) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1972 (get-buffer-window (get-buffer name)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1973 (or (not b) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1974 (not (eq b (get-buffer name))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1975 (not (buffer-modified-p b))))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1976 (fset 'print-help-return-message p) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1977 (and b (buffer-name b) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1978 (save-excursion |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1979 (set-buffer b) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1980 (set-buffer-modified-p m)))))) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1981 (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
|
1982 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1983 (defun edt-electric-keypad-help () |
11442 | 1984 "Display default EDT bindings." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1985 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1986 (edt-electric-helpify 'edt-keypad-help)) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1987 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1988 (defun edt-electric-user-keypad-help () |
11442 | 1989 "Display user custom EDT bindings." |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1990 (interactive) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1991 (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
|
1992 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1993 ;;; |
13058
1d26583f8c2b
(edt-set-screen-width-80, edt-set-screen-width-132):
Karl Heuer <kwzh@gnu.org>
parents:
12421
diff
changeset
|
1994 ;;; EDT emulation screen width commands. |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1995 ;;; |
13058
1d26583f8c2b
(edt-set-screen-width-80, edt-set-screen-width-132):
Karl Heuer <kwzh@gnu.org>
parents:
12421
diff
changeset
|
1996 ;; 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
|
1997 ;; 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
|
1998 ;; 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
|
1999 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2000 (defun edt-set-screen-width-80 () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2001 "Set screen width to 80 columns." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2002 (interactive) |
13058
1d26583f8c2b
(edt-set-screen-width-80, edt-set-screen-width-132):
Karl Heuer <kwzh@gnu.org>
parents:
12421
diff
changeset
|
2003 (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
|
2004 (edt-set-term-width-80)) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2005 (set-screen-width 80) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2006 (message "Screen width 80")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2007 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2008 (defun edt-set-screen-width-132 () |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2009 "Set screen width to 132 columns." |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2010 (interactive) |
13058
1d26583f8c2b
(edt-set-screen-width-80, edt-set-screen-width-132):
Karl Heuer <kwzh@gnu.org>
parents:
12421
diff
changeset
|
2011 (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
|
2012 (edt-set-term-width-132)) |
10689
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2013 (set-screen-width 132) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2014 (message "Screen width 132")) |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2015 |
5adde53bae4b
New enhanced version from <kgallagh@spd.dsccc.com>.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
2016 (provide 'edt) |
660
08eb386dd0f3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
258
diff
changeset
|
2017 |
08eb386dd0f3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
258
diff
changeset
|
2018 ;;; edt.el ends here |