annotate lisp/emulation/edt.el @ 10561:53f34c870201

(init_buffer_once, syms_of_buffer): Set up buffer-local var point_before_scroll. (reset_buffer): Init point_before_scroll.
author Richard M. Stallman <rms@gnu.org>
date Fri, 27 Jan 1995 07:17:39 +0000
parents cc7cd83ccf3f
children 5adde53bae4b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
660
08eb386dd0f3 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 258
diff changeset
1 ;;; edt.el --- EDT emulation in Emacs
08eb386dd0f3 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 258
diff changeset
2
7300
cc7cd83ccf3f Update copyright.
Karl Heuer <kwzh@gnu.org>
parents: 6841
diff changeset
3 ;; Copyright (C) 1986, 1994 Free Software Foundation, Inc.
846
20674ae6bf52 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 811
diff changeset
4
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 793
diff changeset
5 ;; Author: Mike Clarkson <mike@yetti.UUCP>
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 793
diff changeset
6 ;; Maintainer: FSF
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 793
diff changeset
7 ;; Created: 27 Aug 1986
811
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 807
diff changeset
8 ;; Keywords: emulations
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 793
diff changeset
9
846
20674ae6bf52 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 811
diff changeset
10 ;; This started from public domain code by Mike Clarkson
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11 ;; but has been greatly altered.
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 ;; This file is part of GNU Emacs.
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15 ;; GNU Emacs is free software; you can redistribute it and/or modify
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 ;; 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
17 ;; the Free Software Foundation; either version 2, or (at your option)
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 ;; any later version.
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20 ;; GNU Emacs is distributed in the hope that it will be useful,
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23 ;; GNU General Public License for more details.
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25 ;; You should have received a copy of the GNU General Public License
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26 ;; along with GNU Emacs; see the file COPYING. If not, write to
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 793
diff changeset
29 ;;; Commentary:
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 793
diff changeset
30
662
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
31 ;; Here's my EDT emulation for GNU Emacs that is based on the EDT emulation
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
32 ;; for Gosling's Emacs sent out on the net a couple of years ago by Lynn Olson
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
33 ;; at Tektronics. This emulation was widely distributed as the file edt.ml
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
34 ;; in the maclib directory of most Emacs distributions.
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
35 ;;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
36 ;; I will gladly take all criticisms and complaints to heart, and will fix what
793
6fb68a1460a6 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 662
diff changeset
37 ;; bugs I can find. As this is my first Emacs Lisp hack, you may have to root
6fb68a1460a6 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 662
diff changeset
38 ;; out a few nasties hidden in the code. Please let me know if you find any
6fb68a1460a6 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 662
diff changeset
39 ;; (sorry, no rewards :-). I would also be interested if there are better,
6fb68a1460a6 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 662
diff changeset
40 ;; cleaner, faster ways of doing some of the things that I have done.
662
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
41 ;;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
42 ;; You must understand some design considerations that I had in mind.
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
43 ;; The intention was not really to "emulate" EDT, but rather to take advantage
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
44 ;; of the years of EDT experience that had accumulated in my right hand,
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
45 ;; while at the same time taking advantage of EMACS.
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
46 ;;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
47 ;; Some major differences are:
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
48 ;;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
49 ;; HELP is describe-key;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
50 ;; GOLD/HELP is describe-function;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
51 ;; FIND is isearch-forward/backward;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
52 ;; GOLD/HELP is occur-menu, which finds all instances of a search string;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
53 ;; ENTER is other-window;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
54 ;; SUBS is subprocess-command. Note that you have to change this
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
55 ;; to `shell' if you are running Un*x;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
56 ;; PAGE is next-paragraph, because that's more useful than page.
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
57 ;; SPECINS is copy-to-killring;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
58 ;; GOLD/GOLD is mark-section-wisely, which is my command to mark the
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
59 ;; section in a manner consistent with the major-mode. It
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
60 ;; uses mark-defun for emacs-lisp, lisp, mark-c-function for C,
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
61 ;; and mark-paragraph for other modes.
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
62 ;;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
63 ;;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
64 ;; Some subtle differences are:
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
65 ;;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
66 ;; APPEND is append-to-buffer. One doesn't append to the kill ring
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
67 ;; much and SPECINS is now copy-to-killring;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
68 ;; REPLACE is replace-regexp;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
69 ;; FILL is fill-region-wisely, which uses indent-region for C, lisp
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
70 ;; emacs-lisp, and fill-region for others. It asks if you
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
71 ;; really want to fill-region in TeX-mode, because I find this
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
72 ;; to be very dangerous.
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
73 ;; CHNGCASE is case-flip for the character under the cursor only.
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
74 ;; I felt that case-flip region is unlikely, as usually you
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
75 ;; upcase-region or downcase region. Also, unlike EDT it
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
76 ;; is independent of the direction you are going, as that
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
77 ;; drives me nuts.
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
78 ;;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
79 ;; I use Emacs definition of what a word is. This is considerably different
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
80 ;; from what EDT thinks a word is. This is not good for dyed-in-the-wool EDT
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
81 ;; fans, but is probably preferable for experienced Emacs users. My assumption
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
82 ;; is that the former are a dying breed now that GNU Emacs has made it to VMS,
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
83 ;; but let me know how you feel. Also, when you undelete a word it leave the
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
84 ;; point at the end of the undeleted text, rather than the beginning. I might
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
85 ;; change this as I'm not sure if I like this or not. I'm also not sure if I
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
86 ;; want it to set the mark each time you delete a character or word.
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
87 ;;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
88 ;; Backspace does not invoke beginning-of-line, because ^H is the help prefix,
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
89 ;; and I felt it should be left as such. You can change this if you like.
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
90 ;;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
91 ;; The ADVANCE and BACKUP keys do not work as terminators for forward or
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
92 ;; backward searches. In Emacs, all search strings are terminated by return.
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
93 ;; The searches will however go forward or backward depending on your current
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
94 ;; direction. Also, when you change directions, the mode line will not be
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
95 ;; updated immediately, but only when you next execute an emacs function.
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
96 ;; Personally, I consider this to be a bug, not a feature.
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
97 ;;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
98 ;; This should also work with VT-2xx's, though I haven't tested it extensively
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
99 ;; on those terminals. It assumes that the CSI-map of vt_200.el has been
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
100 ;; defined.
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
101 ;;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
102 ;; There are also a whole bunch of GOLD letter, and GOLD character bindings:
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
103 ;; look at edtdoc.el for them, or better still, look at the edt.el lisp code,
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
104 ;; because after all, in the true Lisp tradition, the source code is *assumed*
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
105 ;; to be self-documenting :-)
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
106 ;;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
107 ;; Mike Clarkson, ...!allegra \ BITNET: mike@YUYETTI or
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
108 ;; CRESS, York University, ...!decvax \ SYMALG@YUSOL
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
109 ;; 4700 Keele Street, ...!ihnp4 > !utzoo!yetti!mike
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
110 ;; North York, Ontario, ...!linus /
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
111 ;; CANADA M3J 1P3. ...!watmath / Phone: +1 (416) 736-2100 x 7767
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
112 ;;
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
113 ;; Note that I am not on ARPA, and must gateway any ARPA mail through BITNET or
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
114 ;; UUCP. If you have a UUCP or BITNET address please use it for communication
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
115 ;; so that I can reach you directly. If you have both, the BITNET address
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
116 ;; is preferred.
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 793
diff changeset
117
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 793
diff changeset
118 ;;; Code:
662
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 660
diff changeset
119
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
120 (defvar edt-last-deleted-lines ""
199
b3710ab30435 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 57
diff changeset
121 "Last text deleted by an EDT emulation `line-delete' command.")
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
122 (defvar edt-last-deleted-words ""
199
b3710ab30435 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 57
diff changeset
123 "Last text deleted by an EDT emulation `word-delete' command.")
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
124 (defvar edt-last-deleted-chars ""
199
b3710ab30435 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 57
diff changeset
125 "Last text deleted by an EDT emulation `character-delete' command.")
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127 (defun delete-current-line (num)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
128 "Delete one or specified number of lines after point.
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
129 This includes the newline character at the end of each line.
199
b3710ab30435 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 57
diff changeset
130 They are saved for the EDT `undelete-lines' command."
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131 (interactive "p")
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132 (let ((beg (point)))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
133 (forward-line num)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
134 (if (not (eq (preceding-char) ?\n))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
135 (insert "\n"))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136 (setq edt-last-deleted-lines
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
137 (buffer-substring beg (point)))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
138 (delete-region beg (point))))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
139
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
140 (defun delete-to-eol (num)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
141 "Delete text up to end of line.
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
142 With argument, delete up to to Nth line-end past point.
199
b3710ab30435 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 57
diff changeset
143 They are saved for the EDT `undelete-lines' command."
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
144 (interactive "p")
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
145 (let ((beg (point)))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
146 (forward-char 1)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
147 (end-of-line num)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
148 (setq edt-last-deleted-lines
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
149 (buffer-substring beg (point)))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
150 (delete-region beg (point))))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
151
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
152 (defun delete-current-word (num)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
153 "Delete one or specified number of words after point.
199
b3710ab30435 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 57
diff changeset
154 They are saved for the EDT `undelete-words' command."
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
155 (interactive "p")
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
156 (let ((beg (point)))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157 (forward-word num)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
158 (setq edt-last-deleted-words
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
159 (buffer-substring beg (point)))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
160 (delete-region beg (point))))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
161
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
162 (defun edt-delete-previous-word (num)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163 "Delete one or specified number of words before point.
199
b3710ab30435 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 57
diff changeset
164 They are saved for the EDT `undelete-words' command."
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
165 (interactive "p")
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
166 (let ((beg (point)))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
167 (forward-word (- num))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168 (setq edt-last-deleted-words
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169 (buffer-substring (point) beg))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
170 (delete-region beg (point))))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
171
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
172 (defun delete-current-char (num)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
173 "Delete one or specified number of characters after point.
199
b3710ab30435 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 57
diff changeset
174 They are saved for the EDT `undelete-chars' command."
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
175 (interactive "p")
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
176 (setq edt-last-deleted-chars
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
177 (buffer-substring (point) (min (point-max) (+ (point) num))))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
178 (delete-region (point) (min (point-max) (+ (point) num))))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
179
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
180 (defun delete-previous-char (num)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
181 "Delete one or specified number of characters before point.
199
b3710ab30435 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 57
diff changeset
182 They are saved for the EDT `undelete-chars' command."
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
183 (interactive "p")
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
184 (setq edt-last-deleted-chars
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
185 (buffer-substring (max (point-min) (- (point) num)) (point)))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
186 (delete-region (max (point-min) (- (point) num)) (point)))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
187
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
188 (defun undelete-lines ()
199
b3710ab30435 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 57
diff changeset
189 "Yank lines deleted by last EDT `line-delete' command."
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
190 (interactive)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
191 (insert edt-last-deleted-lines))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
192
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
193 (defun undelete-words ()
199
b3710ab30435 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 57
diff changeset
194 "Yank words deleted by last EDT `word-delete' command."
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
195 (interactive)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
196 (insert edt-last-deleted-words))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
197
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
198 (defun undelete-chars ()
199
b3710ab30435 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 57
diff changeset
199 "Yank characters deleted by last EDT `character-delete' command."
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
200 (interactive)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
201 (insert edt-last-deleted-chars))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
202
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
203 (defun next-end-of-line (num)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
204 "Move to end of line; if at end, move to end of next line.
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
205 Accepts a prefix argument for the number of lines to move."
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
206 (interactive "p")
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
207 (forward-char)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
208 (end-of-line num))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
209
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
210 (defun previous-end-of-line (num)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
211 "Move EOL upward.
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
212 Accepts a prefix argument for the number of lines to move."
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
213 (interactive "p")
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
214 (end-of-line (- 1 num)))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
215
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
216 (defun forward-to-word (num)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
217 "Move to next word-beginning, or to Nth following word-beginning."
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
218 (interactive "p")
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
219 (forward-word (1+ num))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
220 (forward-word -1))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
221
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
222 (defun backward-to-word (num)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
223 "Move back to word-end, or to Nth word-end seen."
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
224 (interactive "p")
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
225 (forward-word (- (1+ num)))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
226 (forward-word 1))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
227
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
228 (defun backward-line (num)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
229 "Move point to start of previous line.
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
230 Prefix argument serves as repeat-count."
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
231 (interactive "p")
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
232 (forward-line (- num)))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
233
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
234 (defun scroll-window-down (num)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
235 "Scroll the display down a window-full.
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
236 Accepts a prefix argument for the number of window-fulls to scroll."
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
237 (interactive "p")
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
238 (scroll-down (- (* (window-height) num) 2)))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
239
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
240 (defun scroll-window-up (num)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
241 "Scroll the display up a window-full.
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
242 Accepts a prefix argument for the number of window-fulls to scroll."
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
243 (interactive "p")
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
244 (scroll-up (- (* (window-height) num) 2)))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
245
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
246 (defun next-paragraph (num)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
247 "Move to beginning of the next indented paragraph.
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
248 Accepts a prefix argument for the number of paragraphs."
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
249 (interactive "p")
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
250 (while (> num 0)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
251 (next-line 1)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
252 (forward-paragraph)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
253 (previous-line 1)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
254 (if (eolp) (next-line 1))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
255 (setq num (1- num))))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
256
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
257 (defun previous-paragraph (num)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
258 "Move to beginning of previous indented paragraph.
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
259 Accepts a prefix argument for the number of paragraphs."
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
260 (interactive "p")
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
261 (while (> num 0)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
262 (backward-paragraph)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
263 (previous-line 1)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
264 (if (eolp) (next-line 1))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
265 (setq num (1- num))))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
266
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
267 (defun move-to-beginning ()
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
268 "Move cursor to the beginning of buffer, but don't set the mark."
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
269 (interactive)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
270 (goto-char (point-min)))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
271
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
272 (defun move-to-end ()
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
273 "Move cursor to the end of buffer, but don't set the mark."
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
274 (interactive)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
275 (goto-char (point-max)))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
276
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
277 (defun goto-percent (perc)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
278 "Move point to ARG percentage of the buffer."
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
279 (interactive "NGoto-percentage: ")
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
280 (if (or (> perc 100) (< perc 0))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
281 (error "Percentage %d out of range 0 < percent < 100" perc)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
282 (goto-char (/ (* (point-max) perc) 100))))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
283
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
284 (defun update-mode-line ()
199
b3710ab30435 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 57
diff changeset
285 "Ensure mode-line reflects all changes."
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
286 (set-buffer-modified-p (buffer-modified-p))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
287 (sit-for 0))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
288
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
289 (defun advance-direction ()
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
290 "Set EDT Advance mode so keypad commands move forward."
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
291 (interactive)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
292 (setq edt-direction-string " ADVANCE")
4248
9d4ec373d478 (advance-direction): Set kp-f3, not kp-f1.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
293 (global-set-key [kp-f3] 'isearch-forward)
923
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
294 (global-set-key [kp-8] 'scroll-window-up)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
295 (global-set-key [kp-7] 'next-paragraph)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
296 (global-set-key [kp-1] 'forward-to-word)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
297 (global-set-key [kp-2] 'next-end-of-line)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
298 (global-set-key [kp-3] 'forward-char)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
299 (global-set-key [kp-0] 'forward-line)
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
300 (update-mode-line))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
301
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
302 (defun backup-direction ()
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
303 "Set EDT Backup mode so keypad commands move backward."
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
304 (interactive)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
305 (setq edt-direction-string " BACKUP")
923
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
306 (global-set-key [kp-f3] 'isearch-backward)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
307 (global-set-key [kp-8] 'scroll-window-down)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
308 (global-set-key [kp-7] 'previous-paragraph)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
309 (global-set-key [kp-1] 'backward-to-word)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
310 (global-set-key [kp-2] 'previous-end-of-line)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
311 (global-set-key [kp-3] 'backward-char)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
312 (global-set-key [kp-9] 'backward-line)
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
313 (update-mode-line))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
314
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
315 (defun edt-beginning-of-window ()
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
316 "Home cursor to top of window."
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
317 (interactive)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
318 (move-to-window-line 0))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
319
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
320 (defun edt-line-to-bottom-of-window ()
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
321 "Move the current line to the top of the window."
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
322 (interactive)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
323 (recenter -1))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
324
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
325 (defun edt-line-to-top-of-window ()
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
326 "Move the current line to the top of the window."
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
327 (interactive)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
328 (recenter 0))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
329
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
330 (defun case-flip-character (num)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
331 "Change the case of the character under the cursor.
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
332 Accepts a prefix argument of the number of characters to invert."
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
333 (interactive "p")
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
334 (while (> num 0)
6841
4de0f0648bb3 (case-flip-character): Make case test more general.
Richard M. Stallman <rms@gnu.org>
parents: 6338
diff changeset
335 (funcall (if (let ((ch (following-char)))
4de0f0648bb3 (case-flip-character): Make case test more general.
Richard M. Stallman <rms@gnu.org>
parents: 6338
diff changeset
336 (= ch (downcase ch)))
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
337 'upcase-region 'downcase-region)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
338 (point) (1+ (point)))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
339 (forward-char 1)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
340 (setq num (1- num))))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
341
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
342 (defun indent-or-fill-region ()
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
343 "Fill region in text modes, indent region in programming language modes."
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
344 (interactive)
6338
63033f2867fd (indent-or-fill-region): Use printable escapes instead of embedding literal
Karl Heuer <kwzh@gnu.org>
parents: 4248
diff changeset
345 (if (string= paragraph-start "^$\\|^\f")
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
346 (indent-region (point) (mark) nil)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
347 (fill-region (point) (mark))))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
348
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
349 (defun mark-section-wisely ()
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
350 "Mark the section in a manner consistent with the major-mode.
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
351 Uses mark-defun for emacs-lisp, lisp,
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
352 mark-c-function for C,
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
353 and mark-paragraph for other modes."
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
354 (interactive)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
355 (cond ((eq major-mode 'emacs-lisp-mode)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
356 (mark-defun))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
357 ((eq major-mode 'lisp-mode)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
358 (mark-defun))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
359 ((eq major-mode 'c-mode)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
360 (mark-c-function))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
361 (t (mark-paragraph))))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
362
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
363 ;;; Key Bindings
258
1e0bc00dca7a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 199
diff changeset
364 ;;;###autoload
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
365 (defun edt-emulation-on ()
199
b3710ab30435 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 57
diff changeset
366 "Emulate DEC's EDT editor.
b3710ab30435 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 57
diff changeset
367 Note that many keys are rebound; including nearly all keypad keys.
923
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
368 Use \\[edt-emulation-off] to undo all rebindings except the keypad keys."
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
369 (interactive)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
370 (advance-direction)
923
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
371 (edt-bind-gold-keypad)
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
372 (setq edt-mode-old-c-\\ (lookup-key global-map "\C-\\"))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
373 (global-set-key "\C-\\" 'quoted-insert)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
374 (setq edt-mode-old-delete (lookup-key global-map "\177"))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
375 (global-set-key "\177" 'delete-previous-char) ;"Delete"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
376 (setq edt-mode-old-lisp-delete (lookup-key emacs-lisp-mode-map "\177"))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
377 (define-key emacs-lisp-mode-map "\177" 'delete-previous-char) ;"Delete"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
378 (define-key lisp-mode-map "\177" 'delete-previous-char) ;"Delete"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
379 (setq edt-mode-old-linefeed (lookup-key global-map "\C-j"))
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
380 (global-set-key "\C-j" 'edt-delete-previous-word) ;"LineFeed"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
381 (define-key esc-map "?" 'apropos)) ;"<ESC>?"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
382
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
383 (defun edt-emulation-off ()
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
384 "Return from EDT emulation to normal Emacs key bindings.
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
385 The keys redefined by \\[edt-emulation-on] are given their old definitions."
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
386 (interactive)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
387 (setq edt-direction-string nil)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
388 (global-set-key "\C-\\" edt-mode-old-c-\\)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
389 (global-set-key "\177" edt-mode-old-delete) ;"Delete"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
390 (define-key emacs-lisp-mode-map "\177" edt-mode-old-lisp-delete) ;"Delete"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
391 (define-key lisp-mode-map "\177" edt-mode-old-lisp-delete) ;"Delete"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
392 (global-set-key "\C-j" edt-mode-old-linefeed)) ;"LineFeed"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
393
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
394 (defvar GOLD-map (make-keymap)
3591
507f64624555 Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents: 3479
diff changeset
395 "`GOLD-map' maps the function keys on the VT100 keyboard preceded
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
396 by the PF1 key. GOLD is the ASCII the 7-bit escape sequence <ESC>OP.")
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
397
3479
7cda082508c9 (GOLD-prefix): Define *after* GOLD-map.
Richard M. Stallman <rms@gnu.org>
parents: 2570
diff changeset
398 (defalias 'GOLD-prefix GOLD-map)
7cda082508c9 (GOLD-prefix): Define *after* GOLD-map.
Richard M. Stallman <rms@gnu.org>
parents: 2570
diff changeset
399
923
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
400 (global-set-key [home] 'edt-beginning-of-window)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
401 (global-set-key [kp-f2] 'describe-key)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
402 (global-set-key [kp-f4] 'delete-current-line)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
403 (global-set-key [kp-9] 'append-to-buffer)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
404 (global-set-key [kp-subtract] 'delete-current-word)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
405 (global-set-key [kp-4] 'advance-direction)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
406 (global-set-key [kp-5] 'backup-direction)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
407 (global-set-key [kp-6] 'kill-region)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
408 (global-set-key [kp-separator] 'delete-current-char)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
409 (global-set-key [kp-decimal] 'set-mark-command)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
410 (global-set-key [kp-enter] 'other-window)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
411 (global-set-key [kp-f1] 'GOLD-prefix)
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
412
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
413 ;;Bind GOLD/Keyboard keys
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
414
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
415 (define-key GOLD-map "\C-g" 'keyboard-quit) ; just for safety
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
416 (define-key GOLD-map "\177" 'delete-window) ;"Delete"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
417 (define-key GOLD-map "\C-h" 'delete-other-windows) ;"BackSpace"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
418 (define-key GOLD-map "\C-m" 'newline-and-indent) ;"Return"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
419 (define-key GOLD-map " " 'undo) ;"Spacebar"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
420 (define-key GOLD-map "%" 'goto-percent) ; "%"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
421 (define-key GOLD-map "=" 'goto-line) ; "="
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
422 (define-key GOLD-map "`" 'what-line) ; "`"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
423 (define-key GOLD-map "\C-\\" 'split-window-vertically) ; "Control-\"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
424
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
425 ; GOLD letter combinations:
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
426 (define-key GOLD-map "b" 'buffer-menu) ; "b"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
427 (define-key GOLD-map "B" 'buffer-menu) ; "B"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
428 (define-key GOLD-map "d" 'delete-window) ; "d"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
429 (define-key GOLD-map "D" 'delete-window) ; "D"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
430 (define-key GOLD-map "e" 'compile) ; "e"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
431 (define-key GOLD-map "E" 'compile) ; "E"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
432 (define-key GOLD-map "i" 'insert-file) ; "i"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
433 (define-key GOLD-map "I" 'insert-file) ; "I"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
434 (define-key GOLD-map "l" 'goto-line) ; "l"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
435 (define-key GOLD-map "L" 'goto-line) ; "L"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
436 (define-key GOLD-map "m" 'save-some-buffers) ; "m"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
437 (define-key GOLD-map "M" 'save-some-buffers) ; "m"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
438 (define-key GOLD-map "n" 'next-error) ; "n"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
439 (define-key GOLD-map "N" 'next-error) ; "N"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
440 (define-key GOLD-map "o" 'switch-to-buffer-other-window) ; "o"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
441 (define-key GOLD-map "O" 'switch-to-buffer-other-window) ; "O"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
442 (define-key GOLD-map "r" 'revert-file) ; "r"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
443 (define-key GOLD-map "r" 'revert-file) ; "R"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
444 (define-key GOLD-map "s" 'save-buffer) ; "s"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
445 (define-key GOLD-map "S" 'save-buffer) ; "S"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
446 (define-key GOLD-map "v" 'find-file-other-window) ; "v"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
447 (define-key GOLD-map "V" 'find-file-other-window) ; "V"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
448 (define-key GOLD-map "w" 'write-file) ; "w"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
449 (define-key GOLD-map "w" 'write-file) ; "W"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
450 ;(define-key GOLD-map "z" 'shrink-window) ; "z"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
451 ;(define-key GOLD-map "Z" 'shrink-window) ; "z"
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
452
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
453 ;Bind GOLD/Keypad keys
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
454 (defun edt-bind-gold-keypad ()
923
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
455 (define-key GOLD-map [up] 'edt-line-to-top-of-window)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
456 (define-key GOLD-map [down] 'edt-line-to-bottom-of-window)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
457 (define-key GOLD-map [left] 'backward-sentence)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
458 (define-key GOLD-map [right] 'forward-sentence)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
459 (define-key GOLD-map [kp-f1] 'mark-section-wisely)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
460 (define-key GOLD-map [kp-f2] 'describe-function)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
461 (define-key GOLD-map [kp-f3] 'occur)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
462 (define-key GOLD-map [kp-f4] 'undelete-lines)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
463 (define-key GOLD-map [kp-0] 'open-line)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
464 (define-key GOLD-map [kp-1] 'case-flip-character)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
465 (define-key GOLD-map [kp-2] 'delete-to-eol)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
466 (define-key GOLD-map [kp-3] 'copy-region-as-kill)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
467 (define-key GOLD-map [kp-4] 'move-to-end)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
468 (define-key GOLD-map [kp-5] 'move-to-beginning)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
469 (define-key GOLD-map [kp-6] 'yank)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
470 (define-key GOLD-map [kp-7] 'execute-extended-command)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
471 (define-key GOLD-map [kp-8] 'indent-or-fill-region)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
472 (define-key GOLD-map [kp-9] 'replace-regexp)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
473 (define-key GOLD-map [kp-subtract] 'undelete-words)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
474 (define-key GOLD-map [kp-separator] 'undelete-chars)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
475 (define-key GOLD-map [kp-decimal] 'redraw-display)
9f3cc03dae67 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
476 (define-key GOLD-map [kp-enter] 'shell-command))
57
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
477
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
478 ;; Make direction of motion show in mode line
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
479 ;; while EDT emulation is turned on.
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
480 ;; Note that the keypad is always turned on when in Emacs.
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
481
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
482 (or (assq 'edt-direction-string minor-mode-alist)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
483 (setq minor-mode-alist (cons '(edt-direction-string edt-direction-string)
f34b559dc980 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
484 minor-mode-alist)))
660
08eb386dd0f3 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 258
diff changeset
485
08eb386dd0f3 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 258
diff changeset
486 ;;; edt.el ends here