Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Тексты(все).docx
Скачиваний:
4
Добавлен:
01.07.2025
Размер:
1 Мб
Скачать
☆
  1. Repeat if command to be interpreted

then Update file buffer if screen out of date then Update screen until exit

  1. Repeat while there is a command to be interpreted

update file buffer

while (screen is out of date) and no command to be interpreted

update screen a little (more) until exit

Next, terminals vary in the control characters that they use to direct cursor movement, perform scrolling, clear sections of the screen and so on. There will typically be some mechanism,such as virtual screens or an editor accessible file of terminals.

E

The e editor developed by the Rand Computation Center uses control characters for control functions, such as cursor movement and initiating string searches. Non-con­trol characters are either inserted at the current cursor position or overwrite the character at that position. Insert/Over- write mode is toggled with a simple command, an indicator on the screen indicates the current mode. The user can have multiple windows (possibly into different files); a "change window" command moves to the next window in a circular list. A keystroke history file is generated as the user types and, in the event of an uncontrolled exit, the history can be replayed. A variety of commands can be issued in "command mode" 'including some oriented towards document preparation such as filling and justification of paragraphs.

The editor does unexpected things to tabs and spaces on lines that it modifies. Trailing tabs and spaces are deleted, groups of leading spaces are converted to tabs and embedded tabs are converted to spaces.

EMACS

EMACS is probably the most widely available full­screen editor. Implementations of it, and clones are available on a large variety of sys from super computers to micros. There is even a USENET news- group (comp.emacs)

devoted to "EMACS editors of different flavors" One reason for its popularity is that its design enables it to be customized to suit particular users and applica­tions; if necessary it can also be made to behave like a particular non EMACS editor.

And further. EMACS interprets user keystrokes using one or more tables, each of which has an entry for each ASCII character. The table entry for a character may specify a function to be carried out or may point to another table. If a function is performed, if the point­er points to another table than that table is used to interpret the next keystroke. In this way, multi charac­ter commands are implemented. For example, while con- trol-L causes EMACS to redraw the screen, the effect of control-X depends on what follows it:

control — X control — 0 delet blank lines

control — X control — S save current file

control — X control — W resize window

There are sensible defaults, for example the graphic characters are bound to "self insert" — a function that causes them to be inserted into the file buffer at the current cursor position.

Moreover, a user can create a set of key-bindings and cause it to be loaded into the table(s). For example, the space character could be bound to a function that checks the location of the right margin and, if neces­sary , bacs up and inserts a newline, thus providing auto-wrap. Similarly, a period could initiate the look­up of the preceding symbol in a list of abbreviations. Closing brackets of various kinds could start a check for previously occuring opening ones. In particular, EMACS can be customized with routines knowing about the syntax and user-preferred format of certain program­ming languages, e.g., C and LISP. '

Disadvantages of EMACS are that it may be complex for a beginner to use, (but it can be made simple using the key-buildings) and that it requires more memory and CPU time than siple editors. Many concurrent EMACS users on a system can cause a noticeable performance degradation.

Thus, the categories of editor we have looked at so far require progressively more sophisticated terminals. Line and stream editors work on dumb terminals and dis­play editors require addressable screens.

Приложения

HfcwBi &3©«Q3) ss®# a» й