[Next] [Prev] [Right] [Left] [Up] [Index] [Root]
History

History

Magma provides a history system which allows the recall and editing of previous lines.

The procedure SetHistorySize(n) sets the number of lines saved in the history to n. (If n=0, no history is preserved.) The procedure GetHistorySize() returns the current n.

The history system is invoked by typing commands which begin with the history character %. Currently, the following commands are available:

 %p

List the contents of the history buffer. Each line is preceded by its history line number.

 %

Re-enter the last line into the input stream.

 %n

Re-enter the line specified by line number n into the input stream.

 %m n 

Re-enter the history lines in the range m to n into the input stream.

 %e

Edit the last line. The editor is taken to be the value of the EDITOR environment variable if it set, otherwise ``/bin/ed'' is used. If after the editor has exited the file has not been changed then nothing is done. Otherwise the contents of the new file are re-entered into the input stream.

 %en

Edit the line specified by line number n.

 %em n

Edit the history lines in the range m to n.

There are also two control characters which perform simple history tasks:

control-n (or down-arrow)

Go forward a line in the history buffer ("next").

control-p (or up-arrow)

Go back a line in the history buffer ("previous").

[Next] [Prev] [Right] [Left] [Up] [Index] [Root]