Process buffers, Region markers, Symbol table – Crunch CRiSP File Editor 6 User Manual

Page 36: System buffers, Tab settings, Undo information

Advertising
background image

Page 36

frequently annoying problem with vi(1)). The user can clear the read-only bit for a buffer by calling the
make_writable macro (available from the features menu) or by typing <Ctrl-A><Ctrl-W>.

Process Buffers

Each buffer can have an external system process associated with it. These output from these process is
automatically inserted into the buffer as it appears. Input from the keyboard can be directed to these
processes. These process buffers are normally use to access the command line interpreter, e.g. the shell,
so that instead of having to keep stopping CRiSP to access some system program, e.g. make(1), the user
can view output in a window. This is similar to having xterm windows under the X11 windowing system.

Process buffers are useful because all output from the process is easily accessible by scrolling the window
using the normal editing keys, so that error messages, etc. which have disappeared from view can be seen.

Process buffers are supported by a number of macros to aid in using them.

These processes are sometimes referred to as pty's, because on systems that support them, pty's are used
to implement this functionality. This term (as far as I know) originates from the ancient TOPS-10 operating
system (circa late 60's). A PTY is like a normal terminal, except there is no physical manifestation of the
terminal. Instead of input coming from a real user, the input comes from another program; output from the
PTY can be read by the controlling program, e.g. CRiSP.

The pty facility in many Unix implementations is used where possible. Under other systems, pipes are used.
Pipes are not as good as pty's, because for example it is not possible to run vi in a process buffer on
systems where this is true.

Region Markers

Each buffer can have an optional marker or anchor associated with it. A marker is used to highlight a section
of the buffer when it is displayed on the screen. This allows the user to highlight a section of text and then
apply some operation to it, e.g. cutting it to the scrap. A buffer can only have a single marker at any one
time, but each window which is displaying a buffer can maintain its own marker.

Symbol Table

Each buffer can have a set of user defined variables associated with it. These are referred to as buffer local
variables. These variables exist only whilst the buffer is the current buffer. This facility allows macros to
maintain their own data structures on a per buffer basis.

Refer to the description of the make_local_variable macro.

System Buffers

System buffers are special buffers which tend to be associated with the implementation of certain macros.
System buffers tend to have two attributes which make them useful -- they do not store undo information,
and thus buffer modifications are faster, and also they do not appear in the buffer list (available via <Alt-B>).

Because system buffers are marked differently to normal buffers, user macros can avoid accessing these
buffers unless they themselves created them. For example, the autosave macro does not attempt to
autosave the command history buffer.

In CRiSP, the system buffer flag and the undo-flag for a buffer are two separate buffers, allowing non-
system buffers to have the undo turned off for a buffer.

Tab Settings

Each buffer has a set of tab stops defined for it. These tab stops are used when the buffer is displayed in a
window. Having the tab stop as an attribute of a buffer allows different buffers and files to have different tab
stops.

Undo Information

Each buffer has an undo list associated with it. The undo list allows changes made to the buffer to be
undone. This feature can be turned off for any buffers. Turning off the undo feature can be useful for two
reasons. Firstly, operations are faster if this information does not need to be saved. Secondly, disk space
can be saved if a voluminous edit is to be made on a very large file, e.g. global translate.

The undo information is stored in a temporary file, which is not visible via the normal ls(1) command.

Advertising