home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume7 / crisp1.9 / part06 < prev    next >
Encoding:
Text File  |  1989-06-10  |  49.5 KB  |  1,812 lines

  1. Newsgroups: comp.sources.misc
  2. From: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  3. Subject: v07i026: CRISP release 1.9 part 05/32
  4. Organization: Reuters Ltd PLC, Marlow, England
  5. Reply-To: fox@marlow.UUCP (Paul Fox)
  6.  
  7. Posting-number: Volume 7, Issue 26
  8. Submitted-by: fox@marlow.UUCP (Paul Fox)
  9. Archive-name: crisp1.9/part06
  10.  
  11.  
  12.  
  13. #!/bin/sh
  14. # this is part 5 of a multipart archive
  15. # do not concatenate these parts, unpack them in order with /bin/sh
  16. # file help/crisp/prim/I.cmd continued
  17. #
  18. CurArch=5
  19. if test ! -r s2_seq_.tmp
  20. then echo "Please unpack part 1 first!"
  21.      exit 1; fi
  22. ( read Scheck
  23.   if test "$Scheck" != $CurArch
  24.   then echo "Please unpack part $Scheck next!"
  25.        exit 1;
  26.   else exit 0; fi
  27. ) < s2_seq_.tmp || exit 1
  28. echo "x - Continuing file help/crisp/prim/I.cmd"
  29. sed 's/^X//' << 'SHAR_EOF' >> help/crisp/prim/I.cmd
  30. X    keyboard;  this  may  be  needed for example if the keyboard
  31. X    is to be changed or deleted.
  32. X
  33. X    Refer  to  (use_local_keyboard)  and the help section "Local
  34. X    Keyboards" for more information on what a local keyboard is.
  35. X.HU inq_macro
  36. XSYNOPSIS:    (inq_macro macro)
  37. X
  38. XRETURN VALUE:
  39. X
  40. X    Non-zero if macro is a macro; zero otherwise.
  41. X
  42. XDESCRIPTION:
  43. X
  44. X    This  macro  allows  the  calling  macro to see if the named
  45. X    macro is defined. macro is a string expression.
  46. X
  47. X    Passing  the  name  of  a CRISP builtin will return 0 unless
  48. X    the built-in has been redefined by a (replacement) macro.
  49. X.HU inq_mark_size
  50. XSYNOPSIS:    (inq_mark_size)
  51. X
  52. XRETURN VALUE:
  53. X
  54. X    The number of characters in the currently marked region.
  55. X    
  56. XDESCRIPTION:
  57. X
  58. X    This  macro  can be used to find out how many characters are
  59. X    in  the  currently  marked region. This number is the string
  60. X    length  of  a  string  which  would be necessary to hold the
  61. X    characters.
  62. X.HU inq_marked
  63. XSYNOPSIS:    (inq_marked [start_line] [start_col] [end_line] [end_col])
  64. X
  65. XRETURN VALUE:
  66. X
  67. X    Returns  0  if  buffer does not have a region set; otherwise
  68. X    returns current region type.
  69. X
  70. XDESCRIPTION:
  71. X
  72. X    start_line,  start_col,  end_line,  and end_col are optional
  73. X    integer   variables   which   receive   the  start  and  end
  74. X    positions of the current region.
  75. X.HU inq_message
  76. XSYNOPSIS:    (inq_message)
  77. X
  78. XRETURN VALUE:
  79. X
  80. X    Returns  the  message  currently on the status line plus any
  81. X    type in from the user.
  82. X
  83. XDESCRIPTION:
  84. X
  85. X    This   macro   returns   any  message  or  prompt  which  is
  86. X    currently  displayed  on  the status line. It is used by the
  87. X    various  command  completion  and abbreviation macros to see
  88. X    what command is currently executing.
  89. X
  90. X    See also (inq_cmd_line).
  91. X.HU inq_mode
  92. XSYNOPSIS:    (inq_mode)
  93. X
  94. XRETURN VALUE:
  95. X
  96. X    Returns 1 if in insert mode; 0 if in overtype mode.
  97. X
  98. XDESCRIPTION:
  99. X
  100. X    This    macro    returns    the   current   state   of   the
  101. X    insert/overtype modes.
  102. X.HU inq_modified
  103. XSYNOPSIS:    (inq_modified [bufnum])
  104. X
  105. XRETURN VALUE:
  106. X
  107. X    Returns  non-zero  if current buffer has been modified; 0 if
  108. X    buffer has not been modified (or has been written away).
  109. X
  110. XDESCRIPTION:
  111. X
  112. X    This  macro  returns  a value indicating whether the current
  113. X    buffer  (bufnum  omitted)  or the buffer specified by bufnum
  114. X    has been modified.
  115. X
  116. X    This   macro   exists   as   a   shorthand   form   of   the
  117. X    (inq_buffer_flags)  macro.  It exists for compatability with
  118. X    BRIEF.
  119. X
  120. XEXAMPLES:
  121. X
  122. X    The  following  example  prints a message saying whether the
  123. X    buffer has been modified or not.
  124. X
  125. X            (message "Buffer has %sbeen modified."
  126. X                (if (inq_modified) "" "not ")
  127. X.HU inq_msg_level
  128. XSYNOPSIS:    (inq_msg_level)
  129. X
  130. XRETURN VALUE:
  131. X
  132. X    The current value of the message level flag (0-3).
  133. X
  134. XDESCRIPTION:
  135. X
  136. X    The  message  level  flag  is  used to specify what level of
  137. X    error  and  informational  messages  are to be printed. This
  138. X    allows  things  like  replacement  macros  to  operate  in a
  139. X    silent manner.
  140. X
  141. X    To  see  the  meanings  of  the  different  levels, refer to
  142. X    set_msg_level.
  143. X.HU inq_names
  144. XSYNOPSIS:    (inq_names [full_name] [ext] [buf_name])
  145. X
  146. XRETURN VALUE:
  147. X
  148. X    Nothing.
  149. X
  150. XDESCRIPTION:
  151. X
  152. X    This  macro  is  used  for determining the names of the file
  153. X    and  buffer  associated  with the current buffer. Any of the
  154. X    parameters  may  be  omitted.  All  the  parameters  are the
  155. X    names of string variables.
  156. X
  157. X    full_name  is  the  full  path  name  of the file associated
  158. X    with  the  buffer,  and is the file which is written to when
  159. X    (write_buffer)  is  called;  ext  receives the extension (if
  160. X    any)  of  full_name;  buf_name  is the title of the buffer -
  161. X    as  displayed  at  the  top of the window when the buffer is
  162. X    attached (see attach_buffer) to a window.
  163. X
  164. XEXAMPLES:
  165. X
  166. X    The  following  macro  executes  a  file-dependent macro for
  167. X    setting up initialisations, etc.
  168. X
  169. X            (string ext)
  170. X            (inq_names NULL ext)
  171. X            (execute_macro (+ ext "-init"))
  172. X.HU inq_position
  173. XSYNOPSIS:    (inq_position [line] [col])
  174. X
  175. XRETURN VALUE:
  176. X
  177. X    Returns  0  if  cursor  is not past end of buffer; otherwise
  178. X    it returns the number of lines past the end of the buffer.
  179. X
  180. XDESCRIPTION:
  181. X
  182. X    This  macro  is  used to find where the cursor is within the
  183. X    current  buffer.  line  and  col  are  the  names  of string
  184. X    variables  which  receive the current line and column number
  185. X    (both start at 1).
  186. X
  187. X    This  function  returns  an indication of whether the cursor
  188. X    is  past  the  end  of  the  buffer. In BRIEF, the cursor is
  189. X    allowed  to  wander beyond the last line of physical text in
  190. X    the  buffer,  upto  one full screens worth (usually 24 or 42
  191. X    lines).  CRISP  doesnt  support  this capability at present,
  192. X    although  the  cursor  can  be  moved to one line beyond the
  193. X    last  line  of  input.  Be  wary of this when porting macros
  194. X    from BRIEF to CRISP.
  195. X.HU inq_process_position
  196. XSYNOPSIS:    (inq_process_position [line] [col])
  197. X
  198. XRETURN VALUE:
  199. X
  200. X    Returns  -1  if current buffer is not attached to a process;
  201. X    returns 0 otherwise.
  202. X
  203. XDESCRIPTION:
  204. X
  205. X    This  function  is  similar to (inq_position) but it returns
  206. X    the  current  cursor  position  for  the underlying process.
  207. X    line  &  col  are  optional integer variables to receive the
  208. X    line & column, respectively.
  209. X
  210. X    The  process  position  is used for output from the process;
  211. X    rather  than  inserting  the  output  from the process where
  212. X    the  users  cursor  is,  a  separate  cursor  is  maintained
  213. X    instead.  This  is  done  because it allows the user to move
  214. X    around  the  buffer  whilst the process is generating output
  215. X    without  the  process  output  being  sprinkled  through the
  216. X    buffer.
  217. X
  218. X    For  more  details  of  operation, look at the shell.m macro
  219. X    file.
  220. X.HU inq_scrap
  221. XSYNOPSIS:    (inq_scrap [last_newline] [type])
  222. X
  223. XRETURN VALUE:
  224. X
  225. X    Returns the buffer identifier associated with the scrap.
  226. X
  227. XDESCRIPTION:
  228. X
  229. X    This  macro  returns  various  internal info about the scrap
  230. X    buffer.
  231. X
  232. X    last_newline  is  an optional integer variable which is used
  233. X    to  indicate  whether  the scrap has a newline at the end of
  234. X    the  last  line  of the buffer (used when inserting text via
  235. X    (paste)). This is currently not implemented.
  236. X
  237. X    type  is  an integer variable which receives the type of the
  238. X    marked area which was most recently copied to the scrap.
  239. X.HU inq_screen_size
  240. XSYNOPSIS:    (inq_screen_size [lines] [cols])
  241. X
  242. XRETURN VALUE:
  243. X
  244. X    Nothing.
  245. X
  246. XDESCRIPTION:
  247. X
  248. X    lines   and   cols   are   optional  integer  variables.  If
  249. X    specified   they  receive  the  current  dimensions  of  the
  250. X    physical screen.
  251. X.HU inq_system
  252. XSYNOPSIS:    (inq_system)
  253. X
  254. XRETURN VALUE:
  255. X
  256. X    Returns  non-zero  if the current buffer is a system buffer;
  257. X    returns 0 if the current buffer is a normal buffer.
  258. X
  259. XDESCRIPTION:
  260. X
  261. X    This  macro  can  be used by other macros which need to look
  262. X    at arbritrary buffers, eg (buffer_list).
  263. X.HU inq_views
  264. XSYNOPSIS:    (inq_views)
  265. X
  266. XRETURN VALUE:
  267. X
  268. X    Returns  the  number  of  windows  which  have  the  current
  269. X    buffer  on  display.  Returns  0 if current buffer is not on
  270. X    display.
  271. X
  272. XDESCRIPTION:
  273. X
  274. X    This  macro  can  be  used  to  determine  if  it is safe to
  275. X    delete a buffer (via (delete_buffer)).
  276. X.HU inq_window
  277. XSYNOPSIS:    (inq_window)
  278. X
  279. XRETURN VALUE:
  280. X
  281. X    An integer representing the identifier of the current window.
  282. X
  283. XDESCRIPTION:
  284. X
  285. X    This  macro  returns  the  id of the current window. This is
  286. X    useful  for  macros which wish to move the cursor to another
  287. X    window  but  when  they  have  completed wish to restore the
  288. X    cursor to the original window.
  289. X.HU inq_window_color
  290. XSYNOPSIS:    (inq_window_color)
  291. X
  292. XRETURN VALUE:
  293. X
  294. X    The  color  associated  with  the  background of the current
  295. X    window.
  296. X
  297. XDESCRIPTION:
  298. X
  299. X    This  macro  is  used when borders are turned off. It is not
  300. X    currently supported.
  301. X.HU inq_window_size
  302. XSYNOPSIS:    (inq_window_size [lines] [cols] [right])
  303. X
  304. XRETURN VALUE:
  305. X
  306. X    Nothing.
  307. X
  308. XDESCRIPTION:
  309. X
  310. X    This  macro  is  used  to  determine  the  dimensions of the
  311. X    current  window.  lines,  cols  & right are optional integer
  312. X    variables.  lines  and  cols receive the number of lines and
  313. X    columns in the current window.
  314. X
  315. X    right  receives  the  amount  the  current buffer is shifted
  316. X    within  the  window  for  sideways scrolling. If the current
  317. X    buffer  hasn't  been  sideways  scrolled,  then  right  will
  318. X    receive 0.
  319. X.HU insert
  320. XSYNOPSIS:    (insert expr [num])
  321. X
  322. XRETURN VALUE:
  323. X
  324. X    Nothing.
  325. X
  326. XDESCRIPTION:
  327. X
  328. X    (insert)   is  another  means  for  inserting  text  into  a
  329. X    buffer.  (The  others  are  (self_insert) and (paste)). expr
  330. X    is  a  string  expression  which  is to be inserted into the
  331. X    current  buffer,  as  if  typed  by  the  user.  Backslash-n
  332. X    characters are treated as new-lines.
  333. X
  334. X    If  num  is  specified,  then  the string, expr, is inserted
  335. X    num times. If omitted, it defaults to 1.
  336. X.HU insert_mode
  337. XSYNOPSIS:    (insert_mode [mode])
  338. X
  339. XRETURN VALUE:
  340. X
  341. X    Returns  non-zero  if  the  previous  value was insert mode;
  342. X    returns zero if the previous value was overtype mode.
  343. X
  344. XDESCRIPTION:
  345. X
  346. X    This  macro  allows  the  user to set and/or get the current
  347. X    value  of  the  insert mode. The insert mode is applied when
  348. X    the  user  types  in  text. By default CRISP comes in insert
  349. X    mode,  ie  characters typed in cause characters to the right
  350. X    of  the  cursor to be shifted over. Overtype mode causes the
  351. X    character  under  the  cursor  to be deleted and replaced by
  352. X    the inserted characters.
  353. X
  354. X    ins_mode  is  zero if overtype mode should be turned on, and
  355. X    non-zero if insert mode should be turned on.
  356. X
  357. X    If ins_mode is omitted, then the current value is toggled.
  358. X
  359. X    Note    that   the   insert/overtype   mode   only   affects
  360. X    (self_insert) not (insert) or (paste), etc.
  361. X
  362. X    If  the  display  terminal  is  not  able  to  change cursor
  363. X    shape,  then  the  echo status line will display the current
  364. X    status  of  the  insert/overtype  mode. (Note that it has to
  365. X    compete  with  other  values  on  the display line so it may
  366. X    disappear,  for  example,  if  percentage  through  file  is
  367. X    turned on. (See (echo_line)).
  368. X
  369. XEXAMPLES:
  370. X
  371. X    The    following   example   prints   the   state   of   the
  372. X    insert/overtype mode without changing the mode.
  373. X
  374. X            (int    mode)
  375. X            (= mode (insert_mode))
  376. X            (insert_mode)    ; Toggles value back to previous state
  377. X            (message (if mode "Insert mode." "Overtype mode."))
  378. X.HU insert_process
  379. XSYNOPSIS:    (insert_process expr [num])
  380. X
  381. XRETURN VALUE:
  382. X
  383. X    Nothing.
  384. X
  385. XDESCRIPTION:
  386. X
  387. X    (insert_process)   is   similar   to   (insert)  except  the
  388. X    inserted  text  is  sent  to  an attached process instead of
  389. X    being  inserted  into  the  text  buffer.  No  auto  echo is
  390. X    performed  -  it  is  the  calling  macros responsibility to
  391. X    echo any input sent to the process.
  392. X    
  393. X    If  num  is  specified,  then  the string, expr, is inserted
  394. X    num times. If omitted, it defaults to 1.
  395. X.HU int
  396. XSYNOPSIS:    (int var1 var2 ..)
  397. X
  398. XRETURN VALUE:
  399. X
  400. X    Nothing.
  401. X
  402. XDESCRIPTION:
  403. X
  404. X    This  macro  is  used to define local variables which are to
  405. X    contain  only  integer  values.  The  variables  defined are
  406. X    local   variables,   and   are   destroyed  when  the  macro
  407. X    executing this declaration terminates.
  408. X
  409. X    Integers  are  two's  complement integers, 32-bits in length
  410. X    on all machines.
  411. X.HU int_to_key
  412. XSYNOPSIS:    (int_to_key key)
  413. X
  414. XRETURN VALUE:
  415. X
  416. X    Returns a string in the format of (assign_to_key).
  417. X
  418. XDESCRIPTION:
  419. X
  420. X    This   function  takes  an  integer  argument,  which  is  a
  421. X    key-code,   eg  as  returned  by  (read_char).  The  integer
  422. X    key-code  is  converted  to  a  string in the canonical form
  423. X    understood  by  assign_to_key.  This  allows  macros  to  be
  424. X    written portably, rather than returning the raw key-code.
  425. X
  426. X    (int_to_key) and (key_to_int) are inverses of each other.
  427. X.HU is_integer
  428. XSYNOPSIS:    (is_integer expr)
  429. X
  430. XRETURN VALUE:
  431. X
  432. X    Returns 1 if 'expr' is an integer expression; zero otherwise.
  433. X
  434. XDESCRIPTION:
  435. X
  436. X    This  macro  can  be  used  to  test  the  data  type  of  a
  437. X    polymorphic variable, for example when walking down a list.
  438. X.HU is_list
  439. XSYNOPSIS:    (is_list expr)
  440. X
  441. XRETURN VALUE:
  442. X
  443. X    Returns 1 if 'expr' is a list expression; zero otherwise.
  444. X
  445. XDESCRIPTION:
  446. X
  447. X    This  macro  can  be  used  to  test  the  data  type  of  a
  448. X    polymorphic variable.
  449. X.HU is_null
  450. XSYNOPSIS:    (is_null expr)
  451. X
  452. XRETURN VALUE:
  453. X
  454. X    Returns 1 if 'expr' contains the NULL value; 0 otherwise.
  455. X
  456. XDESCRIPTION:
  457. X
  458. X    This  macro  can  be used to test if a particular element of
  459. X    a  list  actually exists (ie to avoid walking off of the end
  460. X    of a list).
  461. X.HU is_string
  462. XSYNOPSIS:    (is_string expr)
  463. X
  464. XRETURN VALUE:
  465. X
  466. X    Returns 1 if 'expr' is a string expression; zero otherwise.
  467. X
  468. XDESCRIPTION:
  469. X
  470. X    This  macro  can  be  used  to  test  the  data  type  of  a
  471. X    polymorphic variable.
  472. X
  473. SHAR_EOF
  474. echo "File help/crisp/prim/I.cmd is complete"
  475. chmod 0644 help/crisp/prim/I.cmd || echo "restore of help/crisp/prim/I.cmd fails"
  476. mkdir help help/crisp help/crisp/prim >/dev/null 2>&1
  477. echo "x - extracting help/crisp/prim/M.cmd (Text)"
  478. sed 's/^X//' << 'SHAR_EOF' > help/crisp/prim/M.cmd &&
  479. X.HU macro
  480. XSYNOPSIS:    (macro name list)
  481. X
  482. XRETURN VALUE:
  483. X
  484. X    Result of last statement executed in the macro.
  485. X
  486. XDESCRIPTION:
  487. X
  488. X    (macro)  defines  a new macro. It is normally only processed
  489. X    when  loading  a .m or .cm file. The macro is given the name
  490. X    'name'  and  consists  of  the  executable statements in the
  491. X    list, list.
  492. X
  493. X    If  a  macro  is  given  the  special name _init, then it is
  494. X    automatically executed when the macro file is loaded.
  495. X.HU macro_list
  496. XSYNOPSIS:    (macro_list)
  497. X
  498. XRETURN VALUE:
  499. X
  500. X    A  list  of  strings  containing  the names of all currently
  501. X    defined macros (not CRISP keywords), in alphabetic order.
  502. X
  503. XDESCRIPTION:
  504. X
  505. X    This  macro  is similar to (command_list) but simply returns
  506. X    a list of all the currently defined macros.
  507. X.HU make_local_variable
  508. XSYNOPSIS:    (make_local_variable var1 var2 ..)
  509. X
  510. XRETURN VALUE:
  511. X
  512. X    Nothing.
  513. X
  514. XDESCRIPTION:
  515. X
  516. X    This  macro  is  used  to make existing local variables into
  517. X    'buffer'  local  variables.  CRISP  supports the concepts of
  518. X    three  storage  classes  for variables - local, which go out
  519. X    of  scope  when  the current macro terminates; global, which
  520. X    never  go  out  of  scope; and buffer-local, which go out of
  521. X    scope when the current buffer is changed.
  522. X
  523. X    Buffer-local   variables   are   useful   for  saving  state
  524. X    information on a per buffer basis.
  525. X
  526. X    When  searching  for  a  variable, CRISP searches the symbol
  527. X    tables in the following order:
  528. X
  529. X        1. Local variables.
  530. X        2. Global variables.
  531. X        3. Buffer variables.
  532. X
  533. X    Therefore  be  careful  when overloading symbol names. CRISP
  534. X    allows   local   variables,   global  variables  and  buffer
  535. X    variables  to  all  be  in  scope at once, in which case the
  536. X    variable  at  the  highest  level  in the above list is only
  537. X    accessible.
  538. X.HU mark
  539. XSYNOPSIS:    (mark [type])
  540. X
  541. XRETURN VALUE:
  542. X
  543. X    Nothing.
  544. X
  545. XDESCRIPTION:
  546. X
  547. X    (mark)  is  similar  to  (raise_anchor)/(drop_anchor).  If a
  548. X    marked  region  is  currently  displayed, then (mark) raises
  549. X    the  anchor;  if  no  anchor is displayed, then (mark) drops
  550. X    an anchor.
  551. X
  552. X    type  is  an  optional  integer  variable  which  is used to
  553. X    define  the  mark  type  if  one  is to be dropped. If it is
  554. X    omitted, it defaults to a normal marked region.
  555. X
  556. X    See  (drop_anchor)  for  a  description of the marked region
  557. X    types.
  558. X.HU message
  559. XSYNOPSIS:    (message fmt [arg1] [arg2] ..)
  560. X
  561. XRETURN VALUE:
  562. X
  563. X    Nothing.
  564. X
  565. XDESCRIPTION:
  566. X
  567. X    This  macro  is  used  to  display  a  message on the status
  568. X    (prompt)  line  at the bottom of the screen. fmt is a string
  569. X    and  may  contain printf-like % formatting characters. arg1,
  570. X    arg2,  ..  are integer or string expressions used to satisfy
  571. X    the % formatting options. Upto 6 arguments are allowed.
  572. X
  573. X    This  macro  can  be  used to display informational messages
  574. X    on  the  bottom  of  the screen; if error messages are to be
  575. X    displayed then the (error) macro should be used instead.
  576. X
  577. X    The  following  is  a  very  brief  summary of the % options
  578. X    available.   For  more  information,  please  refer  to  the
  579. X    underlying  C  library  function sprintf(), which is used to
  580. X    implement this function.
  581. X
  582. X        %d    Print an integer expression. Options such as %03d
  583. X            can be used to perform zero insertion and supply
  584. X            a field width.
  585. X    
  586. X        %x    Print integer expression in hex.
  587. X    
  588. X        %o    Print integer expression in octal.
  589. X    
  590. X        %s    Print a string. Field width and alignments are 
  591. X            allowed.
  592. X    
  593. X        %c    Print a character.
  594. X
  595. X    %l  prefixes  are  allowed but are effectively stripped off.
  596. X    Internally  all  'int'  variables  are  stored as long's and
  597. X    the  printf  format string is parsed to insert an 'l' in the
  598. X    middle  of  all  %d's,  thus  avoiding  portability problems
  599. X    with macros.
  600. X
  601. XEXAMPLES:
  602. X
  603. X            (message "The %s %s %s %s %s." "cat" "sat" "on" "the" "mat")
  604. X            (message "%d == 0x%04x" 32767 32767)
  605. X.HU move_abs
  606. XSYNOPSIS:    (move_abs [line] [col])
  607. X
  608. XRETURN VALUE:
  609. X
  610. X    Returns non-zero if cursor moved; 0 if cursor didn't move.
  611. X
  612. XDESCRIPTION:
  613. X
  614. X    This  macro  moves  the  cursor  to  the  specified line and
  615. X    column  position.  If  either line or col are unspecified or
  616. X    zero, then the line or column position is left unchanged.
  617. X.HU move_edge
  618. XSYNOPSIS:    (move_edge [direction])
  619. X
  620. XRETURN VALUE:
  621. X
  622. X    Returns <= 0 if unsuccessful; > 0 otherwise.
  623. X
  624. XDESCRIPTION:
  625. X
  626. X    This   macro  is  used  to  expand  or  contract  a  window.
  627. X    direction  specifies  the  edge  which  is  to be moved. The
  628. X    expansion   is   performed   interactively.  This  macro  is
  629. X    designed to support tiled windows.
  630. X
  631. X    If  direction  is  specified,  it  should  have  one  of the
  632. X    following values:
  633. X
  634. X        0    Up
  635. X        1    Right
  636. X        2    Down
  637. X        3    Left.
  638. X.HU move_rel
  639. XSYNOPSIS:    (move_rel [line] [col])
  640. X
  641. XRETURN VALUE:
  642. X
  643. X    Returns non-zero if cursor moved; 0 if cursor didn't move.
  644. X
  645. XDESCRIPTION:
  646. X
  647. X    This  macro  moves  the current line or column plus or minus
  648. X    the  number  of  lines specified, ie the move is relative to
  649. X    the current cursor position.
  650. X
  651. SHAR_EOF
  652. chmod 0644 help/crisp/prim/M.cmd || echo "restore of help/crisp/prim/M.cmd fails"
  653. mkdir help help/crisp help/crisp/prim >/dev/null 2>&1
  654. echo "x - extracting help/crisp/prim/Misc.cmd (Text)"
  655. sed 's/^X//' << 'SHAR_EOF' > help/crisp/prim/Misc.cmd &&
  656. X.HU !
  657. XSYNOPSIS:       (! iexpr)
  658. X
  659. XRETURN VALUE:
  660. X
  661. X    Returns  1  if  expr evaluates to zero; returns 0 if expr is
  662. X    non-zero.
  663. X
  664. XDESCRIPTION:
  665. X
  666. X    Returns  the  logical  not of the expression expr. expr must
  667. X    evaluate to an integer expression.
  668. X.HU !=
  669. XSYNOPSIS:    (!= expr1 expr2)
  670. X
  671. XRETURN VALUE:
  672. X
  673. X    Returns  1  if  expr1  is  not equal to expr2; 0 if expr1 is
  674. X    equal to expr2.
  675. X
  676. XDESCRIPTION:
  677. X
  678. X    expr1  and  expr2 must either both be integer expressions or
  679. X    string expressions.
  680. X.HU %
  681. XSYNOPSIS:    (% iexpr1 iexpr2)
  682. X
  683. XRETURN VALUE:
  684. X
  685. X    Returns   the   integral   remainder   of   the   expression
  686. X    (iexpr1)/(iexpr2).
  687. X
  688. XDESCRIPTION:
  689. X
  690. X    This  is  the  modulus function. The example below shows the
  691. X    results of using negative numbers.
  692. X
  693. XEXAMPLES:
  694. X
  695. X    The  following  example  show the various pathological cases
  696. X    of the (%) function:
  697. X
  698. X        (macro x
  699. X            (
  700. X                (message "%d %d %d %d %d"
  701. X                    (% 4 -3)
  702. X                    (% 4 -3)
  703. X                    (% -4 3)
  704. X                    (% -4 -3)
  705. X                    (% -4 0))
  706. X            )
  707. X        )
  708. X
  709. X    The output is:
  710. X
  711. X        1 1 -1 -1 0
  712. X.HU %=
  713. XSYNOPSIS:    (%= ivar iexpr)
  714. X
  715. XRETURN VALUE:
  716. X
  717. X    Returns the value assigned to ivar.
  718. X
  719. XDESCRIPTION:
  720. X
  721. X    This macro is the same as:
  722. X
  723. X            (= ivar (% ivar iexpr))
  724. X
  725. X    ivar  is  the  name  of  an  integer  variable;  iexpr is an
  726. X    expression which evaluate to an integer.
  727. X
  728. X    See  (%)  for  details  on  the pathological use of negative
  729. X    numbers.
  730. X.HU &
  731. XSYNOPSIS:    (& iexpr1 iexp2)
  732. X
  733. XRETURN VALUE:
  734. X
  735. X    Returns  the  bit-wise  AND  of  iexpr1 and iexpr2. A 32-bit
  736. X    integer result is returned.
  737. X.HU &=
  738. XSYNOPSIS:    (&= ivar iexpr1)
  739. X
  740. XRETURN VALUE:
  741. X
  742. X    The value of ivar logically ANDed with iexpr.
  743. X
  744. XDESCRIPTION:
  745. X
  746. X    This is equivalent to:
  747. X
  748. X            (= ivar (& ivar iexpr))
  749. X.HU &&
  750. XSYNOPSIS:    (&& expr1 expr2)
  751. X
  752. XRETURN VALUE:
  753. X
  754. X    Returns   1   if  expr1  evaluates  to  non-zero  and  expr2
  755. X    evaluates to non-zero; 0 otherwise.
  756. X
  757. XDESCRIPTION:
  758. X
  759. X    This  is  the  conditional  AND macro. If expr1 evaluates to
  760. X    non-zero,  then  expr2  is  evaluated. If expr1 evaluates to
  761. X    zero,  then  expr2  is  not  evaluated. Thus, it is safe for
  762. X    expr1 and expr2 to have side-effects.
  763. X
  764. XEXAMPLES:
  765. X
  766. X    The  following  example  tests  var1  and if it is non-zero,
  767. X    increments var2 and tests to see if it is greater than 10.
  768. X
  769. X        (if (&& var1 (> (++ var2) 10))
  770. X            (message "var2 > 10"))
  771. X.HU *
  772. XSYNOPSIS:    (* iexpr1 iexpr2)
  773. X
  774. XRETURN VALUE:
  775. X
  776. X    The value of iexpr1 multiplied by iexpr2.
  777. X
  778. X.HU *=
  779. XSYNOPSIS:    (*= ivar iexpr1)
  780. X
  781. XRETURN VALUE:
  782. X
  783. X    The value of ivar multiplied by iexpr.
  784. X
  785. XDESCRIPTION:
  786. X
  787. X    This is equivalent to:
  788. X
  789. X            (= ivar (* ivar iexpr))
  790. X.HU +
  791. XSYNOPSIS:    (+ expr1 expr2)
  792. X
  793. XRETURN VALUE:
  794. X
  795. X    Either   the  integer  value  (expr1+expr2)  or  the  string
  796. X    formed by concatenating expr1 and expr2.
  797. X
  798. XDESCRIPTION:
  799. X
  800. X    iexpr1  and  iexpr2  must either be both integer expressions
  801. X    or string expressions.
  802. X.HU ++
  803. XSYNOPSIS:    (++ ivar)
  804. X
  805. XRETURN VALUE:
  806. X
  807. X    Returns the value (ivar+1).
  808. X
  809. XDESCRIPTION:
  810. X
  811. X    This  macro  forms  the pre-increment instruction. (There is
  812. X    no  post-increment  equivalent,  due  to  limitations in the
  813. X    syntax of the language).
  814. X
  815. X    The  variable  ivar is incremented and the value may then be
  816. X    used in an expression.
  817. X
  818. XEXAMPLES:
  819. X
  820. X    The following example can be used for controlling loops:
  821. X
  822. X        (int    i)
  823. X        (= i 0)
  824. X        (while (< (++ i) 10) (
  825. X            .
  826. X            .
  827. X            ))
  828. X.HU +=
  829. XSYNOPSIS:    (+= var expr)
  830. X
  831. XRETURN VALUE:
  832. X
  833. X    Returns  either  the  integer value (var+expr) or the string
  834. X    formed  by  the  concatenation of the string in variable var
  835. X    and the string returned by the expression expr.
  836. X
  837. XDESCRIPTION:
  838. X
  839. X    This is equivalent to:
  840. X
  841. X            (= var (+ var expr))
  842. X.HU -
  843. XSYNOPSIS:    (- iexpr1 iexpr2)
  844. X
  845. XRETURN VALUE:
  846. X
  847. X    Returns the integer value iexpr1 minus iexpr2.
  848. X
  849. XDESCRIPTION:
  850. X
  851. X    iexpr1 and iexpr2 must both evaluate to integer expressions.
  852. X.HU --
  853. XSYNOPSIS:    (-- ivar)
  854. X
  855. XRETURN VALUE:
  856. X
  857. X    Returns the value (ivar-1).
  858. X
  859. XDESCRIPTION:
  860. X
  861. X    This  macro  forms  the pre-decrement instruction. (There is
  862. X    no  post-increment  equivalent,  due  to  limitations in the
  863. X    syntax of the language).
  864. X
  865. X    The  variable  ivar is decremented and the value may then be
  866. X    used in an expression.
  867. X.HU -=
  868. XSYNOPSIS:    (-= ivar iexpr)
  869. X
  870. XRETURN VALUE:
  871. X
  872. X    Returns the value (ivar-iexpr).
  873. X
  874. XDESCRIPTION:
  875. X
  876. X    This is equivalent to:
  877. X
  878. X            (= ivar (- ivar iexpr))
  879. X.HU /
  880. XSYNOPSIS:    (/ iexpr1 iexpr2)
  881. X
  882. XRETURN VALUE:
  883. X
  884. X    Returns the value of iexpr1 divided by iexpr2.
  885. X
  886. XDESCRIPTION:
  887. X
  888. X    If iexpr2 is zero, then iexpr1 is returned.
  889. X.HU /=
  890. XSYNOPSIS:    (/= ivar iexpr)
  891. X
  892. XRETURN VALUE:
  893. X
  894. X    Returns the value ivar divided by iexpr.
  895. X
  896. XDESCRIPTION:
  897. X
  898. X    This is equivalent to:
  899. X
  900. X            (= ivar (/ ivar iexpr))
  901. X.HU <
  902. XSYNOPSIS:    (< expr1 expr2)
  903. X
  904. XRETURN VALUE:
  905. X
  906. X    Returns  1  if  expr1 and expr2 are integer values and expr1
  907. X    is  less  than  expr2; returns 1 if expr1 & expr2 are string
  908. X    expressions  and  expr1  lexicographically  preceeds  expr2.
  909. X    Returns 0 otherwise.
  910. X
  911. XDESCRIPTION:
  912. X
  913. X    expr1  &  expr2  must  either be both integer expressions or
  914. X    string expressions.
  915. X.HU <=
  916. XSYNOPSIS:    (<= expr1 expr2)
  917. X
  918. XRETURN VALUE:
  919. X
  920. X    Returns  1  if  expr1 and expr2 are integer values and expr1
  921. X    is  less  than or equal to expr2; returns 1 if expr1 & expr2
  922. X    are   string   expressions   and   expr1   lexicographically
  923. X    preceeds expr2 or is equal to expr2. Returns 0 otherwise.
  924. X
  925. XDESCRIPTION:
  926. X
  927. X    expr1  &  expr2  must  either be both integer expressions or
  928. X    string expressions.
  929. X.HU =
  930. XSYNOPSIS:    (= var expr)
  931. X
  932. XRETURN VALUE:
  933. X
  934. X    Returns the value of expr.
  935. X
  936. XDESCRIPTION:
  937. X
  938. X    This  is  the  assignment  operator.  var  is  the name of a
  939. X    symbol,  and  expr  must be an expression which evaluates to
  940. X    the  same  type  as 'var', unless 'var' has been declared as
  941. X    a polymorphic variable. (See (declare)).
  942. X    
  943. X    var  and  expr  must  agree  in type. They can have integer,
  944. X    string  or  list  type. For list variables, it is acceptable
  945. X    for  expr  to  be NULL or omitted, in which case the storage
  946. X    allocated to the variable var is freed.
  947. X
  948. XEXAMPLES:
  949. X
  950. X    (int i)
  951. X    (= i (+ 1 2))
  952. X    (string s)
  953. X    (= s (+ "fred" " bloggs"))
  954. X    (list l)
  955. X    (= l (quote_list 1 2 3))
  956. X    (= l NULL)
  957. X    (= l) ; same as previous example.
  958. X.HU ==
  959. XSYNOPSIS:    (== expr1 expr2)
  960. X
  961. XRETURN VALUE:
  962. X
  963. X    Returns 1 if expr1 is equal to expr2. Returns 0 otherwise.
  964. X
  965. XDESCRIPTION:
  966. X
  967. X    expr1  &  expr2  must  either be both integer expressions or
  968. X    string expressions.
  969. X.HU >
  970. XSYNOPSIS:    (> expr1 expr2)
  971. X
  972. XRETURN VALUE:
  973. X
  974. X    Returns  1  if  expr1 and expr2 are integer values and expr1
  975. X    is  greater  than  expr2;  returns  1  if  expr1 & expr2 are
  976. X    string   expressions  and  expr1  lexicographically  follows
  977. X    expr2. Returns 0 otherwise.
  978. X
  979. XDESCRIPTION:
  980. X
  981. X    expr1  &  expr2  must  either be both integer expressions or
  982. X    string expressions.
  983. X.HU >=
  984. XSYNOPSIS:    (>= expr1 expr2)
  985. X
  986. XRETURN VALUE:
  987. X
  988. X    Returns  1  if  expr1 and expr2 are integer values and expr1
  989. X    is  greater  than  or  equal  to expr2; returns 1 if expr1 &
  990. X    expr2  are  string  expressions  and expr1 lexicographically
  991. X    preceeds expr2 or is equal to expr2. Returns 0 otherwise.
  992. X
  993. XDESCRIPTION:
  994. X
  995. X    expr1  &  expr2  must  either be both integer expressions or
  996. X    string expressions.
  997. X.HU |
  998. XSYNOPSIS:    (| iexpr1 iexpr2)
  999. X
  1000. XRETURN VALUE:
  1001. X
  1002. X    Returns  the  logical  OR  of  integer expression iexpr1 and
  1003. X    iexpr2.
  1004. X
  1005. X.HU |=
  1006. XSYNOPSIS:    (|= ivar iexpr1)
  1007. X
  1008. XRETURN VALUE:
  1009. X
  1010. X    The value of ivar logically ORed with iexpr.
  1011. X
  1012. XDESCRIPTION:
  1013. X
  1014. X    This is equivalent to:
  1015. X
  1016. X            (= ivar (| ivar iexpr))
  1017. X.HU ||
  1018. XSYNOPSIS:    (|| expr1 expr2)
  1019. X
  1020. XRETURN VALUE:
  1021. X
  1022. X    Returns 1 if expr1 OR expr2 evaluate to non-zero.
  1023. X
  1024. XDESCRIPTION:
  1025. X
  1026. X    This  is  the conditional OR function. If expr1 evaluates to
  1027. X    non-zero  then  expr2  is  not evaluated. If expr1 evaluates
  1028. X    to zero, then the result of expr2 is returned.
  1029. X.HU ^
  1030. XSYNOPSIS:    (^ iexpr1 iexpr2)
  1031. X
  1032. XRETURN VALUE:
  1033. X
  1034. X    Returns  the  logical XOR  of  integer expression iexpr1 and
  1035. X    iexpr2.
  1036. X
  1037. X.HU ^=
  1038. XSYNOPSIS:    (^= ivar iexpr1)
  1039. X
  1040. XRETURN VALUE:
  1041. X
  1042. X    The value of ivar logically XORed with iexpr.
  1043. X
  1044. XDESCRIPTION:
  1045. X
  1046. X    This is equivalent to:
  1047. X
  1048. X            (= ivar (^ ivar iexpr))
  1049. X.HU ~
  1050. XSYNOPSIS:    (~ iexpr)
  1051. X
  1052. XRETURN VALUE:
  1053. X
  1054. X    Returns the 1's complement of the integer expression iexpr.
  1055. X.HU _bad_key
  1056. XSYNOPSIS:    (_bad_key)
  1057. X
  1058. XRETURN VALUE:
  1059. X
  1060. X    A string.
  1061. X
  1062. XDESCRIPTION:
  1063. X
  1064. X    (_bad_key)  is  not  actually  a  built-in primitive, but is
  1065. X    used   by   CRISP  to  implement  the  command  history  and
  1066. X    abbreviation features.
  1067. X
  1068. X    The  macro  _bad_key  is called from within CRISP when a bad
  1069. X    key  is  pressed  during  a  prompt.  This macro can use the
  1070. X    (inq_message)  and  (inq_cmd_line)  macros  to  see what the
  1071. X    state  of  the  status line is. It can also call (read_char)
  1072. X    to  retrieve  the  key  which  caused  the  problem  -- this
  1073. X    allows  the  _bad_key  macro  to distinguish between context
  1074. X    sensitive help, or abbreviations etc.
  1075. X
  1076. X    The  macro  should return a string value, in which case this
  1077. X    is  taken  as  the  current input for the response field (it
  1078. X    will  be  highlited  as  the default value). The (push_back)
  1079. X    macro can be used to force acceptance of a default response.
  1080. X
  1081. X    See  the  history.m  macro file for an example of how to use
  1082. X    the (_bad_key) macro.
  1083. X
  1084. SHAR_EOF
  1085. chmod 0644 help/crisp/prim/Misc.cmd || echo "restore of help/crisp/prim/Misc.cmd fails"
  1086. mkdir help help/crisp help/crisp/prim >/dev/null 2>&1
  1087. echo "x - extracting help/crisp/prim/N.cmd (Text)"
  1088. sed 's/^X//' << 'SHAR_EOF' > help/crisp/prim/N.cmd &&
  1089. X.HU next_buffer
  1090. XSYNOPSIS:    (next_buffer [system])
  1091. X
  1092. XRETURN VALUE:
  1093. X
  1094. X    Returns the buffer id of the next buffer in the buffer list.
  1095. X
  1096. XDESCRIPTION:
  1097. X
  1098. X    (next_buffer)   is   the   mechanism   for  enumerating  all
  1099. X    buffers.  It  returns  the  buffer  id of the next buffer in
  1100. X    the list.
  1101. X
  1102. X    system   is   an  optional  integer  which  if  present  and
  1103. X    non-zero  allows  the  calling  macro  to  walk through each
  1104. X    system   buffer  as  well  (see  create_buffer).  If  it  is
  1105. X    omitted,   then   system  buffers  are  stepped  over.  This
  1106. X    facility  is  used by the (buffer_list) macro if the systems
  1107. X    option is turned on.
  1108. X
  1109. XEXAMPLES:
  1110. X
  1111. X    The  following  example  shows how to walk down each buffer,
  1112. X    including system buffers:
  1113. X
  1114. X            (int curbuf)
  1115. X            (int buf)
  1116. X
  1117. X            (= curbuf (inq_buffer))
  1118. X            (= buf (+ curbuf 1))
  1119. X            (while (!= curbuf buf) (
  1120. X                .
  1121. X                .
  1122. X                (= buf (next_buffer 1))
  1123. X                ))
  1124. X.HU next_char
  1125. XSYNOPSIS:    (next_char [num])
  1126. X
  1127. XRETURN VALUE:
  1128. X
  1129. X    Returns  non-zero  if  the  cursor changed position; zero if
  1130. X    it didn't.
  1131. X
  1132. XDESCRIPTION:
  1133. X
  1134. X    This  function  is  similar  to  (right) except it moves the
  1135. X    cursor  over  physical  characters,  eg  tabs are treated as
  1136. X    single characters, rather than virtual spaces.
  1137. X
  1138. X    If   num   is   specified  then  that  number  of  character
  1139. X    positions are skipped over.
  1140. X
  1141. X    If  the  cursor  is moved past the end of the line, then the
  1142. X    cursor wraps around to the start of the next line.
  1143. X.HU nothing
  1144. XSYNOPSIS:    (nothing)
  1145. X
  1146. XRETURN VALUE:
  1147. X
  1148. X    Nothing.
  1149. X
  1150. XDESCRIPTION:
  1151. X
  1152. X    This  macro  is  a no-op. It exists simply as a place holder
  1153. X    for  the  language  and is valid anywhere any other macro is
  1154. X    valid.
  1155. X.HU nth
  1156. XSYNOPSIS:    (nth expr list_expr)
  1157. X
  1158. XRETURN VALUE:
  1159. X
  1160. X    Returns  the  n'th  atom  in list_expr, where n is the value
  1161. X    of the integer expression expr.
  1162. X
  1163. XDESCRIPTION:
  1164. X
  1165. X    This  macro  allows  the  caller to extract individual atoms
  1166. X    from  a  list. The first element of a list is element 0; the
  1167. X    (nth)  macro  allows  lists  to  be treated like arrays. The
  1168. X    last element of a list is (length_of_list)-1.
  1169. X
  1170. X    nth  is  a  more  efficient way of accessing random elements
  1171. X    in  a  list,  than for example, using (car) and (cdr), since
  1172. X    the list expression doesn't need to be copied so much.
  1173. X
  1174. SHAR_EOF
  1175. chmod 0644 help/crisp/prim/N.cmd || echo "restore of help/crisp/prim/N.cmd fails"
  1176. mkdir help help/crisp help/crisp/prim >/dev/null 2>&1
  1177. echo "x - extracting help/crisp/prim/P.cmd (Text)"
  1178. sed 's/^X//' << 'SHAR_EOF' > help/crisp/prim/P.cmd &&
  1179. X.HU page_down
  1180. XSYNOPSIS:    (page_down)
  1181. X
  1182. XRETURN VALUE:
  1183. X
  1184. X    Nothing.
  1185. X
  1186. XDESCRIPTION:
  1187. X
  1188. X    Moves  the  cursor  one  window-full  towards the end of the
  1189. X    buffer.
  1190. X.HU page_up
  1191. XSYNOPSIS:    (page_up)
  1192. X
  1193. XRETURN VALUE:
  1194. X
  1195. X    Nothing.
  1196. X
  1197. XDESCRIPTION:
  1198. X
  1199. X    Moves  the  cursor  one window-full towards the beginning of
  1200. X    the buffer.
  1201. X.HU paste
  1202. XSYNOPSIS:    (paste)
  1203. X
  1204. XRETURN VALUE:
  1205. X
  1206. X    Nothing.
  1207. X
  1208. XDESCRIPTION:
  1209. X
  1210. X    This  macro  copies  the  contents  of  the scrap buffer and
  1211. X    inserts  it  into  the  current  buffer  where the cursor is
  1212. X    located.
  1213. X.HU pause
  1214. XSYNOPSIS:    (pause)
  1215. X
  1216. XRETURN VALUE:
  1217. X
  1218. X    Nothing.
  1219. X
  1220. XDESCRIPTION:
  1221. X
  1222. X    (pause)  is  used  to  pause  a  keyboard  macro definition.
  1223. X    Usually   all  keyboard  input  typed  during  a  (remember)
  1224. X    sequence  is  saved in the keyboard macro buffer. Pressing a
  1225. X    key  assigned  to  (pause) causes the (remember) sequence to
  1226. X    suspend saving the characters.
  1227. X.HU pause_on_error
  1228. XSYNOPSIS:    (pause_on_error [pause])
  1229. X
  1230. XRETURN VALUE:
  1231. X
  1232. X    Non-zero  if  previous  setting was paused messages on; 0 is
  1233. X    previous setting was no pausing of error messages.
  1234. X
  1235. XDESCRIPTION:
  1236. X
  1237. X    This  macro  is  used  to  set  or toggle the pause on error
  1238. X    flag.  This  flag  is  tested after every (error) message is
  1239. X    displayed.  If  this  flag  is  on then the error message is
  1240. X    displayed  with  a '..' suffix added to the end of the error
  1241. X    message  and  CRISP  waits  for  the user to type any key on
  1242. X    the  keyboard  to  continue.  This  allows  the  user to see
  1243. X    error   messages   before  they  get  overwritten  by  other
  1244. X    messages.
  1245. X
  1246. X    By  default  this is off. If (pause_on_error) is called with
  1247. X    no  argument,  then  the  current state is toggled and CRISP
  1248. X    prints  the  message 'Pausing errors on.' or 'Pausing errors
  1249. X    off.'  If  pause  is  specified  then the current setting is
  1250. X    set to the value of the integer expression pause.
  1251. X
  1252. XEXAMPLES:
  1253. X
  1254. X    The  following  example  shows  how  (pause_on_error) can be
  1255. X    used  around  a call to a macro so that the user can see the
  1256. X    errors  being  displayed  by  the macro without resorting to
  1257. X    sight-reading.
  1258. X
  1259. X            (pause_on_error) ;Toggle state to on.
  1260. X            (fred)         ;Call macro.
  1261. X            (pause_on_error) ;Toggle state to off.
  1262. X.HU playback
  1263. XSYNOPSIS:    (playback [macro])
  1264. X
  1265. XRETURN VALUE:
  1266. X
  1267. X    Returns  greater  than  or  equal  to  zero  if playback was
  1268. X    successful. Less than zero otherwise.
  1269. X
  1270. XDESCRIPTION:
  1271. X
  1272. X    (playback)  causes  the saved keyboard macro to be replayed.
  1273. X    If  macro  is  not specified, then the last macro defined is
  1274. X    played back.
  1275. X
  1276. X    (playback)  is  not  usually called from within a macro, but
  1277. X    instead is usually bound to the <F8> key.
  1278. X.HU prev_char
  1279. XSYNOPSIS:    (prev_char [num])
  1280. X
  1281. XRETURN VALUE:
  1282. X
  1283. X    Nothing
  1284. X
  1285. XDESCRIPTION:
  1286. X
  1287. X    Moves  the  cursor backwards by num characters. The movement
  1288. X    is  by  physical  characters, and treats tabs, etc as single
  1289. X    characters.
  1290. X
  1291. X    If  the  cursor is moved beyond the beginning of the current
  1292. X    line  then  the  cursor  wraps  around  to  the  end  of the
  1293. X    previous line.
  1294. X.HU print
  1295. XSYNOPSIS:    (print)
  1296. X
  1297. XRETURN VALUE:
  1298. X
  1299. X    Nothing.
  1300. X
  1301. XDESCRIPTION:
  1302. X
  1303. X    This  macro  is  used to send the currently marked region to
  1304. X    the  printer.  It exists for compatability with BRIEF but is
  1305. X    an  unimplemented  function. This is because most Unix users
  1306. X    will  not  have their own personal printer, and will tend to
  1307. X    use  the  Unix  line printer spooler instead. Thus little is
  1308. X    gained by supporting this.
  1309. X
  1310. X    If  there  is  enough  demand,  this  will be implemented by
  1311. X    sending  the  marked  area  to the print spooler. Please let
  1312. X    me know if it causes a problem.
  1313. X.HU printf
  1314. XSYNOPSIS:    (printf fmt [arg1] [arg2] ..)
  1315. X
  1316. XRETURN VALUE:
  1317. X
  1318. X    Nothing.
  1319. X
  1320. XDESCRIPTION:
  1321. X
  1322. X    This  macro  can  be used for debugging macros, although its
  1323. X    use  is  questionable.  It  exists for compatability reasons
  1324. X    with  BRIEF.  It  causes  the  formatted  string  to be sent
  1325. X    directly   to  stdout,  bypassing  all  of  CRISPs  internal
  1326. X    screen manipulations.
  1327. X
  1328. X    Its  use  is  questionable  since  it is presumably provided
  1329. X    for  use  with  BRIEF  and MS-DOS for debugging BRIEF itself
  1330. X    and  BRIEF  macros.  Under  MS-DOS, BRIEF writes directly to
  1331. X    the  video  memory  and  it may be useful to have a separate
  1332. X    error logging channel which can be redirected to a file.
  1333. X
  1334. X    Under  Unix,  stdout  is  used  for all display purposes, so
  1335. X    the  printf  output  stream  would  be intermingled with the
  1336. X    display stream.
  1337. X
  1338. X    If  you  need  to track the progress of a macro, use (debug)
  1339. X    since it gives you a much finer granularity of output.
  1340. X.HU process
  1341. XSYNOPSIS:    (process)
  1342. X
  1343. XRETURN VALUE:
  1344. X
  1345. X    Nothing.
  1346. X
  1347. XDESCRIPTION:
  1348. X
  1349. X    The  (process)  macro  is the mechanism for causing CRISP to
  1350. X    nest  keyboard  invocations. CRISP maintains a process level
  1351. X    counter  which  is  normally  set  to 1. When in the process
  1352. X    mode,  CRISP  accepts  keystrokes  and  executes  the macros
  1353. X    bound to those keystrokes.
  1354. X
  1355. X    A  call  to (process) is usually made after creating buffers
  1356. X    and  windows  for  display  on  screen,  and having set up a
  1357. X    temporary  keyboard  map.  Return  from  a call to (process)
  1358. X    only occurs as a result of a macro calling the (exit) macro.
  1359. X
  1360. X    The  current  process  level  is  terminated  via  a call to
  1361. X    (exit).  When  the  process  level goes to zero, CRISP exits
  1362. X    (possibly after prompting the user to save buffers).
  1363. X
  1364. X    Process  nesting  may  occur to any depth, within the bounds
  1365. X    of CRISPs maximum nesting level.
  1366. X
  1367. X    The  term  'process'  is  a  misnomer  and  in  this context
  1368. X    should  not  be  confused  with process buffers, which are a
  1369. X    completely different concept.
  1370. X.HU profile
  1371. XSYNOPSIS:    (profile [expr])
  1372. X
  1373. XRETURN VALUE:
  1374. X
  1375. X    Nothing.
  1376. X
  1377. XDESCRIPTION:
  1378. X
  1379. X    (profile)   exists   solely   to  help  profile  CRISPs  own
  1380. X    execution  so  that  it  may  be  optimised.  By  default  a
  1381. X    mon.out  file  is created whenever a program exits which was
  1382. X    compiled  with  the  'cc  -p'  flag.  When  CRISP  exits, it
  1383. X    usually  avoids  calling  exit()  so  that  the mon.out file
  1384. X    does  not  get  written.  This  allows  CRISP to be compiled
  1385. X    with  the  -p  flag and installed without causing every user
  1386. X    to  inadvertently  create  mon.out  files  all over the file
  1387. X    system.
  1388. X
  1389. X    In  order  to  get a mon.out file on exit from CRISP, either
  1390. X    run CRISP with the -p flag, or call this macro.
  1391. X
  1392. X    If  expr  is omitted, the profile option is toggled. If expr
  1393. X    is  non-zero  then  a mon.out file will be created; if it is
  1394. X    zero, then mon.out will not be created.
  1395. X
  1396. X    Note  that  this  option  only  works  if CRISP was compiled
  1397. X    with the profiling code included.
  1398. X.HU push_back
  1399. XSYNOPSIS:    (push_back key)
  1400. X
  1401. XRETURN VALUE:
  1402. X
  1403. X    Nothing.
  1404. X
  1405. XDESCRIPTION:
  1406. X
  1407. X    This  macro  is  used  to  push  a  character  back into the
  1408. X    typeahead  buffer.  The  character  pushed  back sits at the
  1409. X    front  of  the  input  buffer  and  is  read before any user
  1410. X    typeahead.
  1411. X
  1412. X    key  is  an  integer internal key code, usually derived from
  1413. X    a (read_char) or (key_to_int) macro call.
  1414. X.HU put_nth
  1415. XSYNOPSIS:    (put_nth expr list_var value)
  1416. X
  1417. XRETURN VALUE:
  1418. X
  1419. X    Nothing.
  1420. X
  1421. XDESCRIPTION:
  1422. X
  1423. X    (put_nth)  is  used  to  modify  or insert a new atom into a
  1424. X    list.  list_var  is  the list; expr is the atom number to be
  1425. X    inserted  (0  is  the  first  atom).  value  is  an integer,
  1426. X    string or list expression which is to be inserted.
  1427. X
  1428. X    If  the  atom  to be inserted already exists, then that atom
  1429. X    is deleted, and replaced by the new value.
  1430. X
  1431. X    If  the  expr'th atom does not exist, then value is inserted
  1432. X    onto  the  end  of  the  list.  It is not possible to create
  1433. X    sparse  lists,  only new entries may be tacked on to the end
  1434. X    of a list.
  1435. X
  1436. XEXAMPLES:
  1437. X
  1438. X    The  following  example  creates a list of the ten integers,
  1439. X    1..10:
  1440. X
  1441. X            (int    i)
  1442. X            (list    l)
  1443. X
  1444. X            (= i 1)
  1445. X            (while (<= i 10) (
  1446. X                (put_nth i l i)
  1447. X                (++ i)
  1448. X                ))
  1449. X.HU put_parm
  1450. XSYNOPSIS:    (put_parm num value)
  1451. X
  1452. XRETURN VALUE:
  1453. X
  1454. X    Returns  0  if successful; greater than zero if argument num
  1455. X    does not exist.
  1456. X
  1457. XDESCRIPTION:
  1458. X
  1459. X    This  macro  is  used  to  modify  a  calling parameter. num
  1460. X    specifies  the  argument  number,  and value is the value to
  1461. X    place  in  that  argument.  value  may  be  a  string  or an
  1462. X    integer expression. (Lists are not currently supported).
  1463. X
  1464. X    This  macro  allows  the  calling  macro  to  pass  multiple
  1465. X    values  to  its calling macro. The calling macro should call
  1466. X    this  macro  with  the name of an integer or string macro in
  1467. X    the num'th position.
  1468. X
  1469. SHAR_EOF
  1470. chmod 0644 help/crisp/prim/P.cmd || echo "restore of help/crisp/prim/P.cmd fails"
  1471. mkdir help help/crisp help/crisp/prim >/dev/null 2>&1
  1472. echo "x - extracting help/crisp/prim/R.cmd (Text)"
  1473. sed 's/^X//' << 'SHAR_EOF' > help/crisp/prim/R.cmd &&
  1474. X.HU raise_anchor
  1475. XSYNOPSIS:    (raise_anchor)
  1476. X
  1477. XRETURN VALUE:
  1478. X
  1479. X    Nothing.
  1480. X
  1481. XDESCRIPTION:
  1482. X
  1483. X    (raise_anchor)  is  used to raise the current marked region,
  1484. X    ie remove it. The currently highlited region is unhighlited.
  1485. X.HU re_syntax
  1486. XSYNOPSIS:    (re_syntax [mode])
  1487. X
  1488. XRETURN VALUE:
  1489. X
  1490. X    Returns  the  current regular expression syntax mode - 0 for
  1491. X    BRIEF/CRISP syntax, 1 for Unix-like syntax.
  1492. X
  1493. XDESCRIPTION:
  1494. X
  1495. X    This   macro   allows   the   user  to  select  the  regular
  1496. X    expression  syntax  mode.  By  default,  the mode is set for
  1497. X    BRIEF/CRISP  regular  expression  syntax.  If mode is set to
  1498. X    1,  then  Unix  like syntax is selected. The differences are
  1499. X    as follows:
  1500. X
  1501. X    In  Unix  mode, the '*' and '.' characters have their normal
  1502. X    meanings.  The  BRIEF/CRISP  characters  '@'  and '?' act as
  1503. X    non   regular  expression  characters.  Also  the  {  and  }
  1504. X    characters   are   replaced   by   their   backslash-(   and
  1505. X    backslash-) equivalents.
  1506. X    
  1507. X.HU read
  1508. XSYNOPSIS:    (read [num])
  1509. X
  1510. XRETURN VALUE:
  1511. X
  1512. X    Returns  a  string  containing  the next num characters from
  1513. X    the  input  buffer, or the rest of the line after the cursor
  1514. X    if num is not specified.
  1515. X
  1516. XDESCRIPTION:
  1517. X
  1518. X    If  num  is  not specified, then all characters to the right
  1519. X    of  the  cursor  are  returned,  together  with  the newline
  1520. X    character which terminates all lines.
  1521. X
  1522. X    If  num  is  specified,  then  that number of characters are
  1523. X    read  from  the  buffer. If num is longer than the remaining
  1524. X    characters  on  the  current line, then only the rest of the
  1525. X    current line is returned.
  1526. X.HU read_char
  1527. XSYNOPSIS:    (read_char)
  1528. X
  1529. XRETURN VALUE:
  1530. X
  1531. X    Internal  key  code of character typed or -1 if no character
  1532. X    available.
  1533. X
  1534. XDESCRIPTION:
  1535. X
  1536. X    This  macro  can  be used to see if a character is available
  1537. X    from  the  typeahead buffer. If a character is available, it
  1538. X    is  returned  (in internal key code form), and the character
  1539. X    removed from the typeahead buffer.
  1540. X
  1541. X    If  a  non-destructive  peek  into  the  typeahead buffer is
  1542. X    required, use (inq_kbd_char).
  1543. X
  1544. X    Under  DOS  (and BRIEF), (read_char) can be used to poll the
  1545. X    keyboard. Some BRIEF macros do this with a while loop:
  1546. X
  1547. X            (while (== (read_char) -1)
  1548. X                (nothing))
  1549. X
  1550. X    This  is  not  a  very nice thing to do on a Unix system, so
  1551. X    by   default  (read_char)  is  a  suspensive  operation,  ie
  1552. X    calling  (read_char)  will  actually pause the macro until a
  1553. X    character  is  typed.  If  CRISP  is  run with the '-w' flag
  1554. X    then  (read_char)  will act as it does under DOS, and return
  1555. X    -1  if  no character is available from the input buffer. Use
  1556. X    of  the  -w  flag  should  be  avoided since otherwise CRISP
  1557. X    will hog the CPU.
  1558. X
  1559. X    Internal  key  codes should not be manipulated as is (unless
  1560. X    the  keys  are  being inserted into the current buffer), but
  1561. X    rather   should  be  converted  to  the  canonical  key-code
  1562. X    format, via int_to_key.
  1563. X.HU read_file
  1564. XSYNOPSIS:    (read_file [filename])
  1565. X
  1566. XRETURN VALUE:
  1567. X
  1568. X    Zero if unsuccessful; non-zero otherwise.
  1569. X
  1570. XDESCRIPTION:
  1571. X
  1572. X    This  macro  is  used to read a file into the current buffer
  1573. X    at  the  current  cursor  position.  If filename is omitted,
  1574. X    then the user is prompted for the file-name.
  1575. X.HU redraw
  1576. XSYNOPSIS:    (redraw)
  1577. X
  1578. XRETURN VALUE:
  1579. X
  1580. X    Nothing.
  1581. X
  1582. XDESCRIPTION:
  1583. X
  1584. X    This  macro  is used to physically redraw every character on
  1585. X    the   screen,   after  first  clearing  the  screen.  It  is
  1586. X    sometimes  required  on  serial lines, etc, where the screen
  1587. X    has garbage on it, and CRISP has lost control.
  1588. X.HU refresh
  1589. XSYNOPSIS:    (refresh)
  1590. X
  1591. XRETURN VALUE:
  1592. X
  1593. X    Nothing.
  1594. X
  1595. XDESCRIPTION:
  1596. X
  1597. X    This  macro  is  used  to  update  the  screen  after making
  1598. X    various  changes  to  buffers  and/or  windows. It optimises
  1599. X    the amount of output to the screen.
  1600. X.HU register_macro
  1601. XSYNOPSIS:    (register_macro num macro [local])
  1602. X
  1603. XRETURN VALUE:
  1604. X
  1605. X    Nothing.
  1606. X
  1607. XDESCRIPTION:
  1608. X
  1609. X    Registered  macros  are  hooks  into the execution of CRISP.
  1610. X    CRISP  defines  triggers  which  allow the user's macro's to
  1611. X    be activated when certain conditions arise in CRISP.
  1612. X
  1613. X    The  conditions  are described by the 'num' parameter, which
  1614. X    is an integer expression. The conditions are listed below.
  1615. X
  1616. X    macro  is  the  name  of a macro to call when the trigger is
  1617. X    pulled.  If  local  is  specified  and is non-zero, then the
  1618. X    macro  is  only  registered  for  this buffer, otherwise the
  1619. X    event  may  be triggered even when the current buffer is not
  1620. X    selected.
  1621. X
  1622. X    Multiple   macros   may  be  associated  with  a  particular
  1623. X    registered  macro.  When the registered macro is called, the
  1624. X    macros are called in FIFO order.
  1625. X
  1626. X    Registered    macros   may   be   removed   by   using   the
  1627. X    (unregister_macro)   macro  call;  a  particular  registered
  1628. X    macro can be triggered via (call_registered_macro).
  1629. X
  1630. X        0    A  character  has been inserted into the
  1631. X            current buffer via (self_insert).
  1632. X    
  1633. X        1    This  is  called  every time the current
  1634. X            buffer is changed via (edit_file).
  1635. X    
  1636. X        2    This   is   triggered   every  time  the
  1637. X            <Alt-H>  key  is  pressed,  and  is used
  1638. X            for the context sensitive help feature.
  1639. X    
  1640. X        3    This    is    triggered    whenever   an
  1641. X            unassigned key is pressed.
  1642. X    
  1643. X        4    This  is  triggered  when  the  keyboard
  1644. X            idle   timer   expires.  It  allows  the
  1645. X            autosave feature to be implemented.
  1646. X    
  1647. X        5    This   is   called   just  before  CRISP
  1648. X            exits.  It  allows  macros  to  tidy  up
  1649. X            after  themselves,  eg  delete temporary
  1650. X            files, save editing state.
  1651. X    
  1652. X        6    This  is  called  every  time a new file
  1653. X            is read in to a buffer (via edit_file).
  1654. X    
  1655. X        7    This  is  called whenever the user types
  1656. X            the   interrupt  character  (by  default
  1657. X            ^Y).  This  allows  macros to set a flag
  1658. X            which can cause them to abort.
  1659. X    
  1660. X        8    This  is  called whenever the user types
  1661. X            in  an  invalid  key during input on the
  1662. X            status/prompt   line.  This  allows  the
  1663. X            abbreviation  and  help facilities to be
  1664. X            implemented.
  1665. X
  1666. X.HU remember
  1667. XSYNOPSIS:    (remember [overwrite] [macro])
  1668. X
  1669. XRETURN VALUE:
  1670. X
  1671. X    Nothing.
  1672. X
  1673. XDESCRIPTION:
  1674. X
  1675. X    remember  is  used to record a keyboard macro (a sequence of
  1676. X    keystrokes) that can later be played back via (playback).
  1677. X
  1678. X    The  argument  overwrite  is  an optional string whose first
  1679. X    character  is  examined  to see whether an existing keyboard
  1680. X    macro  should  be  overwritten.  If a keyboard macro already
  1681. X    exists,  and  overwrite  is  not specified, then the user is
  1682. X    prompted  to  overwrite the macro. If overwrite is specified
  1683. X    and  the  first  character of overwrite is a 'y' or 'Y' then
  1684. X    the keyboard macro will be overwritten.
  1685. X
  1686. X    macro   specifies   which   keyboard   macro  to  store  the
  1687. X    keystrokes  in.  CRISP  has  by  default  20 keyboard macros
  1688. X    0..19.  If  macro is unspecified then the next free keyboard
  1689. X    macro  is  chosen.  The  internal  counter wraps around when
  1690. X    all the keyboard macros have been used up.
  1691. X    
  1692. X    If  remember  is  called  whilst recording a keyboard macro,
  1693. X    then the recording is terminated.
  1694. X
  1695. X    remember  is  not  usually  called as part of a macro but is
  1696. X    usually bound to a keyboard key (<F7>).
  1697. X    
  1698. X    remember  will  also  create  a  buffer  called KBD-MACRO-xx
  1699. X    where   xx   is  the  keyboard  macro  number.  This  buffer
  1700. X    contains  the  top  level macros executed by the user typing
  1701. X    in  the  keys.  This  facility  allows  the user to save and
  1702. X    edit  a  keyboard  macro.  Note  that  not  all  the  macros
  1703. X    executed  by  the  user  are  saved in the buffer - only the
  1704. X    top  level  ones.  What this means is that keyboard input to
  1705. X    things  like  dialog boxes (eg, the buffer list) will not be
  1706. X    listed.  The  buffer  so created is a normal buffer but will
  1707. X    not  be  automatically saved when you exit. It is the user's
  1708. X    responsibility  to  save  the buffer is you want to keep the
  1709. X    macro.
  1710. X.HU restore_position
  1711. XSYNOPSIS:    (restore_position [move])
  1712. X
  1713. XRETURN VALUE:
  1714. X
  1715. X    Returns  0  if there is no saved position on the stack; 1 if
  1716. X    position was successfully restored.
  1717. X
  1718. XDESCRIPTION:
  1719. X
  1720. X    This  macro  restores  a  saved  position  from the position
  1721. X    stack.  move  is  an optional integer expression. If move is
  1722. X    specified  and  is  zero,  then  the  saved  position is not
  1723. X    restored, but simply discarded.
  1724. X
  1725. X    The  saved  position  stack  is  independent  of the current
  1726. X    buffer.
  1727. X.HU return
  1728. XSYNOPSIS:    (return [expr])
  1729. X
  1730. XRETURN VALUE:
  1731. X
  1732. X    Value of expr.
  1733. X
  1734. XDESCRIPTION:
  1735. X
  1736. X    This  macro  is  used to return from a macro, and optionally
  1737. X    return  a  value.  If  expr  is  specified,  it  may  be  an
  1738. X    integer, string or list expression.
  1739. X
  1740. X    The  current  macro  is terminated and control passes to the
  1741. X    calling macro.
  1742. X.HU returns
  1743. XSYNOPSIS:    (returns [expr])
  1744. X
  1745. XRETURN VALUE:
  1746. X
  1747. X    Value of expr.
  1748. X
  1749. XDESCRIPTION:
  1750. X
  1751. X    This  macro  is similar to (return), except it doesn't cause
  1752. X    the  current  macro  to  terminate.  It  simply  sets CRISPs
  1753. X    internal  accumulator  with  the value of expr. If any other
  1754. X    statements  follow  the  execution  of  (returns),  then the
  1755. X    accumulator will be overwritten.
  1756. X
  1757. X    Use of this macro is not recommended.
  1758. X
  1759. X    This  macro  is  not  strictly compatible with the (returns)
  1760. X    macro of BRIEF.
  1761. X.HU right
  1762. XSYNOPSIS:    (right [n])
  1763. X
  1764. XRETURN VALUE:
  1765. X
  1766. X    Nothing.
  1767. X
  1768. XDESCRIPTION:
  1769. X
  1770. X    Moves  the  cursor  'n'  positions  to  the  right.  This is
  1771. X    equivalent  to  adding  'n'  to the current column position.
  1772. X    Note  that  when  the  cursor  moves  it  doesnt  move  over
  1773. X    characters  atomically  but  one  column  at  a  time.  This
  1774. X    allows  the  cursor  to  move beyond the end of the line and
  1775. X    into the middle of a tab stop, for example.
  1776. X
  1777. X    If  you  want  to  move  over  physical  characters, use the
  1778. X    (next_char) and (prev_char) macros instead.
  1779. X
  1780. X    n  may  be  positive  or  negative.  negative  amounts  move
  1781. X    leftward.
  1782. X
  1783. X.HU rindex
  1784. XSYNOPSIS:    (rindex search-string pattern)
  1785. X
  1786. XRETURN VALUE:
  1787. X
  1788. X    Returns  0  if  pattern  cannot  be  found in search-string;
  1789. X    otherwise   returns   the   last  occurence  of  pattern  in
  1790. X    search-string.
  1791. X
  1792. XDESCRIPTION:
  1793. X
  1794. X    This  function  returns  the  index  in search-string of the
  1795. X    last  occurence  of  pattern.  This  function  is useful for
  1796. X    splitting   a  filename  into  its  filename  and  directory
  1797. X    components.
  1798. X
  1799. X    If  the  user  needs to search for regular expressions, then
  1800. X    the function search_string should be used instead.
  1801. SHAR_EOF
  1802. echo "End of part 5"
  1803. echo "File help/crisp/prim/R.cmd is continued in part 6"
  1804. echo "6" > s2_seq_.tmp
  1805. exit 0
  1806. -- 
  1807. =====================            Reuters Ltd PLC, 
  1808. Tel: +44 628 891313 x. 212         Westthorpe House,
  1809. UUCP:     fox%marlow.uucp@idec.stc.co.uk  Little Marlow,
  1810.                        Bucks, England SL7 3RQ
  1811.  
  1812.