File: tpu-edt.el.html

%% TPU-edt -- Emacs emulating TPU emulating EDT

%% Contents

 % Introduction
 % Differences Between TPU-edt and DEC TPU/edt
 % Starting TPU-edt
 % Customizing TPU-edt using the Emacs Initialization File
 % Regular Expressions in TPU-edt


%% Introduction

   TPU-edt emulates the popular DEC VMS editor EDT (actually, it emulates
   DEC TPU's EDT emulation, hence the name TPU-edt). TPU-edt features the
   following TPU/edt functionality:

    . EDT keypad
    . On-line help
    . Repeat counts
    . Scroll margins
    . Learn sequences
    . Free cursor mode
    . Rectangular cut and paste
    . Multiple windows and buffers
    . TPU line-mode REPLACE command
    . Wild card search and substitution
    . Configurable through an initialization file
    . History recall of search strings, file names, and commands

   Please note that TPU-edt does NOT emulate TPU. It emulates TPU's EDT
   emulation. Very few TPU line-mode commands are supported.

   TPU-edt, like its VMS cousin, works on VT-series terminals with DEC
   style keyboards. VT terminal emulators, including xterm with the
   appropriate key translations, work just fine too.

   TPU-edt works with X-windows. This is accomplished through a TPU-edt
   X key map. The tpu-mapper command creates this map and stores it in a
   file. See the tpu-mapper command help for more information, or just
   run it and follow the directions.


%% Differences Between TPU-edt and DEC TPU/edt

   In some cases, Emacs doesn't support text highlighting, so selected
   regions are not shown in inverse video. Emacs uses the concept of "the
   mark". The mark is set at one end of a selected region; the cursor is
   at the other. In cases where the selected region cannot be shown in
   inverse video an at sign (@) appears in the mode line when mark is set.
   The native Emacs command ^X^X (Control-X twice) exchanges the cursor
   with the mark; this provides a handy way to find the location of the
   mark.

   In TPU the cursor can be either bound or free. Bound means the cursor
   cannot wander outside the text of the file being edited. Free means
   the arrow keys can move the cursor past the ends of lines. Free is the
   default mode in TPU; bound is the only mode in EDT. Bound is the only
   mode in the base version of TPU-edt; optional extensions add an
   approximation of free mode, see the commentary in tpu-extras.el for
   details.

   Like TPU, Emacs uses multiple buffers. Some buffers are used to hold
   files you are editing; other "internal" buffers are used for Emacs's own
   purposes (like showing you help). Here are some commands for dealing
   with buffers.

      Gold-B moves to next buffer, including internal buffers
      Gold-N moves to next buffer containing a file
      Gold-M brings up a buffer menu (like TPU "show buffers")

   Emacs is very fond of throwing up new windows. Dealing with all these
   windows can be a little confusing at first, so here are a few commands
   to that may help:

      Gold-Next_Scr moves to the next window on the screen
      Gold-Prev_Scr moves to the previous window on the screen
      Gold-TAB also moves to the next window on the screen

      Control-x 1 deletes all but the current window
      Control-x 0 deletes the current window

   Note that the buffers associated with deleted windows still exist!

   Like TPU, TPU-edt has a "command" function, invoked with Gold-KP7 or
   Do. Most of the commands available are Emacs commands. Some TPU
   commands are available, they are: replace, exit, quit, include, and
   Get (unfortunately, "get" is an internal Emacs function, so we are
   stuck with "Get" - to make life easier, Get is available as Gold-g).

   TPU-edt supports the recall of commands, file names, and search
   strings. The history of strings recalled differs slightly from
   TPU/edt, but it is still very convenient.

   Help is available! The traditional help keys (Help and PF2) display
   a small help file showing the default keypad layout, control key
   functions, and Gold key functions. Pressing any key inside of help
   splits the screen and prints a description of the function of the
   pressed key. Gold-PF2 invokes the native Emacs help, with its
   zillions of options.

   Thanks to Emacs, TPU-edt has some extensions that may make your life
   easier, or at least more interesting. For example, Gold-r toggles
   TPU-edt rectangular mode. In rectangular mode, Remove and Insert work
   on rectangles. Likewise, Gold-* toggles TPU-edt regular expression
   mode. In regular expression mode Find, Find Next, and the line-mode
   replace command work with regular expressions. [A regular expression
   is a pattern that denotes a set of strings; like VMS wildcards.]

   Emacs also gives TPU-edt the undo and occur functions. Undo does
   what it says; it undoes the last change. Multiple undos in a row
   undo multiple changes. For your convenience, undo is available on
   Gold-u. Occur shows all the lines containing a specific string in
   another window. Moving to that window, and typing ^C^C (Control-C
   twice) on a particular line moves you back to the original window
   at that line. Occur is on Gold-o.

   Finally, as you edit, remember that all the power of Emacs is at
   your disposal. It really is a fantastic tool. You may even want to
   take some time and read the Emacs tutorial; perhaps not to learn the
   native Emacs key bindings, but to get a feel for all the things
   Emacs can do for you. The Emacs tutorial is available from the
   Emacs help function: "Gold-PF2 t"


%% Starting TPU-edt

   All you have to do to start TPU-edt, is turn it on. This can be
   done from the command line when running Emacs.

       prompt> emacs -f tpu-edt

   If you've already started Emacs, turn on TPU-edt using the tpu-edt
   command. First press M-x (that's usually ESC followed by x)
   and type tpu-edt followed by a carriage return.

   If you like TPU-edt and want to use it all the time, you can start
   TPU-edt using the Emacs initialization file, .emacs. Simply add
   the following line to your init file:

       (tpu-edt)

   That's all you need to do to start TPU-edt.


%% Customizing TPU-edt using the Emacs Initialization File

   The following is a sample Emacs initialization file. It shows how to
   invoke TPU-edt, and how to customize it.

   ; .emacs - a sample Emacs initialization file

   ; Turn on TPU-edt
   (tpu-edt)

   ; Set scroll margins 10% (top) and 15% (bottom).
   (tpu-set-scroll-margins "10%" "15%")

   ; Load the vtxxx terminal control functions.
   (load "vt-control" t)

   ; TPU-edt treats words like EDT; here's how to add word separators.
   ; Note that backslash (\) and double quote (") are quoted with '\\'.
   (tpu-add-word-separators "]\M-x -_,.\"=+()'/*#:!&;$")

(-_,.\"=+()'/*#:!&;$")

; Emacs is happy to save files without a final newline; other Unix ; programs hate that! Here we make sure that files end with newlines. (setq require-final-newline t)

; Emacs uses Control-s and Control-q. Problems can occur when using ; Emacs on terminals that use these codes for flow control (Xon/Xoff ; flow control). These lines disable Emacs's use of these characters. (global-unset-key "\C-s") (global-unset-key "\C-q")

; The Emacs universal-argument function is very useful. ; This line maps universal-argument to Gold-PF1. (define-key tpu-gold-map [kp_f1)
   ; Emacs is happy to save files without a final newline; other Unix (-_,.\"=+()'/*#:!&;$")

; Emacs is happy to save files without a final newline; other Unix ; programs hate that! Here we make sure that files end with newlines. (setq require-final-newline t)

; Emacs uses Control-s and Control-q. Problems can occur when using ; Emacs on terminals that use these codes for flow control (Xon/Xoff ; flow control). These lines disable Emacs's use of these characters. (global-unset-key "\C-s") (global-unset-key "\C-q")

; The Emacs universal-argument function is very useful. ; This line maps universal-argument to Gold-PF1. (define-key tpu-gold-map [kp_f1)
   ; programs hate that! Here we make sure that files end with newlines. (-_,.\"=+()'/*#:!&;$")

; Emacs is happy to save files without a final newline; other Unix ; programs hate that! Here we make sure that files end with newlines. (setq require-final-newline t)

; Emacs uses Control-s and Control-q. Problems can occur when using ; Emacs on terminals that use these codes for flow control (Xon/Xoff ; flow control). These lines disable Emacs's use of these characters. (global-unset-key "\C-s") (global-unset-key "\C-q")

; The Emacs universal-argument function is very useful. ; This line maps universal-argument to Gold-PF1. (define-key tpu-gold-map [kp_f1)
   (setq require-final-newline t)

(-_,.\"=+()'/*#:!&;$")

; Emacs is happy to save files without a final newline; other Unix ; programs hate that! Here we make sure that files end with newlines. (setq require-final-newline t)

; Emacs uses Control-s and Control-q. Problems can occur when using ; Emacs on terminals that use these codes for flow control (Xon/Xoff ; flow control). These lines disable Emacs's use of these characters. (global-unset-key "\C-s") (global-unset-key "\C-q")

; The Emacs universal-argument function is very useful. ; This line maps universal-argument to Gold-PF1. (define-key tpu-gold-map [kp_f1)
   ; Emacs uses Control-s and Control-q. Problems can occur when using (-_,.\"=+()'/*#:!&;$")

; Emacs is happy to save files without a final newline; other Unix ; programs hate that! Here we make sure that files end with newlines. (setq require-final-newline t)

; Emacs uses Control-s and Control-q. Problems can occur when using ; Emacs on terminals that use these codes for flow control (Xon/Xoff ; flow control). These lines disable Emacs's use of these characters. (global-unset-key "\C-s") (global-unset-key "\C-q")

; The Emacs universal-argument function is very useful. ; This line maps universal-argument to Gold-PF1. (define-key tpu-gold-map [kp_f1)
   ; Emacs on terminals that use these codes for flow control (Xon/Xoff (-_,.\"=+()'/*#:!&;$")

; Emacs is happy to save files without a final newline; other Unix ; programs hate that! Here we make sure that files end with newlines. (setq require-final-newline t)

; Emacs uses Control-s and Control-q. Problems can occur when using ; Emacs on terminals that use these codes for flow control (Xon/Xoff ; flow control). These lines disable Emacs's use of these characters. (global-unset-key "\C-s") (global-unset-key "\C-q")

; The Emacs universal-argument function is very useful. ; This line maps universal-argument to Gold-PF1. (define-key tpu-gold-map [kp_f1)
   ; flow control). These lines disable Emacs's use of these characters. (-_,.\"=+()'/*#:!&;$")

; Emacs is happy to save files without a final newline; other Unix ; programs hate that! Here we make sure that files end with newlines. (setq require-final-newline t)

; Emacs uses Control-s and Control-q. Problems can occur when using ; Emacs on terminals that use these codes for flow control (Xon/Xoff ; flow control). These lines disable Emacs's use of these characters. (global-unset-key "\C-s") (global-unset-key "\C-q")

; The Emacs universal-argument function is very useful. ; This line maps universal-argument to Gold-PF1. (define-key tpu-gold-map [kp_f1)
   (global-unset-key "\C-s")
   (global-unset-key "\C-q")

(-_,.\"=+()'/*#:!&;$")

; Emacs is happy to save files without a final newline; other Unix ; programs hate that! Here we make sure that files end with newlines. (setq require-final-newline t)

; Emacs uses Control-s and Control-q. Problems can occur when using ; Emacs on terminals that use these codes for flow control (Xon/Xoff ; flow control). These lines disable Emacs's use of these characters. (global-unset-key "\C-s") (global-unset-key "\C-q")

; The Emacs universal-argument function is very useful. ; This line maps universal-argument to Gold-PF1. (define-key tpu-gold-map [kp_f1)
   ; The Emacs universal-argument function is very useful. (-_,.\"=+()'/*#:!&;$")

; Emacs is happy to save files without a final newline; other Unix ; programs hate that! Here we make sure that files end with newlines. (setq require-final-newline t)

; Emacs uses Control-s and Control-q. Problems can occur when using ; Emacs on terminals that use these codes for flow control (Xon/Xoff ; flow control). These lines disable Emacs's use of these characters. (global-unset-key "\C-s") (global-unset-key "\C-q")

; The Emacs universal-argument function is very useful. ; This line maps universal-argument to Gold-PF1. (define-key tpu-gold-map [kp_f1)
   ; This line maps universal-argument to Gold-PF1. (-_,.\"=+()'/*#:!&;$")

; Emacs is happy to save files without a final newline; other Unix ; programs hate that! Here we make sure that files end with newlines. (setq require-final-newline t)

; Emacs uses Control-s and Control-q. Problems can occur when using ; Emacs on terminals that use these codes for flow control (Xon/Xoff ; flow control). These lines disable Emacs's use of these characters. (global-unset-key "\C-s") (global-unset-key "\C-q")

; The Emacs universal-argument function is very useful. ; This line maps universal-argument to Gold-PF1. (define-key tpu-gold-map [kp_f1)
   (define-key tpu-gold-map [kp_f1 'universal-argument) ; Gold-PF1

   ; Make KP7 move by paragraphs, instead of pages.
   (define-key tpu-global-map [kf_7] 'tpu-paragraph) ; KP7

   ; Repeat the preceding mappings for X-windows.
   (cond
    (window-system
     (define-key tpu-global-map [kp_7] 'tpu-paragraph) ; KP7
     (define-key tpu-gold-map [kp_f1] 'universal-argument))) ; GOLD-PF1

   ; Display the TPU-edt version.
   (tpu-version)


%% Regular Expressions in TPU-edt

   Gold-* toggles TPU-edt regular expression mode. In regular expression
   mode, find, find next, replace, and substitute accept Emacs regular
   expressions. A complete list of Emacs regular expressions can be found
   using the Emacs "info" command (it's somewhat like the VMS help
   command). Try the following sequence of commands:

       DO info <enter info mode>
       m emacs <select the "emacs" topic>
       m regexs <select the "regular expression" topic>

   Type "q" to quit out of info mode.

   There is a problem in regular expression mode when searching for empty
   strings, like beginning-of-line (^) and end-of-line ($). When searching
   for these strings, find-next may find the current string, instead of the
   next one. This can cause global replace and substitute commands to loop
   forever in the same location. For this reason, commands like

       replace "^" "> " <add "> " to beginning of line>
       replace "$" "00711" <add "00711" to end of line>

   may not work properly.

   Commands like those above are very useful for adding text to the
   beginning or end of lines. They might work on a line-by-line basis, but
   go into an infinite loop if the "all" response is specified. If the
   goal is to add a string to the beginning or end of a particular set of
   lines TPU-edt provides functions to do this.

       Gold-^ Add a string at BOL in region or buffer
       Gold-$ Add a string at EOL in region or buffer

   There is also a TPU-edt interface to the native Emacs string replacement
   commands. Gold-/ invokes this command. It accepts regular expressions
   if TPU-edt is in regular expression mode. Given a repeat count, it will
   perform the replacement without prompting for confirmation.

   This command replaces empty strings correctly, however, it has its
   drawbacks. As a native Emacs command, it has a different interface
   than the emulated TPU commands. Also, it works only in the forward
   direction, regardless of the current TPU-edt direction.

Defined variables (37)

tpu-add-at-bol-histHistory variable for tpu-edt-add-at-bol function.
tpu-add-at-eol-histHistory variable for tpu-edt-add-at-eol function.
tpu-advanceTrue when TPU-edt is operating in the forward direction.
tpu-breadcrumb-plistThe set of user-defined markers (breadcrumbs), as a plist.
tpu-buffer-local-mapTPU-edt buffer local key map.
tpu-control-keysIf non-nil, control keys are set to perform TPU functions.
tpu-direction-stringMode line string to identify current direction.
tpu-edt-modeNon-nil if Tpu-Edt mode is enabled.
tpu-edt-mode-hookHook run after entering or leaving ‘tpu-edt-mode’.
tpu-global-mapTPU-edt global keymap.
tpu-gold-mapMaps the function keys on the VT100 keyboard preceded by PF1.
tpu-kill-buffers-silentlyIf non-nil, TPU-edt kills modified buffers without asking.
tpu-last-answerMost recent response to tpu-y-or-n-p.
tpu-last-deleted-charLast character deleted by a TPU-edt character-delete command.
tpu-last-deleted-linesLast text deleted by a TPU-edt line-delete command.
tpu-last-deleted-regionLast text deleted by a TPU-edt remove command.
tpu-last-deleted-wordsLast text deleted by a TPU-edt word-delete command.
tpu-last-replaced-textLast text deleted by a TPU-edt replace command.
tpu-newline-and-indent-pIf non-nil, Return produces a newline and indents.
tpu-newline-and-indent-stringMode line string to identify AutoIndent mode.
tpu-pan-columnsNumber of columns the tpu-pan functions scroll left or right.
tpu-percent-scrollPercentage of the screen to scroll for next/previous screen commands.
tpu-rectangle-stringMode line string to identify rectangular mode.
tpu-rectangular-pIf non-nil, TPU-edt removes and inserts rectangles.
tpu-regexp-pIf non-nil, TPU-edt uses regexp search and replace routines.
tpu-regexp-prompt-histHistory variable for search and replace functions.
tpu-replace-overlayReplace highlight overlay.
tpu-reverseTrue when TPU-edt is operating in the backward direction.
tpu-saved-control-rSaved value of Control-r.
tpu-saved-delete-funcSaved value of the delete key.
tpu-search-last-stringLast text searched for by the TPU-edt search commands.
tpu-search-overlaySearch highlight overlay.
tpu-searching-forwardIf non-nil, TPU-edt is searching in the forward direction.
tpu-skip-charsCharacters to skip when moving by word.
tpu-versionTPU-edt version number.
tpu-word-separator-listList of additional word separators.
tpu-xkeys-fileFile containing TPU-edt X key map.

Defined functions (142)

EXIT()
GET(FILE)
Get(FILE)
HELP()
INCLUDE(FILE)
QUIT()
REPLACE(FROM TO)
SET CURSOR BOUND()
SET CURSOR FREE()
SET SCROLL MARGINS(SCROLL\ MARGINS TOP BOTTOM &optional EMIT-MSG)
SPELL()
TPU-EDT()
TPU-EDT-MODE(&optional ARG)
WHAT LINE()
exit()
help()
include(FILE)
quit()
replace(FROM TO)
set cursor bound()
set cursor free()
set scroll margins(scroll\ margins TOP BOTTOM &optional EMIT-MSG)
spell()
tpu-add-at-bol(TEXT)
tpu-add-at-eol(TEXT)
tpu-add-word-separators(SEPARATORS)
tpu-adjust-search(&optional ARG)
tpu-advance-direction()
tpu-append-region(ARG)
tpu-arrange-rectangle()
tpu-arrow-history()
tpu-backup-direction()
tpu-backward-to-word(NUM)
tpu-beginning-of-window()
tpu-change-case(NUM)
tpu-char(NUM)
tpu-check-match()
tpu-check-search-case(STRING)
tpu-copy-keyfile(OLDNAME NEWNAME)
tpu-current-line()
tpu-cut(ARG)
tpu-cut-text()
tpu-define-macro-key()
tpu-delete-current-char(NUM)
tpu-delete-current-line(NUM)
tpu-delete-current-word(NUM)
tpu-delete-previous-word(NUM)
tpu-delete-to-bol(NUM)
tpu-delete-to-eol(NUM)
tpu-drop-breadcrumb(NUM)
tpu-edt()
tpu-edt-mode(&optional ARG)
tpu-edt-off()
tpu-edt-on()
tpu-emacs-replace(&optional DONT-ASK)
tpu-end-define-macro-key(KEY)
tpu-end-of-line(NUM)
tpu-end-of-window()
tpu-error(STRING &rest ARGS)
tpu-exit()
tpu-fill(NUM)
tpu-forward-to-word(NUM)
tpu-get(FILE)
tpu-goto-breadcrumb(NUM)
tpu-goto-percent(PERC)
tpu-help()
tpu-include(FILE)
tpu-insert-escape()
tpu-insert-formfeed()
tpu-kill-buffer()
tpu-line(NUM)
tpu-line-to-bottom-of-window()
tpu-line-to-top-of-window()
tpu-lm-replace(FROM TO)
tpu-load-xkeys(FILE)
tpu-local-set-key(KEY FUNC)
tpu-make-file-buffer-list(BUFFER-LIST)
tpu-mark()
tpu-match-beginning()
tpu-match-end()
tpu-move-to-beginning()
tpu-move-to-end()
tpu-next-buffer()
tpu-next-file-buffer()
tpu-next-history-element(N)
tpu-next-paragraph(NUM)
tpu-next-window()
tpu-pan-left(NUM)
tpu-pan-right(NUM)
tpu-paste(NUM)
tpu-previous-history-element(N)
tpu-previous-paragraph(NUM)
tpu-previous-window()
tpu-quit()
tpu-quoted-insert(NUM)
tpu-regexp-prompt(PROMPT)
tpu-replace()
tpu-reset-control-keys(TPU-STYLE)
tpu-reset-screen-size(HEIGHT WIDTH)
tpu-reset-word-separators()
tpu-save-all-buffers-kill-emacs()
tpu-scroll-window(NUM)
tpu-search()
tpu-search-again()
tpu-search-backward-exit()
tpu-search-forward()
tpu-search-forward-exit()
tpu-search-internal-core(PAT &optional QUIET)
tpu-search-reverse()
tpu-select(&optional QUIET)
tpu-set-control-keys()
tpu-set-mark(POS)
tpu-set-match()
tpu-set-mode-line(FOR-TPU)
tpu-set-search(&optional ARG)
tpu-set-word-separators(SEPARATORS)
tpu-show-match-markers()
tpu-special-insert(NUM)
tpu-spell-check()
tpu-store-text()
tpu-string-prompt(PROMPT HISTORY-SYMBOL)
tpu-substitute(NUM)
tpu-toggle-control-keys()
tpu-toggle-direction()
tpu-toggle-newline-and-indent()
tpu-toggle-overwrite-mode()
tpu-toggle-rectangle()
tpu-toggle-regexp()
tpu-toggle-search-direction()
tpu-trim-line-ends()
tpu-undelete-char(NUM)
tpu-undelete-lines(NUM)
tpu-undelete-words(NUM)
tpu-unselect(&optional QUIET)
tpu-unset-match()
tpu-update-mode-line()
tpu-version()
tpu-what-line()
tpu-word(NUM)
tpu-write-current-buffers()
tpu-y-or-n-p(PROMPT &optional NOT-YES)
what line()

Defined faces (0)