mirror of
https://github.com/PDP-10/its.git
synced 2026-02-03 07:20:35 +00:00
622 lines
24 KiB
Plaintext
Executable File
622 lines
24 KiB
Plaintext
Executable File
!* -*-TECO-*-!
|
||
|
||
!~Filename~:! !Tree-structured document file perusal program INFO.!
|
||
INFO
|
||
|
||
!& Info Enter:! !Info Enter:! !C Peruse documentation of system programs.
|
||
With null suffix argument, as in MM Info,
|
||
enters the hierarchy at the highest node,
|
||
or returns to the last thing you were looking at with Info.
|
||
A non-null suffix argument should be composed of words separated by
|
||
spaces, which are used as a "pathname" of successive menu items
|
||
to look up. A negative numeric arg means to interpret the
|
||
suffix arg as a node name (a la the G command).!
|
||
|
||
:I*[3 !* Read arg before pushing qregs so ^]1 in arg wins.!
|
||
1F[BOTHCASE -F[FNAM SY 1F[^R MORE
|
||
[Previous_Buffer
|
||
QBuffer_Name[1 !* Push the selected buffer!
|
||
FN M(M.M Select_Buffer) 1 [1
|
||
M(M.M Select_Buffer)*INFO* !* and select a special one for INFO.!
|
||
[..J !* Push ..J now; Select Node sets it.!
|
||
FS RGETTY"E 1M.V INFO_Inhibit_Typeout' !* We may be about to visit several nodes!
|
||
!* sequentially, and it would be a loss to type the 1st 4 lines of each.!
|
||
QBuffer_Filenames"E !* If INFO buffer was just created (no node in it yet),!
|
||
500FS Q VEC M.V INFO_Nodes !* create the stack of visited nodes!
|
||
:I*(DIR) M(M.M &_Info_Select_Node)' !* and start by visiting the directory.!
|
||
FQ3"G !* If our string arg is non-null,!
|
||
"LQ3M(M.M&_Info_Select_Node)'"# !* It is either a node to Goto!
|
||
F[B BIND G3 32I J !* or it is a list of menu items to trace.!
|
||
< :S_;R IM2 S_R @I//> !* Make a series of M2arg's, one for each arg!
|
||
1:< M(HFX*( M.M&_Info_Trace_MenuU2
|
||
F]B BIND
|
||
:I*(DIR) M(M.M&_Info_Select_Node)
|
||
))>F"L @:FG''' !* Then run it, down from top.!
|
||
FS RGETTY"E 0UINFO_Inhibit_Typeout
|
||
4L-4T
|
||
FT
|
||
If_this_is_your_first_time_using_INFO,_type_H.
|
||
That_will_start_you_on_a_course_in_using_INFO.
|
||
Type_"?"_for_a_brief_refresher.
|
||
!''! '
|
||
Q:Info_Nodes(0)U3
|
||
:I..J INFO_documentation_reader__Node_3__ !* Put node's name in MORE line.!
|
||
FS ^R MODE"N :M(M.M&_Info_Loop)'
|
||
!* INFO expects to be inside a ^R. If that isn't so, we must call
|
||
a ^R, after arranging for the ^R to call Info Loop.!
|
||
FS ^R ENTER[1
|
||
:I* Q1 F[^R ENTER
|
||
M(M.M&_Info_Loop)
|
||
FS ^R EXIT
|
||
F[^R ENTER
|
||
|
||
|
||
|
||
!& Info Loop:! !C INFO's command-reading loop.!
|
||
|
||
!* We read a character, then call the macro "# INFO <that character>".
|
||
For control characters such as ^X, we use # INFO ^X", with an uparrow.!
|
||
|
||
[1 [2
|
||
QEMACS_Version-140"L -F[NOQUIT'
|
||
F<!Info-catch!
|
||
@:<
|
||
@V
|
||
@:FIU1 FI:FCU2 @FT 2 !* Read and echo character, converted to upper case.!
|
||
Q2-"E !<!>' !* ^R means call ^R recursively.!
|
||
Q2-40."G :I1#_Info_2'
|
||
"# Q2+100.U1 :I1 #_Info_^1'
|
||
1,M.M 1U1 !* Find the macro for this command.!
|
||
Q1"E :I*Illegal_Command:_2 @:FG !<!>' !* Complain if can't find it.!
|
||
M1 !* If it exists, call it.!
|
||
!* Command may assume that Q2 holds the character.!
|
||
>U1
|
||
QEMACS_Version-140"L
|
||
@FE QIT-Q1"N :Q1'@FG' !* Get here on error in loop: print message and go on.!
|
||
>
|
||
|
||
|
||
!# Info ?:! !& Print documentation on INFO.!
|
||
FS RGETTY"E
|
||
FT On_printing_terminals,_Space_prints_ten_more_lines
|
||
and_T_prints_all_the_rest_of_the_node_you_are_in.
|
||
After_an_F_or_M,_?_will_print_a_brief_list_of_the
|
||
footnotes_or_menu_items_you_can_choose_from.
|
||
After_that,_you_are_still_expected_to_type_one,
|
||
or_Rubout_to_cancel.
|
||
|
||
'
|
||
M.M ~Doc~_&_Info_Description[1
|
||
:FT1
|
||
|
||
!& Info Description:! !INFO command brief description:
|
||
|
||
? show this brief description.
|
||
H visit a tutorial to teach you how to use Info.
|
||
Space show next screenful of this node.
|
||
Backspace
|
||
show previous screenful of this node.
|
||
B show Beginning of this node.
|
||
N go to Next node in a sequence.
|
||
P go to Previous node in a sequence.
|
||
U go Up to this node's father.
|
||
M display this node's Menu and go to something listed
|
||
therein. If you see "* item: node", type M item <cr>.
|
||
1 - 5 go to 1st (etc) subnode in the menu.
|
||
F go to a Footnote. If you see "*Note name: node",
|
||
you type F name <cr>. Use L command to come back.
|
||
D go to Directory node (the top node, from which all
|
||
other nodes can be reached with one or more M's).
|
||
Q, ^] exit from Info.
|
||
^Z,^C return to superior job (HACTRN, usually).
|
||
L go back to Last node visited before this one.
|
||
^L redisplay the screen.
|
||
X eXecute EMACS extended command.
|
||
K show all lines containing a specified Keyword. You type
|
||
K keyword <cr> and all those lines are printed.
|
||
Then, use the S command specifying the desired context.
|
||
S Search whole file for string. Type S string <cr>.
|
||
G Go to node. Type G nodename<cr>. Filename may be included.
|
||
* as nodename means "the whole file".
|
||
^R Edit this node with EMACS.
|
||
O Output (append) this node to file. Type O filename <cr>.
|
||
!
|
||
!* This macro exists just to carry documentation, which ? prints.!
|
||
!Make the body non-empty!
|
||
|
||
!# Info D:! !S Visit the Info directory node.
|
||
This node has all files as subnodes.!
|
||
:I*(DIR) :M(M.M&_Info_Select_Node)
|
||
|
||
!# Info H:! !S Visit the course in using Info.!
|
||
FS RGETTY"E :I*(INFO)Help-Printing :M(M.M &_Info_Select_Node)'
|
||
FS HEIGHT-24"L :I*(INFO)Help-Small-Screen' !
|
||
! "# :I*(INFO)Help' :M(M.M &_Info_Select_Node)
|
||
|
||
!& Info Select Node:! !S Selects a node specified by name.
|
||
The node name as a string should be a prefix argument.
|
||
A node name may contain a filename, as in (INFO;DIR >)TOP.
|
||
If there is no filename, the current file is the default.
|
||
If there is no node name, the default is TOP.!
|
||
|
||
[2 -1[3 [4 !* Get node name.!
|
||
.[P !* Remember old point, to save for later L command.!
|
||
FN
|
||
FQ2"E O No File'
|
||
<%3:G2-32:@;> !* Remove leading spaces from arg.!
|
||
Q3,FQ2:G2U2
|
||
0:G2-("N O No File'
|
||
!*** If the node name specifies a file, yank it.!
|
||
F[B BIND
|
||
G2 J !* First, put node name in buffer to extract filename.!
|
||
:S)"E :I*Bad_Node_Name:_2 FS ERR'
|
||
1,.-1FX3 !* Q3 has filename.!
|
||
-DD HFX2 !* Q2 has node name within file!
|
||
F]B BIND
|
||
F[D FILE
|
||
ET DSK:INFO;DIR_>
|
||
FS OSTECO"N ET_INFO !* On Twenex, default extension is INFO.!
|
||
1F[ FNAM SY'
|
||
ET3 !* Merge defaults into specified filename.!
|
||
FS D FILE U3 !* Get merged names as string.!
|
||
F=(QBuffer_FilenamesF"E :I*')3"N !* Is it the same file as looking at now?!
|
||
ER EC !* Open file just so get error if non-existent.!
|
||
@:I..N| Q:Info_Nodes(0)M(M.M&_INFO_Select_Node) QPJ|
|
||
!* If we don't find the node, switch !
|
||
!* back to previous file and reselect node.!
|
||
1,M(M.M Visit_File)3
|
||
:I* *M(M.M&_INFO_Set_Modeline)
|
||
0M.VINFO_Tags_Pointer !* First assume info file has no tags table,!
|
||
1F[BOTHCASE
|
||
ZJ -10:FB End_Tag_Table:"L !* then see if that's true.!
|
||
-S
|
||
tag_table: l !* If not, remember addr (relative to Z) of tag table start!
|
||
.-Z UINFO_Tags_Pointer'
|
||
J
|
||
'
|
||
!No File!
|
||
.[1 0F[VB 0F[VZ FN Q1J !* Save current point and bounds in case node not found!
|
||
FS QP PTRU3
|
||
FQ2"E :I2 Top' !* (default is Top).!
|
||
F=2 *"E O Win' !* Node name of "*" means whole file.!
|
||
J
|
||
QINFO_Tags_PointerF"N+ZJ !* If this info file has a tag table, search it. Go to it!
|
||
:SNode:_2›"L !* Find entry in it for desired node.!
|
||
\J :1000R"E J'' !* Go to that node's approx. location (a little before).!
|
||
"# ZJ'' !* Not in tag table => make next search fail fast.!
|
||
!* Note that we don't win if the node moves very far and you don't regenerate the tag table.!
|
||
< :S"E :I*No_Such_Node:_2 FS ERR'
|
||
2:FB Node:"E !<!>'
|
||
@F_ R
|
||
FQ2 |