1 :Info: ted: TED:
   2 12/10/86  ted
   3 
   4 Function:  The ted command is used to create and edit ASCII segments
   5 and is used to perform many kinds of text processing.  It can be called
   6 as an active function and be invoked recursively to a depth of 14.
   7 
   8 
   9 Syntax:  ted {ted_com} {-control_args}
  10 
  11 
  12 Arguments:
  13 ted_com
  14    reads the contents of the named segment into buffer (exec) and
  15    executes it.  The ted suffix is supplied if not present.  When the
  16    contents of buffer (exec) is exhausted, request lines are read from
  17    user_input unless the -abort argument (below) is present.
  18 
  19 
  20 Control arguments:
  21         See "Notes" below as regards the execution sequence of
  22         arguments, and list of undocumented control segments.
  23 -abort
  24    exit the program if an error occurs while executing a ted_com
  25    instead of returning to ted request level.  (For historical
  26    compatibility, "-com" may be used for this function.)
  27 -arguments args, -ag args
  28    makes the argument list args available during the processing of
  29    a ted_com.  The args may be referenced either in buffers
  30    (arg1), (arg2), etc., or line 1, line 2, etc.  of buffer
  31    (args).  None of these buffers show up on an x request list
  32    until they have been referenced.
  33 
  34 
  35 -debug, -db
  36    instructs ted to display "Edit ."  before accepting a request
  37    line from user_input.  This control is useful for detecting
  38    when a ted_com "falls" back to request level.  The -abort
  39    argument (above) detects when a ted_com "falls" back to request
  40    level, but does not leave you in a position to examine the
  41    environment.
  42 -option STR1{,...STRn}, -opt STR1{,...STRn}
  43    sets the options specified by STRi before anything else is
  44    accomplished during ted startup.  STR is any option setting
  45    which may be given to the "o" request.  Multiple options
  46    must be separated by either a comma (,) or a space ( )
  47    character.  If space is utilized as the separator, then
  48    the whole string must be in quotes.
  49 
  50 
  51 -pathname path, -pn path
  52    begin ted execution by reading segment path into buffer(0).
  53 -pause
  54    interrupts execution of a ted_com (to ted, this simulates
  55    encountering a breakpoint at the beginning of the next line in
  56    EDIT mode).  The next time a request line is fetched, the input
  57    routine enters the break sequence.  This argument is valid
  58    only after having interrupted a ted execution.  (This argument
  59    is mutually exclusive with all other control arguments.)
  60 
  61 
  62 -request STR, -rq STR
  63    executes STR as a ted request line before entering the request loop.
  64    For example:
  65 
  66         ted -pn foo -rq "gd/abc/w" -rq "q"
  67 
  68    deletes all instances of "abc" in the foo segment, writes it back,
  69    and then quits.
  70 
  71 
  72 -reset {level}
  73    breaks out of a ted_com loop and returns to ted request level.
  74    The optional "level" is a two-digit number specifying the ted
  75    recursion level to be returned to.  If level is not specified,
  76    then the most recent invocation is assumed.  This argument is
  77    valid only after having interrupted a ted execution.  (This
  78    argument is mutually exclusive with all other control
  79    arguments.)
  80 -restart
  81    restarts a -safe environment which was left due to a system
  82    crash, process interruption, or overt user action (see
  83    qhold request).  If only one environment exists, it is
  84    restarted.  If more than one exists, all are listed and the
  85    user is asked which invocation to restart.
  86 
  87 
  88 -safe
  89    places the active ted work segments in the user's default
  90    working directory so that the environment is saved in case of a
  91    loss such as a system crash.  It also displays a warning if
  92    there are any existing environments.
  93 -status, -st
  94    generates a list of existing "-safe" environments.  (This
  95    argument is mutually exclusive with all other control
  96    arguments.)
  97 
  98 
  99 -temp_dir path, -td path
 100    saved environments are normally kept in the home directory.  In
 101    some cases there may not be enough quota for the work to be
 102    done.  This argument allows an environment to be placed
 103    elsewhere.  When this control argument is given, a link is
 104    created in the home_dir to the data base for the environment,
 105    so that -status and -restart know what exists.  The link is
 106    removed in cleaning up an environment.  The -status listing
 107    indicates where any remote environments actually are.
 108 
 109 
 110 Notes:  Several of the arguments cause a portion of a "script" to be
 111 created for ted to follow.  The sequence in which arguments contribute
 112 to the script, regardless of the sequence used in the command line (top
 113 to lowest priority) is:
 114 
 115     -option, -pathname, -request, ted_com, -abort, and -debug
 116 
 117 
 118 List of requests:
 119 " (comment)
 120 # (if line)
 121 ^# (if-not line)
 122 % (call buffer)
 123 * (if expression found)
 124 ^* (if expression not-found)
 125 .. (execute)
 126 : (define label)
 127 > (transfer of control)
 128 ^> (error exit)
 129 = (print linenumber)
 130 \? (where am I?)
 131 {} (evaluate)
 132 |xxx (external request call)
 133 
 134 
 135 ~ (return)
 136 a (append)
 137 !a (bulk append)
 138 b (change buffer)
 139 !b (change buffer remembering)
 140 ^b (delete buffer)
 141 c (change)
 142 !c (bulk buffer)
 143 d (delete)
 144 e (execute)
 145 !e (print and execute)
 146 f (fileout into buffer)
 147 !f (fileout into buffer)
 148 g (global)
 149 g* (global-if)
 150 
 151 
 152 h (process out pseudo-tabs)
 153 help (online information)
 154 i (insert)
 155 !i (bulk insert)
 156 j (sort)
 157 !j (special sort)
 158 k (kopy, or copy)
 159 !k (kopy-append, or copy-append)
 160 l (linefeed to user_output)
 161 !l (linefeed to error_output)
 162 m (move)
 163 !m (move-append)
 164 n (nothing)
 165 o (option)
 166 p (print)
 167 
 168 
 169 !p (print with linenumber)
 170 q (quit)
 171 !q (force-quit)
 172 qhold (quit-hold)
 173 r (read)
 174 !r (abbrev-expand-read)
 175 ^r (force pathname)
 176 s (substitute)
 177 !s (no-fail substitute)
 178 t (type string to user_output)
 179 !t (type string to error_output)
 180 u (translate to lowercase)
 181 !u (translate to uppercase)
 182 v (exclude)
 183 w (write)
 184 
 185 
 186 !w (abbrev-expand-write)
 187 x (buffer status)
 188 !x (buffer status)
 189 y (tabin)
 190 z.fi.ad (fill/adjust)
 191 z.fi.na (fill/no-adjust)
 192 zdump (dump octal/ASCII)
 193 zif (conditional test)
 194 
 195 
 196 :Info: ted_act:
 197 06/03/80  ted_act
 198 
 199 Syntax:  e ted_act args
 200 
 201 
 202 Function:  causes args to be placed into b(act) of the current invoca-
 203 tion of ted.  args may contain abbrevs and/or active functions.  If
 204 multiple arguments are received by ted_act, they will be placed into
 205 b(act) separated by a VT (\013).  The user may then change this to
 206 whatever he wishes.
 207 
 208 
 209 Examples:  e ted_act [date_time]
 210 This puts the current date /time value into b(act).
 211 
 212 
 213 :Info: ted_buffer:
 214 06/03/80  ted_buffer
 215 
 216 Syntax:  e ...  [ted_buffer x]
 217 
 218 
 219 Function:  The active function ted_buffer is used to reference data in
 220 ted buffers.  It returns the pathname of the segment containing the
 221 data in b(x).  The bitcount of this segment gets set to properly
 222 reflect the amount of data present.  After returning from the "e"
 223 request, the bitcount of the segment will be used to determine the NEW
 224 length of the buffer data.
 225 
 226 
 227 Examples:  e ds [ted_buffer 0]
 228 This dumps the segment which contains the data of b(0).
 229 
 230 
 231 :Info: ted.new_features: new_features:
 232 11/08/82  ted(3.0) new features
 233 
 234 Purpose:  This info file lists features which have been added or
 235 upgraded in ted.
 236 
 237 
 238 List of features:
 239 -safe
 240    The format of a saved environment is changed.  Old environments are
 241    not restartable with the new ted.  Saved environments are named
 242    including a request-id just as dprint requests are.  In this way,
 243    multiple users in the same directory may be accomodated, either dif-
 244    ferent people or different instances of the same person.
 245 -temp_dir
 246    This allows the user to specify where the safe data is to be kept.
 247    A link to this environment is placed in the home directory so that
 248    -status and -restart can find it.  The link is removed when the
 249    environment is cleaned up.  (This implies -safe).
 250 -status
 251    This now gives a much more meaningful listing of the saved environ-
 252    ments.
 253 
 254 
 255 -restart
 256    When there is only 1 saved environment, it will be restarted.  If
 257    there are more than 1, they will be listed and the user asked which
 258    one he wants.  See note in ted info on the details of what may be
 259    done at that point.
 260 qhold
 261    When running as -safe or -temp_dir, this request may be used to exit
 262    from ted without losing the environment.  It may then be restarted
 263    at a later time.
 264 o comment="..."
 265    This sets a value to be displayed by -status (also "o").  If an
 266    environment is going to be saved over several executions, it will be
 267    helpful to have some identifying information other that the
 268    date/time when the execution originally began.
 269 
 270 
 271 Absolute buffer addressing.  @(X),adr
 272    The @ address prefix specifies that the address and request that
 273    follows is to be executed in the named buffer, reqardless of which
 274    one is current.
 275 Limited range expression search [adr]/RE/
 276    An address enclosed in []'s and preceding "/" or <"/" in an address
 277    causes the expression to be searched for only within the range spec-
 278    ified.  The forward search searches from beginning to end, the back-
 279    ward search searches from end to beginning.
 280 
 281 
 282 :Info: ted.old_features: old_features:
 283 11/08/82  ted(3.0) old features
 284 
 285 Purpose:  This info file lists features of ted which are being phased
 286 out.  In most cases there is no change in functionality, just in how to
 287 ask for the function.
 288 
 289 
 290 Control arguments:
 291 -com
 292    This is superceded by -abort.
 293 -blank
 294    This is superceded by -option blank
 295 -part_blank
 296    This requires the blank on only the a,c,i,d,r,e,w requests.
 297 -no_blank
 298    This is superceded by -option ^blank.  (default)
 299 -read
 300    This is superceded by -option read.  (default)
 301 -no_read
 302    This is superceded by -option ^read.
 303 -break
 304    This is superceded by -option break.
 305 -no_break
 306    This is superceded by -option ^break.  (default)
 307 
 308 
 309 -label
 310    This is superceded by -option flow.
 311 -no_label
 312    This is superceded by -option ^flow.  (default)
 313 -trace_edit
 314    This is superceded by -option edit.
 315 -trace_input
 316    This is superceded by -option input.
 317 -trace
 318    This is superceded by -option trace.
 319 -no_trace
 320    This is superceded by -option ^trace.  (default)
 321 -Jset {XX...}
 322    This functionality is now requested within ted via j/s=XX.../.
 323 -Jshow
 324    This is now requested from within ted via j/?/.
 325 
 326 
 327 List of out-of-date facilities:
 328 (read/write) A|b
 329    This references component b of the ted superfile A.
 330 (substitution) "o ct"
 331    This is superceded by {mct();}
 332 (evaluation) <cat> <aexp>
 333    This is an old form of <cat>||<aexp>.
 334 (evaluation) sk
 335    The subfile kind of the file associated with this buffer.   "|"
 336    "superfile" component
 337 
 338 
 339 :Info: input: append: a: !a: change: c: !c: insert: i: !i:
 340 12/01/78  Input operations
 341 
 342 Basic [a c i]:
 343 [.] a TEXT\f
 344    append TEXT after addressed line (location)
 345 [.,.] c TEXT\f
 346    change addressed text, replacing it with TEXT
 347 [.] i TEXT\f
 348    insert TEXT before addressed line (location)
 349 
 350    INPUT MODE inputs a string of characters, looking for and processing
 351    escape sequences.  Terminated by the escape "\F".
 352 
 353 
 354 Bulk [!a !c !i]:
 355 [.]!a <REST>
 356  LINES
 357  .
 358    append LINES after addressed line
 359 [.,.]!c <REST>
 360  LINES
 361  .
 362    change addressed text, replacing it with LINES
 363 [.]!i <REST>
 364  LINES
 365  .
 366    insert LINES before addressed line
 367 
 368    BULK MODE inputs lines of characters.  No escape sequences are
 369    processed.  Terminated by a line consisting of ".".  Anything which
 370    follows the request ("<REST>" below) is not input data.  It repre-
 371    sents additional requests which are then executed when the input is
 372    terminated.
 373 
 374 
 375 :Info: buffers: b: ^b: 'b: !b: b(): buffer: buffers: data:
 376 11/30/78  Buffers
 377 
 378 Basic [b]:
 379 b(X)
 380    make buffer X become the "current" one.
 381 
 382 
 383 Windowing [b(X,a)]:
 384 b(X,a)
 385    change current buffer to buffer X, but set a window as specified by
 386    the addresses.  Until the next buffer change, all requests will act
 387    as though the buffer contained only data within the window.
 388 
 389 
 390 Pushing/Popping [!b b()]:
 391 !b(X)
 392    change current buffer to buffer X, but first remember the current
 393    one in a LIFO stack.
 394 !b(X,a)
 395    change current buffer to a window of buffer X, remembering the cur-
 396    rent one.
 397 b()
 398    change current buffer, using the last one remembered.  (Up to 10 may
 399    be remembered at once.)  If an error occurs, the buffer stack is
 400    cleared.
 401 
 402 
 403 Deleting ['b ^b]:
 404 ^b(X)
 405    delete buffer X (remove from known buffer list).  X must not be cur-
 406    rent.
 407 
 408 
 409 Overview:  Input and editing operations are not performed directly on
 410 the target segments but in a temporary workspace known as a buffer.
 411 ted supports a virtually unlimited number of them.  One buffer at a
 412 time is designated as the "current buffer".  Requests operate on the
 413 current buffer unless explicitly told to do otherwise.
 414 
 415 When ted is entered, a single buffer named 0 is created and designated
 416 as current.
 417 
 418 
 419 Names:  Each buffer is given a name of from 1 to 16 ASCII chracters
 420 (except for "(", ")", ",", " ").  A name which consists of 1 character
 421 may be given as just that character.  A name which has more than 1
 422 character must be enclosed in parentheses.  Thus changing to buffer 1
 423 may be done with either "b1" or "b(1)".  All buffer names in this docu-
 424 ment are written as "(X)".
 425 
 426 A buffer name may be followed by an address.  In this case the
 427 name,address must always be enclosed in parentheses regardless of name
 428 length.  All buffer names with address in this document will be written
 429 as either "(X,l)" or "(X,a)" depending on whether a line only is
 430 allowed or whether any kind of address is acceptable.
 431 
 432 
 433 :Info: delete: d:
 434 12/02/78  Delete
 435 
 436 [.,.] d
 437    delete addressed text
 438 
 439 
 440 :Info: execute: e: E: !e: ..:
 441 01/29/81  Execute Multics command line
 442 
 443 e <REST>
 444    execute Multics command line <REST>
 445 !e <REST>
 446    print, then execute Multics command line <REST>.  Request may also
 447    be given as "E".
 448 .. <REST>
 449    This form requires the ".." to be the first two characters of a
 450    line.  <REST> is executed without any input function expansion
 451 
 452 
 453 01/29/81 Change:  The ".." form now does not do input function
 454 processing on the line.
 455 
 456 
 457 :Info: fileout: f: !f: F:
 458 03/20/80  Fileout to buffer
 459 
 460 Basic [f]:
 461 f(X) <REST>
 462    fileout into buffer X.  Fileout is terminated at end of request
 463    line.
 464 
 465 
 466 Continuing [!fX !f<NL>]:
 467 !f(X)
 468    fileout into buffer X.  Not automatically terminated.  May also be
 469    entered as "F"
 470 !f<NL>
 471    terminate fileout begun by the prior form.
 472 
 473 
 474 :Info: global: v: g: g*:
 475 09/09/85  Global
 476 
 477 Overview:  There are three kinds of these requests, global-inclusive
 478 (g), global-exclusive (v), and global-if (g*).  The first two go thru
 479 the buffer a line at a time, searching each line for the presence a
 480 given regular expression, <RE>.  The g requests process the line if a
 481 match is found.  The v requests process the line if a match is not
 482 found.
 483 
 484 The global-if goes thru the buffer a line at a time, but it test each
 485 line for a (possibly) complex logical condition made up of <RE>'s and
 486 <eval>'s.  If a TRUE results, then (potentially) several operations are
 487 done on the line.
 488 
 489 
 490 List of g/v requests [g= gd gp gP]:
 491 [1,$] g=`<RE>`
 492    print line numbers
 493 [1,$] gd`<RE>`
 494    delete
 495 [1,$] gp`<RE>`
 496    print
 497 [1,$] g!p`<RE>`
 498    print with line numbers.  May also be entered as "gP".
 499 
 500 
 501 If [g*]:  The global-if request offers a great deal of selection capa-
 502 bility and request power.  It has these forms:
 503     g*<search><SP><requests>
 504     g*<SP><requests>
 505     g*//<SP><requests>
 506     g*<NL>
 507 <search>
 508    is a logical expression made up of <operand>'s and the operators
 509    "|", "&", "^", "(", ")".  If <search> is not present, then every
 510    line is to be processed.  If <search> is "//" it means to use the
 511    same <search> as on the last g*.  If nothing follows the g*, it
 512    means to execute the exact same g* as the last one.
 513 <operand>
 514    is either a regular expression, /<RE>/, or an evaluation,
 515    { <eval> }.  No blanks may surround the operators.
 516 <SP>
 517    is a REQUIRED space.  The first space encountered separates the
 518    <search> portion from the <request> portion.
 519 <requests>
 520    is one or more sub-requests, separated by spaces.
 521 
 522 
 523    The logical expression is processed in an optimal fashion.
 524 /<RE>/ is TRUE if a match is found, is FALSE otherwise.
 525 { <eval> } return value is examined.  "0" or "false" is FALSE, anything
 526    else is TRUE.
 527      /a/&/b/&/c/ will fail immediately if "a" is not found.
 528      /a/|/b/|/c/ will match immediately if "a" is found.
 529    This means that "/abc/&{a[10]:=a[10]+1}" will increment a[10] when-
 530    ever a line contains an "abc".
 531 
 532 
 533 Allowable g* sub-requests:  Most of these are identical in function to
 534 the corresponding requests, except where noted below.
 535 [  ($)] a<SP>string\f
 536 [(1,$)] c<SP>string\f
 537 [  (1)] i<SP>string\f
 538 [(1,$)] d
 539         l
 540         !l
 541 [(1,$)] m(X)
 542 [(1,$)] !m(X)
 543 [(1,$)] k(X)
 544 [(1,$)] !k(X)
 545 [(1,$)] p
 546 [(1,$)] P
 547 
 548 
 549         t`...`
 550         !t`...`
 551 [(1,$)] u`<RE>`
 552 [(1,$)] !u`<RE>`
 553         { <eval> }
 554         >X
 555    X may be any of these forms "C", "(xxx)", "+n", "-n"
 556         =
 557    prints a 6-digit linenumber, with no NL.
 558 [(1,$)] s`<RE>`<REPL>`
 559    This is like the "S" request, in that a substitute-failed does not
 560    cause any message and does not abort processing the g*.  There is an
 561    additional facility
 562     in <REPL>.  "\g{ <eval> }" calls for an evaluation whose returned
 563    value is substituted in.  The string matched is available as "Ks"
 564    during evaluation.  It differs from \{} in that \{} is expanded
 565    while the request line is being built, whereas this form is expanded
 566    each time the <REPL> is used.  "."  is set to the line being
 567    examined, the g* terminates by executing the goto
 568 
 569 
 570 The total global-if expanded request line is limited to 512 characters.
 571 
 572 The addressing is numeric only.  "(1,3)" and "($-10,$)" are examples.
 573 If either address specified does not exist on any particular line, then
 574 the request is skipped on that line.  (1,10)p will be skipped if there
 575 are not 10 characters on the line.
 576 
 577 
 578 Examples g*:
 579 g*/^--/ s/those/these/ s|which|that|
 580    Change "those" to "these" and "which" to "that" on every line which
 581    begins with a "--".
 582 1,200g*/if/|/then/ p
 583    Print every line in the first 200 which contain either an "if" or a
 584    "then".
 585 {a[1]:=0} g*/:$/&{a[1]:=3;1}|{a[1]} P {a[1]:=a[1]-1}
 586    Print, with line number, every line which ends with a ":" and the 2
 587    lines which follow.  The logical expression procedes like this.
 588      if :$ is found, then set a[1]:= 3 and return a 1 for success.
 589      otherwise return a[1], which will be success if ^=0.
 590      On success, print/linenumber and then decrement a[1] by 1
 591 g*/SEE/&^/SEE:/ P
 592    All occurances of "SEE" in a file are to be followed by a ":".  This
 593    request shows all which do not.
 594 
 595 
 596 07/16/81 Change:  A g* request may now be followed by a comment.
 597 
 598 
 599 01/29/81 Change:  Documentation of two additional formats:
 600 g*//<SP><reqests> and g*<NL>
 601 
 602 
 603 :Info: h: tabout: tab: tabs:
 604 03/20/80  Process out pseudo-tabs
 605 
 606 [.,.] h`C,n,n...`
 607    convert pseudo-tab C to spaces using tabstops defined by n,n,...
 608    Tabstop specifications are of this form:
 609        n - set text left
 610        nL - set text left
 611        nC - set text centered
 612        nR - set text right
 613    "n" represents the column where the character following the tab
 614    character is to be placed.  It must be in the range 1 thru 200.
 615 
 616    When the left or center options are selected, they apply to the text
 617    leading up to the tabstop.  The location of each tabstop in turn is
 618    remembered.  Then when a left/center is called for, the data since
 619    the last tabstop is involved.  The number of spaces needed is calcu-
 620    lated; then if centering, half of this number is placed before the
 621    data and the rest after.  Otherwise all the spaces are placed before
 622    the data.
 623 
 624 
 625 :Info: sort: sorting: collate: j: J: !j:
 626 10/28/82  Sorting
 627 
 628 Basic [j]:
 629 [1,$] j`key,key ...`
 630    sort addressed text on specified keys
 631 [1,$]!j`s,key,key ...`
 632    sort addressed text on specified keys with user specified collating
 633    sequence.
 634 
 635 
 636 Sort keys:  A sorting specification is an optional series of key
 637 specifiers which may include a duplicate suppression specifier.  If no
 638 key is specified, e.i.  j//, the default is as if you had typed j/1:$/.
 639 
 640 A key specifier has these four parts:
 641   {order} from X to
 642 The "order" may be "a" or "A" for ascending, "d" or "D" for descending
 643 and is optional (assuming "a").  The "from" represents the character
 644 number where the sort key begins.  It may be specified as "n", "$", or
 645 "$-n".  "n" is a number and "$" means end-of-line.  The "X" is the sep-
 646 arator and may be "," or ":".  The "to" represents the length of the
 647 key in one of to ways.  If the separator is "," then it is a number
 648 which is the length of the key (or "-" for rest of record).  If the
 649 separator is ":" then it represents the character number where the key
 650 ends.  It may be in any of the forms shown under "from".
 651 
 652 
 653 Duplicate suppression:  The last two call for elimination of dupli-
 654 cates.  When duplicates exist, if duplicates are being dropped, the
 655 last one in the file will remain.  Otherwise, they will remain in the
 656 order they had to start with.  A duplicate is determined by the speci-
 657 fied keys being equal; the rest of the record is not examined.  The
 658 last form calls for the count to be placed in the record beginning at
 659 character "n" and with length "l".
 660       WARNING:  this count field MUST exist in each record.
 661 No check is made to see if it is within the limits of the record.
 662 
 663 If no keys are given, "a1,-" is assumed.
 664     'xxx can precede the first key.  This specifies the record
 665 delimiter to use.  "xxx" is 3 octal digits.  The default is '012.
 666 
 667 
 668 Using a special collating sequence:
 669 j`s=`
 670    Set the special collating sequence to its default value
 671    (uppercase=lowercase).  This is as if you had typed:
 672      j/s='000->'177'000->'177'200->'777'777a->zA->Z/
 673 
 674 
 675 j`s=XX...`
 676    First set the special collating sequence to its default value and
 677    then adjust it as specified by XX....  Each X represents a mapping
 678    pair in one of these forms:
 679     CC map first character to second
 680     X->YC map range of characters to second
 681     X->YX->Y map range of characters to range of characters.  Ranges
 682    must be
 683              of equal size.
 684    X->Y means the contigious characters X through Y.  X must be less
 685    than Y in the 9-bit collating sequence.  X and Y are any of the C
 686    forms.  (When a character is mapped to '777 it means to ignore it.)
 687    C is any of 3 forms
 688       'ooo ooo is 3 octal characters
 689       'Z Z is any non-octal digit
 690       Z Z is any character except ' (which must be entered as '')
 691 j`?`
 692    Display the special collating sequence.  Characters will be shown in
 693    "bunches" of perhaps 1 character.  Each character in a bunch has the
 694    same collating value.  The earlier bunches sort lower than the lat-
 695    ter ones.
 696 
 697 
 698 Examples:
 699 j/7,2,1,5/
 700    Sort all the lines of the buffer which begin with dates in the form
 701    mm/dd/yy, sorting into calender sequence.
 702 j/=,7,2,1,5/
 703    This is the same sort, except any duplicates are to be removed.
 704 1,$s/^/00000     / j/17,2,11,5,=1,5/
 705    The same sort again, except this time you want to know how many
 706    there were of each.  The first request makes room for the count.
 707    Then, since 10 characters were added to the front of each line, the
 708    offsets into the record had to be adjusted.
 709 
 710 
 711 11/09/82 Change:
 712  1) Keys may also be located with respect to the end of the line.
 713  2) The end of the key may be specified by character number.
 714  3) Setting/using/displaying the special collating sequence is now done
 715     via the sort request.
 716 
 717 
 718 :Info: copy: kopy: k: !k: K:
 719 12/02/78  Copy
 720 
 721 Basic [k]:
 722 [.,.] k(X)
 723    kopy addressed text to buffer X.  Previous contents of b(X) is lost.
 724    If the target buffer contains a modified file, ted asks if you wish
 725    to overwrite it unless you are running in -abort mode or are running
 726    as ted$qedx.
 727 
 728 
 729 Append [K(X) K(X,l)]:
 730 [.,.]!k(X)
 731    kopy-append addressed text to buffer X.  New data is placed at the
 732    end of b(X).  Request may also be entered as "K".
 733 [.,.]!k(X,l)
 734    open up a hole in buffer X after location l and into it copy the
 735    addressed text
 736 
 737    The current buffer may be the target of the copy-append.  There are
 738    no restrictions on where you can put the data.
 739 
 740 
 741 :Info: move: move-append: m: M: !m:
 742 03/20/80  Move
 743 
 744 Basic [m]:
 745 [.,.] m(X)
 746    move addressed text to buffer X.  X cannot be the current buffer.
 747    Any prior data in X is lost.  If the target buffer contains a
 748    modified file, ted asks if you wish to overwrite it unless you are
 749    running in -abort mode or are running as ted$qedx.
 750 
 751 
 752 Append [M(X) M(X,l)]:
 753 [.,.]!m(X)
 754    move-append addressed text to buffer X.  New data is placed at the
 755    end of b(X).  Request may also be entered as "M".
 756 [.,.]!m(X,l)
 757    open up a hole in buffer X after location l and into it move the
 758    addressed text Any prior data in X is retained.
 759 
 760    The current buffer may be the target of a move-append, but the place
 761    specified must not be in the range being moved.
 762 
 763 
 764 Overview:  When data is moved, it is deleted from where it was.  The
 765 only copy of the data exists in the target buffer.  So when data is
 766 moved to another buffer, it is marked as unused until it is utilized
 767 via the "r" request or "\bx" function, or is deleted.  Quit will com-
 768 plain as long as there is unused data left in some buffer.
 769 
 770 
 771 :Info: nop: n: !n:
 772 12/05/78  Nop
 773 
 774 [.] n
 775    set "."  to address
 776 [.,.] !n
 777    set "."  to the RANGE addressed.
 778 
 779 
 780 :Info: options: o:
 781 07/16/81  o -  Options request
 782 
 783 Displaying:
 784 o
 785    display current option settings.  The result will be a line like
 786    this:
 787       NAME(VR)[NN] global-options local-options
 788     * TED is the name under which ted is being run, i.e "ted"
 789     * VR is the current version/revision of ted, i.e "2.5"
 790     * NN is the recursion number for ted, i.e.  "01"
 791     * global-options are options which are shared between all
 792    recursions of ted; they are good for the current process.
 793     * local-options are those which are effective only within this
 794    invocation of ted.
 795 
 796 
 797 Setting:
 798 o xxx ...
 799    xxx is a space or comma separated list of options to be turned
 800    on/off.
 801 
 802    This request uses up the rest of the line.
 803 
 804 
 805 Global options:
 806 blank, ^blank
 807    This controls the requirement that there be at least one blank
 808    between multiple requests on one line.
 809 caps, ^caps
 810    This controls the utilization of capital letters for requests.
 811 resetread, ^resetread
 812    Do/dont't do a resetread on user_input if an error occurs.
 813 
 814 
 815 Local options:
 816 break, ^break
 817    Process the \037 character as a BREAK in EDIT mode, otherwise, skip
 818    it.
 819 edit, ^edit
 820    This controls the display of lines in EDIT mode before processing.
 821 input, ^input
 822    This controls the display of lines in INPUT mode before processing.
 823 trace, ^trace
 824    This turns both input and edit on or off together.
 825 label, ^label
 826    This controls the display of labels as encountered.
 827 read, ^read
 828    When a read is done in an empty buffer, reference the file in place
 829    instead of copying it.  (Default on)
 830 old-style, ^old-style
 831    This controls whether the old (645 days) form of \B \C \F \R are
 832    recognized within ted_coms.  (DEFAULT on)
 833 tablit, ^tablit
 834    In the "h" request, HT chars are literal.  i.e.  whenever enclosed
 835    in a quoted string, do not remove, just account for the "room" used
 836    up.  (DEFAULT off)
 837 (string, ^string)
 838    Operating in STRING mode.  This is set only by \s and \l.  Displayed
 839    for information purposes only.
 840 null=p, null=P, null=!p
 841    This sets the action to be taken when a null request is given.  A
 842    null request is an address which is followed by a NEWLINE.  (DEFAULT
 843    null=p)
 844 
 845 
 846 07/16/81 Change:  The options old-style and null= have been added.
 847 
 848 
 849 02/24/81 Change:  Options- edit,input,break,label have been made local.
 850 This means that they now apply only to the invocation of ted in which
 851 they are used.  The option "label" used to be named "flow".  The option
 852 "on" has been changed to "trace".  The option "off" has been changed to
 853 "^trace".
 854 
 855 
 856 :Info: print: p: !p: P: type: t: !t: T: linefeed: l: !l: L:
 857 03/21/80  Printing
 858 
 859 Basic [p !p <null>]:
 860 [.,.] p
 861    print addressed text
 862 [.,.]!p
 863    print addressed text with linenumbers.  Request may also be entered
 864    as "P".
 865 
 866 
 867 Null request:  When an address is given without any request following
 868 it, the addressed area is printed
 869 
 870 
 871 Literal data [t !t l !l]:
 872 t`STR`
 873    type; send STR to user_output (new-line not added)
 874 !t`STR`
 875    type; send STR to error_output (new-line not added).  May also be
 876    entered as "T".
 877 l
 878    send a NL to user_output
 879 !l
 880    send a NL to error_output.  May also be entered as "L".
 881 
 882 
 883 :Info: quit: q: !q: Q: exit:
 884 12/02/78  Quit
 885 
 886 Basic [q Q]:
 887 q
 888    quit from ted after checking for modified buffers.
 889 !q
 890    quit from ted without buffer check.  Request may also be entered as
 891    "Q".
 892 
 893 
 894 Abort execution:  There are two ways available to stop execution.
 895  1) if a print or global request is executing, it may be aborted by
 896 hitting the BREAK key and then typing "pi".  NO OTHER requests are
 897 terminated via this procedure.
 898  2) To terminate anything, hit the BREAK key and then type "ted
 899 -reset".  This makes believe an error has just occurred and unwinds
 900 execution back to ted request level.  All buffers are as they were at
 901 the time of interruption.
 902 
 903 
 904 Suspend execution:  If a ted_com is running and it appears to be in a
 905 loop execution can be suspended to allow examination of conditions.
 906 Hit the BREAK key and then type "ted -pause".  The next time a line of
 907 input is requested in EDIT mode, it will act as though a breakpoint had
 908 been encountered.  SEE:  break.
 909 
 910 
 911 Overview:  Any buffer which has an associated pathname is assumed to
 912 contain meaningful data.  b(0) is considered meaningful even if there
 913 is no pathname.  Whenever such a buffer is modified, it is flagged.
 914 When the buffer is written or if all the data is deleted, the flag is
 915 turned off.  This is a flag which the q request checks.
 916 
 917 Whenever data is moved to a buffer, it no longer exists in its old
 918 location.  The new buffer is the only place where it exists.  It is
 919 therefore flagged an not-pasted (from cut/paste terminology).  This
 920 flag is turned off by either doing a read, "r (X)", by invoking the
 921 whole buffer, "\bX", or by deleting it all.
 922 
 923 When a "q" is given, both of these flags are checked on all buffers.
 924 If any are so marked, they are listed and you will be asked if you
 925 still wish to quit.
 926 
 927 
 928 :Info: read: r: R: !r:
 929 07/16/81  Read
 930 
 931 Basic [r]:
 932 [$] r PATH
 933    append contents of segment PATH after addressed line
 934 [$] r
 935    append contents of a segment after addressed line.  The segment is
 936    that which is associated with this buffer.  It is an error if there
 937    is no associated segment.
 938 
 939 
 940 With abbrevs:
 941 [$]!r PATH
 942    read as above, PATH is abbrev-expanded before use.  Request may also
 943    be entered as "R".
 944 
 945 
 946 Buffer [r (X) r (X,a)]:
 947 [$] r (X)
 948    read contents of buffer X after addressed line
 949 [$] r (X,a)
 950    read addressed part of buffer X after addressed line
 951 
 952 
 953 Force pathname ['r ^r]:
 954 ^r PATH
 955    Do not read specified file, merely force pathname of buffer to be
 956    PATH.  Can then never be removed.  Thereafter, "r PATH" and "w PATH"
 957    are not allowed on the buffer.
 958 
 959 
 960 Pathnames:  The PATH used in read and write requests can specify vari-
 961 ous kinds of files.  These are the forms available:
 962   A::b this references component b of A.archive
 963   A this references segment A.
 964 
 965 Also, any PATH which begins with the string "[pd]" will get these 4
 966 characters replaces by the name of the process directory.
 967 
 968 
 969 Overview:  When "r PATH" is used and the buffer is empty, then PATH
 970 becomes associated with the buffer.  If the the buffer is not empty,
 971 then PATH is not remembered and if a name already is associated, it is
 972 flagged as not trustable (^trust).
 973 
 974 When any read is being done, a check is made to see if the sum of the
 975 present data and the new data will exceed the maximum segment size.  If
 976 this is true, then the resulting number of pages is displayed and the
 977 read is aborted.
 978 
 979 
 980 07/16/81 Change:  The old form of archive reading, via the "!"  charac-
 981 ter, has been completely removed.  All referenced must now use the "::"
 982 form.
 983 
 984 
 985 :Info: substitute: s: S: !s: change:
 986 03/21/80  Substitute
 987 
 988 Basic [s'<RE>'<REPL>']:
 989 [.,.] s`<RE>`<REPL>`
 990    substitute the string <REPL> for all strings in the addressed lines
 991    which match the expression <RE>.  SEE:  <RE> SEE:  <REPL>
 992 
 993 
 994 No-fail [!s S]:
 995 [.,.]!s`<RE>`<REPL>`
 996    no-fail substitute.  Acts just like the previous one except that the
 997    fail condition is never considered to happen.  This is for when you
 998    dont care whether the string is there or not, you just want some-
 999    thing done to any which might exist.  Request may also be entered as
1000    "S".
1001 
1002 
1003 WARNING:  If the expression has no match and execution is currently
1004 from a buffer, then execution will revert to the previous level with no
1005 error message being printed.  This condition can be caught, however.
1006 SEE:  ^>
1007 
1008 
1009 Overview:  Each time a match is found, it is replaced by whatever
1010 <REPL> implies.  If <REPL> ends in "$", this means that the NL is used
1011 in the search but is not included in the match.  The NL is skipped over
1012 before the next search is begun since some expressions could again
1013 match the NL.
1014    Also, "$" at the end cannot succeed on the last line of a buffer if
1015 there is no NL.
1016 
1017 
1018 :Info: u:
1019 03/21/80  Translate to lower case
1020 
1021 [.,.] u/<RE>/
1022    Each string which matches <RE> in the addressed range is translated
1023    to lower case.
1024 
1025 
1026 :Info: U:
1027 03/21/80  Translate to upper case
1028 
1029 [.,.] U/<RE>/
1030    Each string which matches <RE> in the addressed range is translated
1031    to upper case.
1032 
1033 
1034 :Info: write: w: W: !w:
1035 03/21/80  Write
1036 
1037 Basic [w]:
1038 [1,$] w PATH
1039    write the addressed text into the segment PATH.  SEE:  read
1040    pathname.
1041 [1,$] w
1042    write the addresset text into the segment associated with this buff-
1043    er.  It is an error if no name is associated.
1044 
1045 
1046 With abbrevs [!w W]:
1047 [1,$]!w PATH
1048    write, PATH is abbrev-expanded before use.  Request may also be
1049    entered as "W".
1050 
1051 
1052 Buffer [w (X)]:
1053 [1,$] w (X)
1054    write the addressed text into buffer X.  This is actually the k
1055    request with different defaults.
1056 
1057 
1058 Modified [wm]:
1059 wm
1060    write all modified buffers to their respecitive pathnames.  (This is
1061    available only when in BLANK mode.)
1062 
1063 
1064 :Info: status: x: X: !x: xm:
1065 03/21/80  Status of buffers
1066 
1067 Basic [x X xm]:
1068 x
1069    list all known buffers.
1070 !x<NL>
1071    list status for current buffer.  May be entered as "X".
1072 !x(X)
1073    list status for b(X).
1074 xm
1075    list all modified or unpasted buffers.  (This request only available
1076    in BLANK mode.)
1077 
1078 
1079 Format:  The output of the status request looks like this:
1080      3 -> mod (0)
1081    555 mod (a) [^trust] >udd>Multics>Falksenj>install>ted_info.ec
1082     15 (farble) m from b(a)
1083   1816 (info) >udd>Multics>Falksenj>install>ted_info.compin *
1084 The first column tells how many lines are in the buffer.  The second
1085 column has "->" to mark which buffer is current.  The third column says
1086 "mod" when the buffer has its modify status on.  Note that b(0) has a
1087 "mod" status even though there is no associated pathname.  The fourth
1088 column contains the name of the buffer.  The last column contains the
1089 associated pathname, if any.  It has a prefix of "[^trust]" when the
1090 name is not trusted.  After the pathname will be a "*" if the file is
1091 not-read, that is, it is being referenced directly instead of there
1092 being a copy in a buffer segment.
1093 
1094 
1095 :Info: y: tabin: tabs: tab:
1096 03/21/80  Tabin
1097 
1098 [.,.] y
1099    This goes thru the addressed string and replaces all blanks possible
1100    with HT characters.  It also removes any trailing whitespace.
1101 
1102 
1103 :Info: zif:
1104 03/19/80  zif - Conditional test
1105 
1106 zif { <eval> } <REST>
1107    Execute <REST> unless result of evaluating <eval> is "0" or "false".
1108    NOTE:  addresses may be present, but there is NO default.  If no
1109    address is present, then <eval> may not reference any of the buffer
1110    content builtins, e.g.  sb.
1111 
1112 
1113 :Info: linenumber: =:
1114 12/02/78  Linenumber
1115 
1116 [.] =
1117    print line number of addressed line
1118 
1119 
1120 :Info: call: |:
1121 03/01/80  External function call
1122 
1123 [.,.] |xxx <REST>
1124    Call external support routine ted_xxx_.  The blank after |xxx is
1125    required if <REST> exists.  This routine will be found via system
1126    search rules.  The way the addressed portion of the buffer and
1127    <REST> is determined by each particular routine.  "Standard" rou-
1128    tines will be available.  For info on writing a support routine,
1129    see:  ted_support.incl.pl1
1130 
1131 
1132 :Info: call: %:
1133 12/05/78  Call buffer
1134 
1135 %(X)`p1`p2...
1136    call buffer (X) passing parameters ` is the first character after
1137    the buffer name and may be a blank.  Each delimiter BEGINS a parame-
1138    ter.
1139       %x|a|b| gives 3 parameters, the third being a null string.
1140 
1141 
1142 :Info: *: ^*: '*:
1143 03/25/80  If expression found
1144 
1145 [.,.] "<RE>` <REST>
1146    search the addressed text for <RE>.  If found, execute <REST>
1147 [.,.]^"<RE>` <REST>
1148    search the addressed text for <RE>.  If not found, execute <REST>
1149    NOTE:  "'" may be used in place of "^".
1150 
1151 
1152 :Info: #: ^#: ^#:
1153 03/25/80  If-line
1154 
1155 # <REST>
1156    if current buffer contains data, execute <REST>
1157 A # <REST>
1158    if current line is A, execute <REST>
1159 A1,A2 # <REST>
1160    if current line is in range A1,A2, execute <REST>
1161 
1162 ^# <REST>
1163    if current buffer does not contain data, execute <REST>
1164 A^# <REST>
1165    if current line is not A, execute <REST>
1166 A1,A2^# <REST>
1167    if current line is not in range A1,A2, execute <REST>
1168    NOTE:  "'" may be used in place of "^".
1169 
1170 
1171 :Info: label: goto: ":": >:
1172 12/05/78  Transfer of control
1173 
1174 Label [:]:
1175 :C
1176    define label C.  C must be 1 character.
1177 :(C)
1178    define label C.  C can be 1-14 characters.  all labels must begin
1179    lines.
1180 
1181 
1182 Goto [>]:
1183 >C
1184    goto label C.  C must be 1 character.  Label to be found must have
1185    form :C
1186 >(C)
1187    goto label C.  C can be 1-14 characters.  Label to be found must
1188    have form :(C)
1189 >+n, >-n
1190    goto relative line.  n must be a single digit.  >-0 or >+0
1191    re-executes current line
1192 
1193 
1194 Error catch [^>]:
1195 ^>(C)
1196    don't goto label (C), remember it for the rest of the request line.
1197    If any error occurs, don't print the message; goto (C) instead.  The
1198    error message can then be printed by saying "{emt();}".  May also be
1199    entered as "'>".
1200 
1201 
1202 :Info: break: breakpoint:
1203 12/02/78  Breakpoints
1204 
1205 For ted_com debugging, ted has a breakpoint facility.  It is
1206    implemented via the \037 character.  The break mode can be set/reset
1207    with the control arguments -break/-no_break.  It can also set/reset
1208    with the option requests o break/o ^break.
1209       The break character is recognized only when in EDIT mode.  In
1210    order to enter the character, it may be concealed with the \c
1211    sequence.  The breakpoint character is treated in one of two fash-
1212    ions:
1213     ** NOBREAK mode - all occurances of of \037 are discarded.
1214     ** BREAK mode - any occurance of \037 is treated like a NL.  The
1215    request line being built is terminated and returned.  The next time
1216    a request line is asked for then the break message will be printed.
1217    After the break is continued, the character after the \037 becomes
1218    the first character of an request line.
1219 
1220 
1221 :Info: modes: input-mode: edit-mode: bulk-mode: read-mode: line-mode: string-mode:
1222 12/02/78  Modes
1223 
1224 
1225  INPUT mode is entered by "a", "c", and "i".
1226     BULK mode is entered by "!a", "!c", and "!i".
1227     READ mode is filling a "\r" function.
1228     EDIT mode is everything left over.
1229     BREAK mode is like EDIT mode except are stopped at a breakpoint.
1230 
1231    Line mode treats a file as a series of lines (delimited by the NL
1232    character).  The current location is a line in the file.  Entered
1233    during address processing by \l.
1234 
1235    String mode treats a file as a character string.  The current loca-
1236    tion is a character in the file.  Entered during address processing
1237    by \s.
1238 
1239    String mode interacts slightly with line and byte addressing and
1240    with string search.  For a comparison of line and string SEE:
1241    line/string
1242 
1243 
1244 :Info: line/string:
1245 03/12/80  Line mode/string mode comparison
1246 
1247 [\s \l .]:
1248 |+          +|+        line mode        +|+       string mode       +|
1249 +------------+---------------------------+---------------------------+
1250 | \s         |enters string mode         |stays in string mode       |
1251 +------------+---------------------------+---------------------------+
1252 | \l         |stays in line mode         |enters line mode           |
1253 |            |NOTE: \l and \s are considered address parts. The      |
1254 |            |mode can change any number of times during an address  |
1255 +------------+---------------------------+---------------------------+
1256 | /a.*b/     |"b" must follow "a" on same|"b" must follow "a" in     |
1257 |            |line                       |buffer i.e. the "." will   |
1258 |            |                           |match a NL                 |
1259 
1260 
1261 [line/byte addresses]:
1262 | address    |"a" is looked for, starting the line following the     |
1263 | /a.*b/     |current location, proceeding to end of buffer, then    |
1264 |            |from beginning of buffer to current location.          |
1265 +------------+---------------------------+---------------------------+
1266 | address    |"a" is looked for in the   |"a" is looked for in the   |
1267 | (/a.*b/)   |rest of the current line,  |rest of the buffer,        |
1268 |            |starting at the current    |starting at the current    |
1269 |            |byte.                      |byte.                      |
1270 +------------+---------------------------+---------------------------+
1271 | address    |will give message          |will address the first     |
1272 | 12($+1)    |  Addr- after line end     |character of line 13       |
1273 +------------+---------------------------+---------------------------+
1274 | 12(-1)     |will give message          |will address the NL of line|
1275 |            |  Addr- before line begin  |11                         |
1276 
1277 
1278 [= request]:
1279 | 2(3)=      |The line-byte address is   |Both the file address and  |
1280 |            |displayed.                 |line-byte address is       |
1281 |            |                           |displayed.                 |
1282 |            | 2(3)                      |                           |
1283 |            |                           | 0(9)     2(3)             |
1284 +------------+---------------------------+---------------------------+
1285 | 2(3)==     |The byte portion of the    |The byte portion of the    |
1286 |            |current location is not    |current location is        |
1287 |            |maintained from the first  |maintained from the first  |
1288 |            |request to the second.     |request to the second.     |
1289 |            |                           |                           |
1290 |            | 2(3)                      | 0(9)     2(3)             |
1291 |            | 2                         | 0(9)     2(3)             |
1292 
1293 
1294 [$ used in s request]:
1295 | 1,$s/c$/X/ |Buffer before:             |Buffer before:             |
1296 |            | 1   abc                   | 1   abc                   |
1297 |            | 2   crb                   | 2   crb                   |
1298 |            |                           |                           |
1299 |            |Buffer after:              |Buffer after:              |
1300 |            | 1   abX                   | 1   abXcrb                |
1301 |            | 2   crb                   |                           |
1302 |            |                           |The NL is used in          |
1303 |            |The NL is used in          |finding the string and is  |
1304 |            |finding the string but is  |included in it.            |
1305 |            |not included in it.        | Note: This function may   |
1306 |            |                           |be accomplished by a       |
1307 |            |                           |conceal of the NL:         |
1308 |            |                           | 1,$s/c\c\012/X/           |
1309 
1310 
1311 :Info: (X): (X,a): (X,l):
1312 03/12/80  Conventions- buffer names
1313 
1314 (X)
1315    This represents a general buffer name.  When the name consists of a
1316    single character, the ()'s are optional.
1317 (X,a)
1318    A buffer name may also be represented by "(X,a)".  The "a" repre-
1319    sents an address range.  Use of this form indicates that some part
1320    of a buffer is to be referenced.
1321 
1322    During the processing of the address, "."  will be the current loca-
1323    tion in that buffer.  Must not be referenced if it is not defined.
1324 (X,l)
1325    A buffer name in a M or K request may also be represented by
1326    "(X,l)".  In this case the parens are required.  The "l" represents
1327    a location (an address).  If a range should be given, the end of the
1328    range will be the location used.
1329 
1330    During the processing of the address, "."  will be the current loca-
1331    tion in that buffer.  Must not be referenced if it is not defined.
1332 
1333 
1334 :Info: cut: paste:
1335 12/02/78  Cut/paste
1336 
1337 One to one
1338    To cut out one piece of text and paste it in one place.  Assume you
1339    are in b(0) and want to move lines 3-5 to after line 9.  To accom-
1340    plish this you do..
1341       3,5M(0,9)
1342 Many to many
1343    To bring together several sets of lines and/or paste into several
1344    places you do something like this..
1345       3,5m1 13,30M1 102,112M1
1346       13r (1)
1347       89r (1)
1348 
1349    Note that each move and read done changes the line numbers.  Howev-
1350    er, if the moves were done this way it would not upset the
1351    linenumbers for the next move.
1352       102,112m1 13,30M(1,0) 3,5m(1,0)
1353    Likewise, the reads done in this way would not upset the linenumbers
1354    for the next one.
1355       89r (1)
1356       13r (1)
1357 
1358 
1359 :Info: <REPL>:
1360 03/19/80  <REPL> Substitute replace string
1361 
1362 "&" is replaced by the matched string.  "X\=" is replaced by a string
1363    of "X"s which is as long as the matched string.
1364 
1365 
1366 :Info: quote: """":
1367 12/05/78  Comment
1368 
1369 [.] "
1370    comment.  Set "."  to address and ignore rest of line
1371 
1372 
1373 :Info: if:
1374 03/17/80  Conditional execution
1375 
1376 
1377 Test for a given expression within a specified range.  SEE:  *
1378 
1379    Test for buffer empty, within specified line range.  SEE:  #
1380 
1381    Test for a complex logical condition.  SEE:  zif
1382 
1383    Execute if line does/doesn't match a given expression.  SEE:  g
1384 
1385    Execute requests on lines which fulfill complex condition.  SEE:  g*
1386 
1387 
1388 :Info: [: ]:
1389 10/12/82  [ ]
1390 
1391 
1392 Within ted "[ ]" are used to bracket subscripts within <eval>.
1393 
1394    Within ted_help "[ ]" are used in request descriptions to enclose
1395    the default address, if any.  For example,
1396      [.,.] d
1397    means that the d request takes 2 addresses and has the current line
1398    as a default address.
1399 
1400    The range of an address search may be limited by preceeding the
1401    search by an address withing []'s.  [1,4]/s/ looks for an s on lines
1402    1 thru 4.  [.,$]/some looks for "some" from here to the eind of the
1403    buffer (no wrap-around occurs).  [5,8]</abc/ begins on line 8 and
1404    searches backward thru line 5 looking for "abc".
1405 
1406 
1407 :Info: (: ):
1408 03/17/80  ( )
1409 
1410 Used to bracket byte addresses, multi-character buffer names,
1411    multi-character labels, arithmetic grouping within <eval>, and logi-
1412    cal grouping in g*.
1413 
1414 
1415 :Info: {: }:
1416 03/21/80  { } Evaluation
1417 
1418 { <eval> }
1419    An evaluation may be requested, it is not expected to return any
1420    value.  There is no default address.  However, 1 or 2 addresses may
1421    be given.  Values refering to buffer data are not defined if no
1422    address is given.  There is no default address in order that this
1423    request may be used in an empty buffer.
1424 
1425    "{" and "}" always bracket an <eval>.  Any use other than as
1426    mentioned above is a context where a value is expected:
1427          \{ <eval> } zif { <eval> } \g{ <eval> }
1428 
1429 
1430 :Info: * :
1431 03/25/80  * Operator
1432 
1433 "*" is the closure operator in a regular expression.  It matches
1434    0-or-more occurances of the character which preceeds it.  It is also
1435    the multiply operator within <eval>.
1436 
1437 
1438 :Info: expression: <RE>: regexp:
1439 12/11/78  Regular expression
1440 
1441 A regular expression is referrred to in ted-help as "<RE>".  It is a
1442    description of a string you wish to find.  Most characters in <RE>
1443    are taken literally.  These have a special meaning:
1444 ^
1445    as the first character of a regular expression will match the (fic-
1446    titious) character preceding the first one on a line.
1447 $
1448    as the last character of a regular expression matches the (ficti-
1449    tious) character after the last character of the line.  The new-line
1450    is not considered part of the line.  However, SEE:  string-mode
1451 *
1452    matches ZERO or more occurances of the character which immediately
1453    precedes the "*" in the regular expression.
1454 .
1455    matches any character
1456 \[n]x
1457    matches exactly n occurances of character x
1458 \[n].
1459    matches exactly n occurances of any character.
1460 \[n]\c.
1461    matches exactly n occurances of a period.
1462 
1463 
1464 :Info: address:
1465 12/11/78  Addresses
1466 
1467 Overview:  Many requests have addresses which specify what is to be
1468 acted upon.  Addresses occur before requests.  Some requests use a sin-
1469 gle address; some can have an address pair to specify a range to work
1470 on.
1471 
1472 There are two major parts to an address, the line part and the byte
1473 part.  This is the general format (both parts are optional):
1474    <line-address> ( <byte-address> )
1475 The line address references a line within a buffer.  The byte address
1476 references a byte within a line (however, for an exception to this,
1477 SEE:  string-mode).  A byte address is generally of the same form as a
1478 line address except that it is enclosed in parentheses.
1479 
1480 
1481 Absolute [<number> 0 $ .]:
1482 <number>
1483    When the first thing in an address is a number, it is an absolute
1484    reference.
1485     a) Absolute line number within buffer (e.g.  3,5p)
1486     b) Absolute character number within line (e.g.  (1),(3)d OR (1,3)d)
1487 0
1488    When the first thing in an address in a zero, it is a buffer refer-
1489    ence.
1490     a) Beginning of buffer (e.g.  0r path)
1491     b) Absolute character number within buffer (e.g.  0(256),0(511)p)
1492 $
1493    "$" in an address refers to the "end-of" the buffer or line.
1494     a) Last line of buffer (e.g.  $d)
1495     b) Last byte of line (e.g.  ($)d)
1496 .
1497    "."  refers to the current position, either line-in-buffer or
1498    byte-in-line.
1499     a) Current line of buffer (e.g.  .p)
1500     b) Current byte of line (e.g.  (.)d)
1501 
1502 
1503 Relative [+ -]:  Addressing may be done relative to the current posi-
1504 tion or relative to a preceeding address part.  The "+" is optional
1505 when not the first thing in an address.  Thus ".+4" is the same as ".4"
1506 (which is the same as "+4").
1507  a) Relative to the last line in the buffer (e.g.  $-5P)
1508  b) Relative to the new-line ($) in the line (e.g.  ($-5),($)d)
1509     [NOTE:  15($)d will merge lines 15 and 16 by deleting the new-line]
1510     [NOTE:  If last line has no NL, ($) refers to where it WOULD be.]
1511  c) Relative to the current line in the buffer (e.g.  .,.+5p OR .,.5p)
1512  d) Relative to the current character in the line (e.g.  (20);(.+6)p)
1513 
1514 
1515 Contextual [/.../ </.../]:
1516 /<RE>/
1517    Addressing may be accomplished by regular expression (<RE>) search.
1518     a) Regular expression search within the buffer.  The search is done
1519    by
1520        starting on the line following "."  and searching from there to
1521    the end
1522        of buffer.  If it is not found, then the search continues at the
1523        beginning of the buffer and goes up to and including the current
1524    line.
1525        "/" is the required delimiter in this use of regular expression.
1526        (e.g.  /abc/-4)
1527     b) Regular expression within a line.  The search is done starting
1528    with (.+1)
1529        except for the first thing after a line address (conceptually
1530    the line
1531        address locates the 0'th byte of the line).  "/" is also the
1532    required
1533        delimiter here.  (e.g.  (13/somestring/))
1534 </<RE>/
1535    Backup search looks for an expression by moving backward one line at
1536    a time.  "/" need not be used as a delimiter in this case.  (e.g.
1537    $<`end;`)
1538 
1539 
1540 Mode change [\s \l]:
1541 \s
1542    Enter string mode.  SEE string-mode
1543 \l
1544    Enter line mode
1545 
1546 
1547 Separators [, ;]:  When two addresses occur to form a range, they can
1548 be separated in one of two ways.
1549 ,
1550    "," as an address separator means that the following address is to
1551    be searched for from the same starting point as the past address
1552    was.
1553 ;
1554    ";" as an address separator means that the following address is to
1555    be searched for from the location found by the past address.
1556 Special form
1557    There is a shorthand address form available in certain circum-
1558    stances.  The two forms below are identical in meaning, with the
1559    second being the shorthand.
1560       /abc/(2); .(10)
1561       /abc/(2,10)
1562    In other words, when the line part is the same on both addresses,
1563    then the byte portions may be combined within the same parentheses.
1564 
1565 
1566 Prefix [?]:  "?"  preceeding an address makes it an address prefix.  An
1567 address prefix has the same form as an address.  It causes the same
1568 processing as an address.  But, it does not act as an address to a
1569 request.  Its purpose is to test for the validity of an address.
1570 
1571 If any part of an address is not findable, all processing stops and
1572 control is returned to ted request level.  However, if an address pre-
1573 fix fails, it does not give a message; it merely ignores the rest of
1574 the request line and continues.  Since all the work has been done of
1575 processing the address, you may want to be at that location.  This is
1576 accomplished by separating the prefix from the following address with a
1577 ";".
1578   ?/Charly/; .; .+1d >-0
1579 will find all lines in the buffer containing "Charly" and delete it and
1580 the following line.  Actually this is not fail-safe.  To cover the pos-
1581 sibility of the match begin on the last line (important when writing a
1582 ted_com where control must be retained) you could use:
1583   ?/Charly/+1; .-1; .+1d >-0
1584 
1585 
1586 Examples:
1587     /abc/-5 references the line 5 ahead of one containing the string
1588 "abc"
1589    (/abc/+2) references the "c" of the first occurance of "abc" on the
1590                  current line
1591   0/J/(/k/) references the first "k" on the first line containing a "J"
1592    (/a.*z/)d deletes the string beginning with "a" and ending with "z"
1593 on
1594                  the current line
1595  (/abc/);(+5)d deletes a string beginning with "abc" and 6 characters
1596 long
1597 
1598 
1599 :Info: not: ': ^:
1600 12/07/78  "Not" request modifier
1601 
1602 The sense of certain requests may be reversed by placing a NOT ("^" or
1603 "'") before them.  SEE any of the following:  ^# ^* ^> ^r ^b
1604 
1605 
1606 :Info: alternate: !:
1607 12/11/78  Alternative request forms
1608 
1609 There are alternate forms of certain requests available.  This is
1610 indicated by preceding the request letter by "!".  Some of these are
1611 available via capital letters.
1612  SEE any of the following:
1613       !a !b !c !e !f !i !j !k !l !m !n !p !q !r !s !t !u !w !x
1614                 E F J K L M P Q R S T U W X
1615 
1616 
1617 :Info: assign: =: ":=":
1618 12/11/78  Assignment operator
1619 
1620 ":=" is the assignment operator within <eval>.  Not to be confused with
1621 the "=" operator which is equality.
1622 
1623 
1624 :Info: active_function: argn: arg:
1625 12/07/78  ted as active function
1626 
1627 
1628 When ted is called as an active function, the contents of b(argn) when
1629 q is executed is the result.
1630 
1631 
1632 :Info: arg: args:
1633 03/21/80  Calling ted with arguments
1634 
1635 ted can be called and given arguments which are made available during
1636 the processing.
1637 
1638 "ag" is an arithmetic variable which contains the number of arguments
1639 passed to the current ted invocation.
1640 
1641 The arguments are available in two ways, as successive lines of b(args)
1642 and as b(arg1), b(arg2), etc.  None of these buffers will show up on an
1643 x list until they have been referenced.
1644 
1645 
1646 :Info: trace:
1647 03/17/80  Trace option
1648 
1649 This may be controlled when calling ted with these control arguments:
1650    -trace -trace_edit -trace_input -no_trace
1651 Also, these can be set with the option request:
1652    edit input ^edit ^input trace ^trace
1653 "trace" is the same as "edit input".  "^trace" is the same as "^edit
1654 ^input".  flow controls the displaying of labels.
1655 
1656 
1657 :Info: break:
1658 12/05/78  break blurb
1659 
1660           BREAK:  b(x), line n, level m[dd]
1661  At this time each line typed is used directly as a request line.  All
1662 requests may be used except INPUT requests.  To continue after a break,
1663 type ">" (goto request).
1664    If \?  is typed while at a break , ted will retype the break message
1665 followed by the line on which the break occurred with the point of
1666 break being indicated.  This means that it is best to place a break on
1667 a line with requests instead of on a line by itself.
1668 
1669 If a ted_com appears to be in a loop, you can hit QUIT, and type
1670           ted -pause ted will then break the next time a request line
1671 is asked for in EDIT mode.
1672 
1673 
1674 :Info: prefix: ?:
1675 03/17/80  Address prefix
1676 
1677 "?"  preceeding an address makes it an address prefix.
1678 
1679 For further information type "help address ?".
1680 
1681 
1682 :Info: ^?: '?:
1683 03/17/80  FYI
1684 
1685 It is impossible to use ^?  because when an address fails during its
1686 processing there is no way to recover except to drop the rest of the
1687 line.
1688 
1689 
1690 :Info: @:
1691 10/12/82  Absolute buffer reference
1692 
1693 An address may be reference any buffer, regardless of which is current,
1694 by prefixing all other address parts with @b, or \(b), where b is the
1695 name of the buffer to reference.
1696   @2,1,$d deletes all of b2.
1697   @(exec),1p prints the first line of b(exec).
1698 
1699 
1700 :Info: <:
1701 03/17/80  Backup search
1702 
1703 For information on this, type "help address </"
1704 
1705 
1706 :Info: <: >: metasymbols: metasymbol:
1707 03/19/80  Metasymbols
1708 
1709 Within this info, there are occurances of metasymbols.  These are names
1710 enclosed in <>'s.  For example, <RE>.  A metasymbol represents the name
1711 of something and not a literal occurance of the characters.
1712 Explaination of metasymbols is available in this info.  If you wonder
1713 what "<RE>" stands for you can ask "help <RE>" to find out.
1714 
1715 
1716 :Info: $:
1717 02/24/81   $ - "End"
1718 
1719 "$" has three distinct, but similar, meanings depending on context.  In
1720 a line address it means "last line of the buffer".  In a byte address
1721 it means "the NL or where the NL would be if there is none".  In a reg-
1722 ular expression it means "match end-of-line".  As an address it is
1723 absolute.  It thus may only occur first within an address part.
1724 
1725 
1726 :Info: &:
1727 03/17/80  "&" Operator
1728 
1729 "&" is a special symbol in the replace string of a substitute meaning
1730 "give me the string which was matched".  It also the logical AND in the
1731 g* request.
1732 
1733 
1734 :Info: +:
1735 03/17/80  "+" Operator
1736 
1737 "+" is use in line or byte address to represent forward relative
1738 addressing.  It is also the add operator within <eval>.
1739 
1740 
1741 :Info: -:
1742 03/17/80  "-" Operator
1743 
1744 "-" is used in a line or byte address to represent backward relative
1745 addressing.  It is also the subtract operator within <eval>.
1746 
1747 
1748 :Info: ;: ,:
1749 03/17/80  Address separators
1750 
1751 "," as an address separator means that the following address is to be
1752 searched for from the same starting point as the past address was.
1753 
1754 ";" as an address separator means that the following address is to be
1755 searched for from the location found by the past address.
1756 
1757 
1758 :Info: .:
1759 02/24/81  "." Operator
1760 
1761 "."  means "the current line" in a line address, "the current byte" in
1762 a byte address.  This is an absolute and may only occur first within an
1763 address part.
1764 
1765 "."  means "match any character" in a regular expression.
1766 
1767 "."  on a line by itself is the end-of-inout symbol in BULK mode.  SEE:
1768 modes
1769 
1770 
1771 :Info: /:
1772 03/17/80  "/" Operator
1773 
1774 "/" is used in a line or byte address to delimit a search expression.
1775 It is also the divide operator within <eval>.
1776 
1777 
1778 :Info: 0: 1: 2: 3: 4: 5: 6: 7: 8: 9:
1779 01/01/78  Decimal digits
1780 
1781 The digits are used to build line and byte numbers in addresses, and
1782 integers within <eval>.
1783 
1784 
1785 :Info: quote: """":
1786 09/09/85  Quote mark
1787 
1788 It delimits quoted strings within <eval>.
1789 
1790 
1791 :Info: A:  01/01/78  "A" is not a request.
1792 
1793 
1794 :Info: B:  01/01/78  "B" is not a request.
1795 
1796 
1797 :Info: C:  01/01/78  "C" is not a request.
1798 
1799 
1800 :Info: D:  01/01/78  "D" is not a request.
1801 
1802 
1803 :Info: G:  01/01/78  "G" is not a request.
1804 
1805 
1806 :Info: H:  01/01/78  "H" is identical to "h".
1807 
1808 
1809 :Info: I:  01/01/78  "I" is not a request.
1810 
1811 
1812 :Info: N:  01/01/78  "N" is not a request.
1813 
1814 
1815 :Info: O:  01/01/78  "O" is not a request.
1816 
1817 
1818 :Info: V:  01/01/78  "V" is not a request.
1819 
1820 
1821 :Info: Y:  01/01/78  "Y" is not a request.
1822 
1823 
1824 :Info: Z:  01/01/78  "Z" is not a request.
1825 
1826 
1827 :Info: _:  01/01/78  "_" is not a request.
1828 
1829 
1830 :Info: `:  01/01/78  "`" is not a request.
1831 
1832 However, this is used in ted-help to represent a delimiter.  For exam-
1833 ple, S`<RE>`STR` means the letter "S" followed by any non- blank char-
1834 acter which represents a delimiter.  There are then 2 more occurances
1835 of the same character to finish out the request.
1836 
1837 
1838 :Info: escape: \: "\":
1839 03/18/80  "\" - Escape
1840 
1841 "\" is part of several special sequences.  Some are recognized by ted;
1842 others are recognized by Multics terminal I/O.
1843  SEE any of the following:  \c\b, \c\c, \f, \g{, \l, \r, \s, \[n]x, \?
1844 Multics I/O recognizes \\ \# \@ \ooo and \NL
1845  "ooo" is 3 octal digits.  NL is the NL character.
1846 
1847 
1848 :Info: \?:
1849 03/18/80  "\?" - Where am I?
1850 
1851 "\?"  is the where-am-I request when given on a line by itself.  The
1852 response to this will be of this form:
1853   ted(v.r)xxx MODE[rc]safe
1854 "v.r" is the current version/revision of ted.  "rc" is the current
1855 recursion level of ted.  "safe" means you are operating in SAFE mode;
1856 not present if not safe.
1857 "xxx" can be any of these
1858     INPUT EDIT READ BULK BREAK
1859  SEE:  modes
1860 
1861 
1862 :Info: \c\c: \C\c: \C\C \c\C:
1863 03/18/80  "\c" - Conceal function
1864 
1865 "\c" or "\C" is the conceal function.  It is used whenever a character
1866 with a special meaning is to be taken literally.  It is used as a pre-
1867 fix to the the thing to be concealed.
1868 
1869 For example, in order to input the "\f" sequence, which would terminate
1870 input mode, you must enter it as "\c\f".
1871 
1872 
1873 :Info: \b: \B: \r: \R: \{:
1874 03/21/80  Input functions
1875 
1876 Overview:
1877   "\b", "\r", and "\{" are the three input functions.  In general, ted
1878 input is obtained a line at a time.  Input comes from user_input and
1879 from invoked buffers.  Each time ted needs another line it calls its
1880 input routine.  This routine takes from the input until a NL is
1881 encountered.  Along the way it looks for input functions and processes
1882 them.
1883 
1884 ted knows nothing about any input functions which may have existed.
1885 The input routine knows nothing about what will be done with the line
1886 gotten.  The result of this is that ALL input functions on a line are
1887 processed before any requests in the line.  You might consider the
1888 input functions as having higher priority than requests.  This means
1889 that a line typed this way will not work as you probably want:
1890    2,4k(x) $a \bx\f
1891 You might think that you are moving some data to buffer x and then
1892 appending it to the end of the current buffer.  However, since the \b
1893 has higher prioroty, it is done first and the data is not in buffer x
1894 yet.
1895 
1896 
1897 Invoke [\b]:  "\b" or "\B" is the invoke buffer input function.  It can
1898 be used in these forms:
1899      \b(X) \b(X,a) It basically means "replace the invoke sequence with
1900 the contents of the specified buffer or with the selected portion of
1901 the contents of the buffer".
1902 
1903 The contents is used one line at a time.  In INPUT mode the lines are
1904 used in sequence (assuming no \f therein).  In EDIT mode this also hap-
1905 pens, except that a goto request may change the sequence in which the
1906 lines are used.
1907 
1908 The contents is scanned looking for input functions and thus nesting
1909 may occur.  The invoke sequence will look like one of these:
1910      \bx \b(xxx) \b(xxx,5;/abc/)
1911 This sequence cannot contain any input functions.
1912 
1913 
1914 Read-a-line [\r]:  "\r" or "\R" is the "terminal" input function.  When
1915 this function is encountered, a line is read from user_input and is
1916 used to replace the function.  The NL from the line read is not inclu-
1917 ded (unless you are running in ted$qedx mode).  The line is not scanned
1918 for any input functions.  However SEE:  \f
1919 
1920 
1921 Evaluation [\{}]:  "\{}" is the evaluation input function.  An evalua-
1922 tion is done and the value returned replaces the evaluation function.
1923 If the evaluation does nothing to return a value, a NULL value is
1924 assumed.  The form is:
1925    \{ <eval> }
1926 This sequence cannot contain any input functions.
1927 
1928 
1929 Example \b:
1930 \bx  OR \b(x)
1931    This invokes buffer x.
1932 \b(x,1)
1933    This invokes just the first line of buffer x.
1934 \b(x,0(1),0(20))
1935    This invokes the first 20 characters of buffer x.
1936 
1937 
1938 Example \r:
1939 s/abc/\r/ s/def/\r/
1940    This will require 2 responses before the line can be executed.  Then
1941    it will replace all occurances of "abc" with whatever you typed in
1942    first.  Then it will replace all occurances of "def" with whatever
1943    you typed second.
1944 
1945 
1946 Example \{}:
1947 {ln:=0}
1948 a \{ln:=ln+10;LN:=fak(ln,"00000");LN:LN} \r
1949 \f >-1
1950    This will accept lines of input, automatically prefixing each one by
1951    a 5-digit line number which is incremented by 10.  The loop is
1952    terminated by the person responding with just "\f".
1953 
1954 "{ln:=0}" initializes the counter.  The second line has 2 input func-
1955   tions in it.  The first one does this:  "ln:=ln+10" increments the
1956   counter.
1957 "LN:=fak(ln,*"00000*")" converts the number to a character string with
1958   leading 0's.
1959 "LN:" prints the number without a NL.
1960 "LN" returns the value for use in the request line.
1961 "\r" then accepts the user input line.  The last line comes out of
1962   input mode and loops back to get the next user line.
1963 
1964 
1965 :Info: \f: \F:
1966 03/21/80  End-of-input [\f]
1967 
1968 "\f" or "\F" is the end-of-input sequence.  It is used in two places.
1969   When in INPUT mode, this terminates it and causes ted to enter EDIT
1970   mode.  When in READ mode, this causes the line being built to be
1971   aborted.  If the line is being built from an invoked buffer, this
1972   will act as a RETURN.  If the line is being built from "terminal"
1973   level, this will cause an error message to be printed.
1974 
1975 
1976 :Info: \g: \g{: \g{}:
1977 03/21/80  Substitute evaluation (under g*) [\g{}]
1978 
1979 "\g{}" or "\G{}" is the evaluation function of substitute done under
1980   global-if.  This is similar to the "\{}" except that the evaluation
1981   is done once for each match found.  The form is:
1982      \g{ <eval> } Since this is NOT an input function, there may be
1983   input functions within the sequence.
1984 
1985 
1986 :Info: \l: \s:
1987 03/21/80  Line/string modes [\l \s]
1988 
1989 \l
1990    as part of an address means "enter line mode".
1991 \s
1992    as part of an address means "enter string mode".  SEE:  modes string
1993 
1994 
1995 :Info: |: or: concatenate:
1996 03/21/80  or/concatenate operators
1997 
1998 |
1999    the logical OR operator in g*.
2000 ||
2001    the concatenate operator within <eval>.
2002 
2003 
2004 :Info: ~:
2005 12/07/78  Return from buffer call
2006 
2007 ~
2008    stop executing in this buffer, revert to next lower level.
2009 
2010 
2011 :Info: <eval>: eval: evaluation:
2012 03/13/80  <eval> - Evaluation
2013 
2014 Overview:  Evaluation is a process of doing arithmetic and/or string
2015 operation within ted.  A user may place numbers or strings into vari-
2016 ables of his own chosing.  He may then use them at a later time (in the
2017 same invocation of ted).  With this facility one may implement count-
2018 ers, parse strings, build up strings, etc.
2019 
2020 Evaluation coding always occurs within "{}".
2021 
2022 
2023 Description:
2024 { <part...> <lpart> }
2025    An evaluation may be a list of <part>s followed by a <lpart>.
2026 { <part...> }
2027    Or it may be just a list of <part>s.
2028 { <lpart> }
2029    Or it may be just a <lpart>.
2030 { }
2031    It may even be null.
2032 
2033 
2034 Examples:  These examples are one of each type mentioned above.  The
2035 contexts vary as is appropriate for the type.
2036 zif {i:=i+3;  j<i} >a
2037 {i:=i+2}
2038 \{fs("Now is the time for",i,7)}
2039 \{}
2040 
2041 
2042 Note:  In the description above, you will notice that <part...> and
2043 <lpart> are used.  The complete BNF-like presentation of the evaluation
2044 syntax will contain metasymbols in this fashion.  To determine the form
2045 of any of these, type "help <lpart>", for example.
2046 
2047 
2048 :Info: <part>: <part...>: ":": ;:
2049 03/13/80  <part> - evaluation part
2050 
2051 <cat> ;
2052    The value of <cat> is printed followed by a NL.
2053 <lexp> ;
2054    The value of <lexp> is printed followed by a NL.
2055 <cat> :
2056    The value of <cat> is printed without a NL.
2057 <lexp> :
2058    The value of <lexp> is printed without a NL.
2059 <assign> ;
2060    The value is "used up" by being assigned, so there is no further
2061    action.
2062 d ( <cat> ) ;
2063    This requests a dump of variables.  <cat> must result in a string
2064    consisting of only the characters "akKv".  If "a" is present, all
2065    non-zero a[*] are shown.  If "k" is present, all non-null k[*] are
2066    shown.  If "K" is present, all non-null K[*] are shown.  If "v" is
2067    present, all user-defined variables are shown regardless of content.
2068 
2069 
2070 :Info: <lpart>:
2071 03/13/80  <lpart> - evaluation last part
2072 
2073 <cat>
2074    The value of <cat> is returned as a character string.
2075 <lexp>
2076    The value of <lexp> is returned as either "true" or "false".
2077 <assign>
2078    A null value is returned.
2079 
2080 
2081 :Info: <lexp>: <rel>: =: ^=: >=: <=: <: >:
2082 03/13/80  <lexp> -  logical expression
2083 
2084 <cat> <rel> <cat>
2085    This compares two values.  If the values are not of the same type,
2086    conversion is done to the "higher" of the two types.  The order, low
2087    to high, is this:
2088       arithmetic logical string
2089    <rel> is any of these operators:  = ^= >= <= < >
2090 
2091 
2092 :Info: <cat>: ||:
2093 03/13/80  <cat> - concatenate operation
2094 
2095 <cat> || <aexp>
2096    This means a series of expressions may be concatenated.  If any are
2097    not strings, they will be converted.
2098 <aexp>
2099    Or there may be no concatenation.  In this case, no conversion is
2100    done.
2101 
2102 
2103 :Info: <assign>: ":=": a[: k[: K[: a[]: k[]: K[]: []:
2104 03/12/80  <assign> - assignment
2105 
2106 a[ <cat-1> ] := <cat-2>
2107    The value of <cat-2> is assigned to an element of the a[] array.
2108    <cat-2> and <cat-1> must both be convertable to a number.
2109 k[ <cat-1> ] := <cat-2>
2110    The value of <cat-2> is assigned to an element of the k[] array.
2111    <cat-1> must be convertable to a number.  <cat-1> will be converted
2112    to a string.
2113 K[ <cat-1> ] := <cat-2>
2114    The value of <cat-2> is assigned to an element of the k[] array.
2115    <cat-1> must be convertable to a number.  <cat-1> will be converted
2116    to a string.
2117 <var> := <cat>
2118    The value of <cat> is assigned to the variable <var>.  The type of
2119    <var> is determined by the type of <cat> and may change from assign-
2120    ment to assignment.
2121 
2122 
2123 :Info: <aexp>: +: -:
2124 03/14/80  <aexp> - Arithmetic expression
2125 
2126 <aexp> + <term>
2127    Terms may be added.  They must be convertible to numbers.
2128 <aexp> - <term>
2129    Terms may be subtracted.  They must be convertible to numbers.
2130 <term>
2131    Or a term may be left unchanged.
2132 
2133 
2134 :Info: <term>: *: /: |:
2135 03/14/80  <term> - Arithmetic term
2136 
2137 <term> * <factor>
2138    Factors may be multiplied.  They must be convertible to numbers.
2139 <term> / <factor>
2140    Factors may be (integer) divided.  They must be convertible to num-
2141    bers.
2142 <term> | <factor>
2143    Factors may be mod'ed.  (Remainder when dividing.)  They must be
2144    convertible to numbers.
2145 <factor>
2146    Or a factor may be left unchanged.
2147 
2148 
2149 :Info: <factor>: +: -:
2150 06/06/80  <factor> - unary-operator expression
2151 
2152 + <fact>
2153    A unary plus may preceed a <fact> which must be convertable to a
2154    number.
2155 - <fact>
2156    A unary minus may preceed a <fact> which must be convertable to a
2157    number.
2158 <fact>
2159    Or there may be no unary operator at all.  The type may then be any-
2160    thing.
2161 
2162 
2163 :Info: <fact>: (: ): ():
2164 01/29/81  <fact> - Arithmetic factor
2165 
2166 <data>
2167    A factor may be one of several types of data, either literal,
2168    builtin, or variable.
2169 <func>
2170    A factor may also be the value produced by a function.
2171 ( <cat> )
2172    It may also be an expression in parentheses.  There is no implied
2173    conversion by the fact that it is used in this fashion.
2174 ( <lexp> )
2175    A factor can be the arithmetic conversion of a <lexp>.  If <lexp> is
2176    FALSE, the result is 0.  Otherwise the result is 1.
2177 ( <assign> )
2178    A factor may be the value of an assignment.  This results in the
2179    assignment being done, then the value assigned being used as a fac-
2180    tor in whatever context it appears.
2181 
2182 
2183 :Info: <data>:
2184 06/04/80  <data> - Data elements
2185 
2186 There are several kinds of data available.  To get info about all of
2187    them type
2188       help data-all
2189    Or you can ask for parts of this by means of any of these
2190       help data-literal
2191       help data-variable
2192       help data-buffer
2193       help data-addressed
2194       help data-string
2195       help data-error
2196       help data-parameter
2197       help func-addressed
2198       help func-substr
2199       help func-rearrange
2200       help func-if
2201       help func-convert
2202       help func-arithmetic
2203 
2204 
2205 :Info: data-all: data-literal:
2206 06/04/80  Literal data
2207 
2208 <integer>
2209    Numeric data may be in decimal.
2210 ...
2211    Numeric data may be given as an octal string.  The string must con-
2212    tain only the characters "01234567".
2213 ...
2214    Numeric data may be given as a hexadecimal string.  The string must
2215    be comprised of only these characters, "0123456789abcdefABCDEF"
2216 ...
2217    String data may be entered as a quoted string.  Any internal quotes
2218    must be doubled.
2219 
2220 
2221 :Info: data-all: data-variable: a[: a[]: k[: k[]: K[: K[]: []:
2222 06/04/80  Variable data
2223 
2224 <var>
2225    This references a user defined variable.  The variable must have
2226    been previously assigned some value.  Its type is dependant upon the
2227    assignment which was last done.  A variable name must begin with a
2228    letter, may contain up to 16 characters, and must consist of let-
2229    ters, digits, and "_".
2230 a[ <cat> ]
2231    This is a reference to an element of the arithmetic array.  <cat>
2232    must be convertible to a number in the range -200:200.
2233 k[ <cat> ]
2234    This is a reference to an element of the short-character array.
2235    Each element is restricted to 32 characters.  <cat> must be convert-
2236    ible to a number in the range -200:200.
2237 K[ <cat> ]
2238    This is a reference to an element of the long-character array.  Each
2239    element is restricted to 512 characters.  <cat> must be convertible
2240    to a number in the range -10:10.
2241 
2242 
2243 :Info: data-all: data-buffer: bn: dn: en: sk: sn:
2244 06/04/80  Buffer builtins
2245 
2246 bn
2247    The name of the current buffer.  Does not give expected results when
2248    used in \{} context.  In fact, none is this section do.
2249 dn
2250    The directory name of the file associated with the current buffer.
2251    Null if no pathname on the buffer.
2252 en
2253    The entry name of the file associated with this buffer.
2254 sk
2255    The subfile kind of the file associated with this buffer.
2256     ":" archive component
2257     " " No subfile
2258 sn
2259    The archive component name of the file associated with this buffer.
2260 
2261 
2262 :Info: data-all: data-addressed: Ks: Kl: Kb: lb: sb: se: le: be:
2263 06/04/80  Addressed data
2264 
2265 These data are available in {} and zif {}, but only if an address is
2266    present.
2267 Ks
2268    This is the string addressed.  If no byte-address is given, then
2269    this is identical to Kl.
2270 Kl
2271    This is the line addressed.  Or more precisely, it begins at the
2272    beginning of the line where Ks begins and ends at the end of the
2273    line where Ks ends.  It is possible for this to span lines; it is
2274    all dependant on the address given.
2275 Kb
2276    This is the contents of the whole buffer.
2277 lb
2278    This is the offset in the buffer of the place where Kl starts.
2279 sb
2280    This is the offset in the buffer of the place where Ks starts.
2281 se
2282    This is the offset in the buffer of the place where Ks ends.
2283 le
2284    This is the offset in the buffer of the place where Kl ends.
2285 be
2286    This is the offset in the buffer of the place where the buffer ends.
2287    That is, the number of characters in the buffer.
2288 
2289 
2290 :Info: data-all: func-addressed: fln:
2291 06/04/80  Addressed functions
2292 
2293 fln ( lb )
2294    This yields the line number of where lb is.
2295 fln ( le )
2296    This yields the line number of where le is.
2297 fln ( be )
2298    This yields the line number of where be is, i.e.  the number of
2299    lines in the buffer.
2300 
2301 
2302 :Info: data-all: data-string: cs:
2303 02/24/81  String builtin
2304 
2305 cs
2306    This is a string containing the ascii collating sequence.  PL/I
2307    collate9().
2308 
2309 
2310 02/24/81 Change:  cs is now collate9() instead of collate()
2311 
2312 
2313 :Info: data-all: data-parameter: pn: p[: p[]: ag:
2314 06/04/80  Parameter data
2315 
2316 pn
2317    This specifies how many parameters are present.  Parameters are
2318    presented only when a buffer is called via the % request.  When a
2319    buffer is invoked, this value is 0.
2320 p[ <cat> ]
2321    This is a reference to an element in the parameter array.  <cat>
2322    must be convertible to a number in the range 0:pn.  p[0] is a spe-
2323    cial case.  It represents the whole string following the buffer name
2324    in the % request.  The first character of this string is the
2325    delimiter of the parameters.
2326 ag
2327    This tells the number of arguments which were given when ted was
2328    called.
2329 
2330 
2331 :Info: mct: mct(): match:
2332 11/10/82  Substitute match count
2333 
2334 mct()
2335    This is the number of matches found during the last substitute.
2336 
2337 
2338 :Info: data-all: data-error: em: emc(): emc: emt(): emt:
2339 06/04/80  Error data
2340 
2341 em
2342    This is the full text of last error message, whether printed or not.
2343    Messages have this form:    Xxx)  text
2344    Xxx is the message identifier.  text is the part which is normally
2345    printed.
2346 emc()
2347    This function returns the code, the message identifier Xxx.
2348 emt()
2349    This function returns the text.
2350 
2351 
2352 :Info: data-all: func-substr: fs: substr:
2353 06/04/80  Substr
2354 
2355 fs( <cat-1> , <cat-2> )
2356    This yields a substring of <cat-1> which is converted to string if
2357    necessary.  <cat-2> is converted to a number which specifies where
2358    to begin taking the string.  If it is negative, it means to count
2359    from the end of the string.  The string returned is everything after
2360    the beginning point.
2361 fs( <cat-1> , <cat-2> , <cat-3> )
2362    This yields a string of a specified length.  <cat-1> and <cat-2> are
2363    just as described above.  <cat-3> is converted to a number which
2364    specifies the length of the string to return.  If there are not suf-
2365    ficient characters in <cat-1>, then the result is padded to the
2366    required size with spaces.  If this number is negative, it means
2367    that if any padding is needed, do it on the left.
2368 fs( <cat-1> , <cat-2> : <cat-3> )
2369    This is similar to the form just above, except that <cat-3>
2370    specifies the ending POSITION of the string to take.  If <cat-3> is
2371    negative, it means to count from the end of the string.
2372 
2373 
2374 :Info: data-all: func-rearrange: frs:
2375 06/04/80  Rearrange a string
2376 
2377 frs( <cat-1> , <cat-2> , <cat-3> )
2378    This function "re-arranges" a string.  First an index of <cat-2> in
2379    <cat-1> is done.  This breaks the <cat-1> into parts which may then
2380    be selected by the contents of <cat-3> which must consist of only
2381    these characters:
2382      "b" give the before part.  If no match, this is <cat-1>.
2383      "m" give the matched part.
2384      "a" give the after part.
2385      "s" give the value of <cat-2>
2386    This means that:  frs(name,".pl1","bs")
2387    will yield a string with the suffix ".pl1", taking into account the
2388    presence of one to start with.
2389 
2390 
2391 :Info: data-all: func-if: if:
2392 09/09/85  String function- if
2393 
2394 if( <lexp> , <cat-1> , <cat-2> )
2395    This yields <cat-1> if <lexp> is TRUE.  Otherwise it yields <cat-2>.
2396 if( <lexp> , <cat> )
2397    This yields <cat> if <lexp> is TRUE.  Otherwise it yields nothing.
2398 
2399 
2400 :Info: data-all: func-arithmetic: fl: fi: fir: ff: ffr: fv: fvr:
2401 09/09/85  Arithmetic functions
2402 
2403 fl( <cat> )
2404    This yields the length of <cat>.  If <cat> is not a string, it is
2405    converted.
2406 fi( <cat-1> , <cat-2> )
2407    This is the index function.  Both arguments are converted to
2408    strings.  The value returned is the position in <cat-1> where string
2409    <cat-2) is found.  The result is 0 if it is not there.  PL/I index.
2410 fir( <cat-1> , <cat-2> )
2411    This does an index function on the reverse of <cat-1>.  <cat-2> must
2412    be in reverse order in order to be found.
2413 ff( <cat-1> , <cat-2> )
2414    This "finds" a character of <cat-2> in <cat-1>.  If none exist, 0 is
2415    returned.  PL/I search().
2416 ffr( <cat-1> , <cat-2> )
2417    This "finds", except it looks from the end of the string.  PL/I
2418    search(reverse()).
2419 fv( <cat-1> , <cat-2> )
2420    This "verifies" the presence of some character in <cat-2> in
2421    <cat-1>.  If all match, 0 is returned.  PL/I verify.
2422 fvr( <cat-1> , <cat-2> )
2423    This "verifies", except it looks from the end of the string.  PL/I
2424    verify(reverse()).
2425 ff( <cat> , S(xxx) )
2426    This "finds" a member of a specified set of characters which is
2427    specified by the value of xxx, which is made up of one or more of
2428    these selectors:
2429      "n" numeric
2430      "u" uppercase letter
2431      "l" lowercase letter
2432      "a" letters plus "_"
2433      "o" octal
2434      "x" hexadecimal
2435      "g" graphic, \041->\176
2436      "m" motion, BSP HT NL VT FF SP
2437 ffr( <cat> , S(xxx) )
2438    This "finds", but from the end of <cat>.
2439 fv( <cat> , S(xxx) )
2440    This verifies, with a set.
2441 fvr( <cat> , S(xxx) )
2442    This verifies, but from the end of the string.
2443 fmn( <cat...> )
2444    This returns the minimum of all the arguments given to it.  The
2445    arguments are separated by commas.
2446 fmx( <cat...> )
2447    This returns the maximum of all the arguments given to it.
2448 
2449 
2450 :Info: data-all: data-convert: fak: fka:
2451 06/04/80  Data conversion
2452 
2453 fka( <cat> )
2454    This converts a string to arithmetic.  It is for compatability only,
2455    it is no longer needed.
2456 fak( <cat-1> , <cat-2> )
2457    This does a conversion of a number, <cat-1>, to a string under the
2458    control of a mask, <cat-2>.
2459 
2460 
2461 Mask description:  MASK may be of length zero ("") in which case the
2462 converted result is exactly the significant digits preceeded by a minus
2463 sign if appropriate.
2464 
2465 If MASK is not of length zero, then the result of the conversion is
2466 exactly as long as the mask.  The significant digits of the number and
2467 the mask are processed from right to left.  All numeric, alphabetic,
2468 and special characters may appear in MASK.  However, some of the char-
2469 acters have special meanings:
2470 
2471 "~" causes a space in the result.
2472 
2473 "0" is replaced by a digit if one is left; otherwise it remains
2474     in the result.
2475 
2476 "b" is replaced by a digit if one is left; otherwise it is
2477     replaced by a fill character.  After a fill character is used
2478     it becomes a "b" if it is not "*".  All zeroes should occur to
2479     the right of the spaces in the mask.  The rightmost space or
2480     zero is the units position.
2481 
2482 "-" in the units position signals floating minus sign.  The fill
2483     character will be set to "-" or "b" as is appropriate.
2484 
2485 "-" in the leftmost position of the mask signals a fixed minus
2486     sign.  It will be set to either "-" or "b" as is appropriate.
2487 
2488 "$" in the units position signals floating dollar sign.  The fill
2489     character is set to "$".
2490 
2491 "**" in the units position signals asterisk protection.  The fill
2492     character is set to "**".
2493 
2494 "O" in the units position signals octal conversion is to be done
2495     on the value.  The result is a string, not a signed value.
2496 
2497 "X" in the units position signals hexadecimal conversion is to be
2498     done on the value.  The result is a string, not a signed
2499     value.
2500 
2501 "," is replaced by a fill character if no digits are left.
2502     Otherwise it remains in the result.
2503 
2504 "."  is replaced by a fill character if no digits are left.
2505     Otherwise it remains in the result.
2506 
2507 Any character not having a special meaning remains in the result.
2508 
2509 
2510 :Info: request: requests:
2511 01/29/81  Ted requests
2512 
2513 To get a list of ted requests, type "help ted requests"
2514 
2515 
2516 :Info: help:
2517 12/04/78  Help facility within ted
2518 
2519 Overview:  ted has help available.  This is implemented via the same
2520 suboutine as is used by the help command.  Thus, all question/answer
2521 sequences are as you are used to with help.
2522 
2523 Most of the info available via ted_help is not available to the help
2524 command.
2525 
2526 
2527 help:  This form gives additional information about the last error
2528 which occured.  If there is no last error, it will give information
2529 about help.
2530 
2531 
2532 help info:  This form gives information about "info".  It will begin by
2533 listing all the titles in the info and then ask if you want to see the
2534 first one.  (If there is only 1 section, then it is just printed.)  If
2535 more than one info matches "info", they are listed in turn.  If there
2536 is only 1 section in each, there will be no pause between any of them.
2537 
2538 
2539 help info sec:  This form tries to find section "sec" in info "info".
2540 This begins by printing the named section and then asks if you want to
2541 see more if there is other data to be seen.  Titles are not automati-
2542 cally given.
2543 
2544 If "info" is given as "**", then all infos are given which have a sec-
2545 tion "sec".  For example if you say "help ** overview" it shows all
2546 Overview sections of all infos.
2547 
2548 
2549 help -about topic:  This form selects all infos which contain the
2550 string "topic".  Each in turn will be presented for your examination.
2551 The string is not matched on a word basis; be careful about doing some-
2552 thing like "help -about b".  This would probably match every paragraph
2553 of every section of every info in the file.
2554 
2555 
2556 help info -about topic:  This form starts you in the first paragraph of
2557 info "info" which contains the string "topic".
2558 
2559 
2560 help -from date:  This form will select all infos which have been
2561 updated since "date".  It will list the info name, the header line
2562 (which shows the data) and the size of the info.
2563 
2564 
2565 help ** change -from date:  This form will select the section "mm/dd/yy
2566 Change" from all infos which have been updated since "date".  It will
2567 begin printing with the selected section.  If a section by that name
2568 does not exist (i.e.  info is new), then no printing will occur.
2569 
2570 
2571 help |func:  This form tries to find info about the external function
2572 ted_func_.  If this exists, it will be in a segment named
2573 ted_func_.info.  The search rules used when trying to find the info
2574 will contain the directory where ted_func_ is found.  If ted_func_ does
2575 not exist, then no info will be looked for.
2576 
2577 
2578 help |func info:  This form attempts to find info "info" in an external
2579 function info file.
2580 
2581 
2582 Conventions:  Many sections will describe one or more constructs.  In
2583 general, the title of a section will give a summary of the constructs
2584 it contains.  This summary will be enclosed by "[]".  Thus a section
2585 title like this
2586    Basic [a c i]
2587 indicates that the "a", "c", and "i" requests are described therein.
2588 
2589 When a request form is shown, the default address will be shown
2590 enclosed in "[ ]"'s
2591    [.,.] p
2592 means that the p request defaults to the current line if no address is
2593 given.
2594 
2595 When a new info is added to ted.info it will get the current date.  If
2596 any changes are made to the technical content of the info, a section
2597 will be added which is named "mm/dd/yy Change".  This will be inserted
2598 ahead of any prior change indicators.
2599 
2600 Many request descriptions begin with a section named "Basic".  This
2601 gives the ordinary form of the request.  Some infos have a section
2602 named "Overview".  This contains auxilliary information which is not
2603 absolutely necessary to know, but which may be of benefit to have read
2604 once.
2605 
2606 
2607 List of ted_help infos:
2608 <REPL>              <lexp>              assign              execute
2609 <aexp>              <lpart>             break               expression
2610 <assign>            <part>              buffers             fileout
2611 <cat>               <term>              call                global
2612 <data>              active_function     copy                if
2613 <eval>              address             cut                 input
2614 <fact>              alternate           delete              label
2615 <factor>            arg                 escape              line/string
2616 
2617 linenumber          quit
2618 modes               quote
2619 move                read
2620 nop                 sort
2621 not                 status
2622 options             substitute
2623 prefix              trace
2624 print               write