home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / utilities / zap / !Zap / Docs / Commands next >
Encoding:
Text File  |  1994-02-28  |  18.8 KB  |  606 lines

  1. *************************************************************************
  2. * >Commands    List of valid Zap commands                *
  3. *************************************************************************
  4.  
  5. This file gives details of all the commands defined in the modules Zap and
  6. ZapBasic. It also gives extra details of the format commands must by typed in
  7. in the keys file and at the command prompt (the Ctrl-Escape prompt). The file
  8. E-Command gives technical details on how to write commands, and add tables of
  9. commands. Also read section C of the file ReadMe. Command names are not case
  10. sensitive when typed into the keys file.
  11.  
  12. Each command can take a parameter. The four types of parameter will be
  13. indicated after the command in the following way:
  14.  
  15.     WIBBLE            Command Wibble takes no parameter
  16.     WIBBLE <byte>        Command Wibble takes a single byte
  17.     WIBBLE <word>        Command Wibble takes a word (4 bytes)
  18.     WIBBLE <string>        Command Wibble takes a string argument
  19.     
  20. When you type the command into the keys file, or at the 'Command:' prompt,
  21. you type the command name, followed by a space and its parameter. Byte and
  22. word parameters must be preceded by an '&' if in hex. String parameters must
  23. be in double quotes. Double quotes can be included in strings by doubling
  24. them up. An error is given if the parameter you place after the command does
  25. not match the type of the command. There are several special cases:
  26.  
  27.  1 If the command takes a string parameter, but you omit the string, then a
  28.    minibuffer will be opened for you to type the string into when the command
  29.    is executed. For example, see the command SEARCHFORWARD (Ctrl-S).
  30.    
  31.  2 If the command takes a byte or word parameter and you specify 'n' as the
  32.    parameter, then the keynumber of the key you bind the command to is
  33.    substituted for the 'n'. For example, see the command CHAR.
  34.    
  35.  3 The '*' command. This is used for duplicating a range keypad entries.
  36.    The format of the command is *n where n is optional. 'n' is the key code
  37.    (or first key code of a list) of the key (or keys) to copy.
  38.    It is of the form &yy0xxx where yy is the keymap number and xxx the key
  39.    number. The default value of n is the current key being bound in keymap
  40.    0 (ie with yy set to 00).
  41.    Eg the line  "&20170-&2017F    *&40"  will cause keys &170-&17F in keymap
  42.    2 to have their definitions copied from keys &40-&4F of keymap 0.
  43.    
  44.  4 If you type a command into a keys file and it doesn't exist, then no error
  45.    will be given. This is so you can put commands in your keys file for
  46.    extension modes that may not always be loaded. However, if a command does
  47.    exist but its parameters are incorrect, then an error will be given.
  48.    
  49.  5 If you define a key twice, then the later one will be used. Ie, the keys
  50.    file is read sequentially and new definitions overwrite the old ones.
  51.  
  52. Commands can be chained together by use of the separator ':' as in BASIC. You
  53. may NOT chain together commands which use the minibuffer (ie commands which
  54. take a string as parameter but with the string unspecified). The two commands
  55. BASEMAP and KEYMAP provide a means of swapping from one keymap to another and
  56. for providing multiple key press commands as you get in Emacs. See the Emacs
  57. keymap for examples of their use.
  58.  
  59. Examples:
  60.  
  61.  (1)    &020-7E        CHAR n
  62.  (2)    &013        SEARCHFORWARD
  63.  (3)    &131        BASEMAP 1
  64.  (4)    &10018        KEYMAP 2
  65.  (5)    &10150-&101FF    *
  66.  (6)    &132        INSERT "Hello" : UP : RIGHT
  67.  (7)    &133        insert " ""hello"" "
  68.  
  69. In (1), key &20 (space) is assigned the command CHAR &20, key &21 (!) is
  70. assigned the command CHAR &21 etc. In (2), no string is given after
  71. SEARCHFORWARD, so you are prompted for it when you press cS. (3) Ensures all
  72. further keypresses are looked up in keymap 1, thus switching to Emacs
  73. emulation mode. (4) Switches to keymap 2 for the next key press only, thus
  74. allowing for two-key commands beginning with ctrl-X. In (5), keys &150-&1FF
  75. in keymap 1 are assigned to the same commands they have in keymap 0. (6)
  76. inserts the string "Hello" into the file and then moves up then right.
  77.  
  78. Below is a list of all commands provided by the Zap or ZapBasic modules. They
  79. are in alphabetical order.
  80.  
  81.             ****************
  82.             * Command list *
  83.             ****************
  84.  
  85. ADDRESS
  86. Shows line numbers in address format by changing b8-b9 of w_format.
  87.  
  88. ASSEMBLE <string>
  89. Assembles the instruction given by string, placing it at the cursor position
  90. (and using this position to determine the assembly address for BLs etc). It
  91. does this by spawning a small (self modifying) basic program and using the
  92. operating system variables Zap$Temp and Zap$TempNum to pass arguments.
  93.  
  94. AUTOINDENT
  95. Toggles auto indent on and off (b16 of w_flags)
  96.  
  97. BASEMAP <word>
  98. This command switches the key basemap to the given keymap number. All further
  99. keypresses will use this keymap. It acts by writing variables key_basemap and
  100. key_current (see E-Vars).
  101.  
  102. BASIC
  103. Calls the extension mode entry point e_basic. This is mode dependant and used
  104. by ZapBasic to drop the user into Basic with the program loaded at PAGE.
  105.  
  106. BEEP
  107. Does a VDU 7.
  108.  
  109. BINDTOKEY <string>
  110. This call evaluates <string> to a number and then binds the currently learnt
  111. sequence to that (zap internal) key code. When used via the minibuffer, a key
  112. press causes the code for that key to be inserted into the minibuffer. The
  113. only exception is the escape key which will abort. However, BINDTOKEY "&1B"
  114. will work if you really need to rebind the escape key.
  115.  
  116. CANCEL
  117. Cancel current Yank/Search as you type operations. In a search as you type
  118. operation the cursor is moved back to its starting point.
  119.  
  120. CDOWN
  121. Advances cursor offset to end of file, leaving a marker at the previous
  122. position.
  123.  
  124. CHAR <byte>
  125. Inserts the given byte into the file. It does this by calling the mode entry
  126. point e_char. Multiple presses are buffered (as with all <byte> parameter
  127. commands) and passed to the command as one list.
  128.  
  129. CLEARSEL
  130. Clears any selected regions by calling Zap_ClearSel.
  131.  
  132. CLEFT
  133. Moves to start of line using the mode entry point e_cminus.
  134.  
  135. CLOSEOTHER
  136. Closes the next window in sequence (the window which would be swapped to by
  137. SWAPWINDOW). If only two windows are open then the other window is closed.
  138.  
  139. CLOSEPRINTER
  140. Closes 'printer:$' filer window via *Filer_CloseDir.
  141.  
  142. CLOSEWINDOW
  143. Closes the current window. If successful (ie no Save/Discard box), then it
  144. places the cursor in the next window.
  145.  
  146. COLUMNTAB
  147. Set tab mode to column tab by changing b9-10 of w_flags.
  148.  
  149. COMMAND <string>
  150. Executes the command (or colon separated list of commands) given in the
  151. string, as if they were typed into the keys file. It uses Zap_ProcessCommand
  152. to do this.
  153.  
  154. COMPILE
  155. Calls the extension mode entry point e_compile. Basic uses this to save a
  156. program to disc and then chain it. A C-mode should cause it to run the
  157. compiler etc.
  158.  
  159. COPY
  160. Initiates copy mode/copies characters. Uses the mode entry point e_copy to
  161. copy the data. It switches the cursor to mode 2.
  162.  
  163. COPYSEL
  164. Copies the selected region to input caret position.
  165.  
  166. CRIGHT
  167. Moves to end of line using the mode entry point e_cminus.
  168.  
  169. CUP
  170. Moves to the start of a file, leaving a marker at the old offset.
  171.  
  172. CUT
  173. Deletes the selected region. This is permanent if the undo buffer is off, or
  174. the data can be pasted/yanked back if it is on using YANK. You may yank
  175. across files, but note that when a file is deleted, all the yank regions
  176. associated with the file are also deleted.
  177.  
  178. DATE <string>
  179. Here the string is in the format required by OS_ConvertDateAndTime (eg %MI
  180. for minutes etc). The string is converted by the above SWI with the current
  181. time substituted and then inserted into the file.
  182.  
  183. DEFAULTMAP
  184. Changes the key basemap to the default value (as specified in the 'keys'
  185. file.)
  186.  
  187. DELETE
  188. Deletes characters backward by calling mode entry point e_delete with R7=0.
  189.  
  190. DELETENEXT
  191. Deletes characters forward by calling mode entry point e_delete with R7=1.
  192.  
  193. DELLINE
  194. Deletes line by calling e_lineprev and e_linenext to find the line limits.
  195. The line is added to the yank buffer. Cumulative deletes are concatenated in
  196. the yank buffer.
  197.  
  198. DELTOEND
  199. Deletes to end of line by calling e_lineend to find the line end. The line is
  200. added to the yank buffer. Cumulative deletes are concatenated in the yank
  201. buffer.
  202.  
  203. DELTOSTART
  204. Deletes to start of line by calling e_linestart to find the line start.
  205.  
  206. DOWN
  207. Moves cursor down a line.
  208.  
  209. DUMPFILE
  210. Creates a text image of the current display for this file.
  211.  
  212. EDITTAB
  213. Sets !Edit type tab mode by changing b9-10 of w_flags.
  214.  
  215. EMACS
  216. Switches to Emacs key map (ie does a BASEMAP 1).
  217.  
  218. ESCAPE
  219. Cancel modes: copy mode/yank mode/select area mode/search as you type. The
  220. text is left in its current state. If you wish to undo the last action then
  221. use CANCEL (ctrl G) to cancel the mode.
  222.  
  223. EXECUTE
  224. Execute last learnt sequence.
  225.  
  226. FASTUNDO
  227. Undo the last operation taking the fastest route in the undo tree. For
  228. example if you do a,b,undo,c,fastundo,fastundo then it will delete the 'a' as
  229. opposed to inserting the 'b'.
  230.  
  231. FINDFILE <string>
  232. Opens a buffer on the indicated file (should be a full path name).
  233.  
  234. FINDFILEREADONLY <string>
  235. As for FINDFILE but puts in read only mode when file loaded.
  236.  
  237. FONTOTHERFAST
  238. Switches to anti-aliased font with fast redraw (b17,20,21 of w_flags).
  239.  
  240. FONTOTHERVDU
  241. Switches to anti-aliased font drawn by Font_Paint (b17,20,21 of w_flags).
  242.  
  243. FONTSYSTEM1DPP
  244. Switches to system font at 1 dot per pixel (b17,20,21 of w_flags).
  245.  
  246. FONTSYSTEMSCALED
  247. Switches to system font scaled vertically for double pixel mode  (b17,20,21
  248. of w_flags)
  249.  
  250. FONTSYSTEMVDU
  251. Switches to system font drawn by VDU queue rather than my code (b17,20,21
  252. of w_flags). Use mode 22 to see the difference.
  253.  
  254. FORMATTEXT
  255. This will format the text from the given cursor position to the paragraph
  256. end. A paragraph end is taken to be a return character followed by a white
  257. space character (ie return,space or tab).
  258.  
  259. FULLUNDO
  260. Undo the last operation taking the slowest route in the undo tree. For
  261. example if you do a,b,undo,c,fastundo,fastundo then it will insert the 'b' as
  262. opposed to deleting the 'a'. Compare this with Fast undo.
  263.  
  264. GOTO
  265. Bring up the goto dialogue box.
  266.  
  267. HELP
  268. Import the !Help file.
  269.  
  270. HEXASCII
  271. Toggle hex/ascii entry mode (b5 of the w_flags). Byte mode uses this for
  272. deciding whether 'F' is the letter F or the hex digit F.
  273.  
  274. INDENT
  275. Indents the currently selected region by the string given in the menu option
  276. selection.indent. If this evaluates to a number then indents by that number
  277. of spaces.
  278.  
  279. INDIRECT
  280. Jump to the address contained at the word at the current cursor posn (leaving
  281. a marker behind as with any Jumps).
  282.  
  283. INSERT <string>
  284. Inserts the string into the file at the given offset. It calls the mode entry
  285. point e_char to do this.
  286.  
  287. INSERTDATE
  288. Insert the current date using the format in the keys file (var &300).
  289.  
  290. INSERTGS <string>
  291. Inserts the string into the file as for INSERT. However, the string is
  292. GS-Trans'ed first thus enabling you to include control codes and OS
  293. variables. As with INSERT, the mode entry point e_char is used.
  294.  
  295. INSERTTIME
  296. Insert the current time using the format in the keys file (var &301).
  297.  
  298. JOINLINE
  299. Call the extension mode entry point e_joinline to join line following the
  300. current line to the end of the current line.
  301.  
  302. KEEPREGION
  303. Copies the selected region to the yank buffer (Emacs kill ring) and then
  304. clears the selection. This is the equivalent of Emacs Meta-W.
  305.  
  306. KEYMAP <word>
  307. Change the keymap number BUT only for the next key press. The keymap
  308. number will then revert to whatever the BASEMAP number has been set to
  309. (unless the next key command is also a KEYMAP!) Using this command you can
  310. cause a string of keys to execute a command.
  311.  
  312. LASTMARK
  313. Jump to the previous mark in the market buffer.
  314.  
  315. LASTMATCH
  316. Move to the previous match after using the Search window.
  317.  
  318. LASTSECTOR
  319. Move to the last sector on an (unaltered) file read from disc.
  320.  
  321. LASTTRACK
  322. Move to the last track on a file read from disc.
  323.  
  324. LEARN
  325. Start/stop learn key sequence. Subsequent characters will be learnt producing
  326. a beep each time to remind the user. Execute LEARN again to stop the
  327. sequence. Note that all command passed to Zap_ProcessCommand with R2=0 or
  328. R2=1 will be learnt. If R2>1 then the command will not be learnt.
  329.  
  330. LEFT
  331. Move cursor left by calling mode entry point e_minus.
  332.  
  333. LINEEDIT
  334. Toggles line edit mode on and off (b14 of w_flags)
  335.  
  336. LINEWRAP
  337. Toggles line wrap mode on and off using b26 of w_flags.
  338.  
  339. LISTFNS
  340. Lists function definitions for the given mode. (via e_listfns).
  341.  
  342. LOGICAL
  343. Set logical line numbers by changing b8-b9,b11 of w_format.
  344.  
  345. MAKEDEFAULT
  346. This saves the windows options as the current default options. Hence if you
  347. do a 'save options' after this, then the windows options will become the
  348. configured options.
  349.  
  350. MINIMISEMEMORY
  351. Contacts heap by as much as possible. I'm afraid it's an Acorn OS_Heap type
  352. heap so this won't usually do much.
  353.  
  354. MODE <byte>
  355. Change the current display mode to the given number. 
  356.  
  357. MODE0-MODE15
  358. Set the current mode for the given window. This also restores the line number
  359. status last used by that mode. These commands are needed in addition to the
  360. MODE command as commands assigned to menu entries cannot take parameters.
  361.  
  362. MOVESEL
  363. Move the selected area to current cursor offset.
  364.  
  365. MULTICOMMAND <data>
  366. This command cannot be typed into the keys file as it takes a data block as
  367. parameter. It is used internally to execute a list of command (eg a learnt
  368. sequence). The data block is a -1 terminated list of entries of the form
  369. given below. Note that all the data for the commands to be executed is stored
  370. within the data block except for data type 4 (other multicommands).
  371.     #0 Command address
  372.     #4 Data length/number of times (R1 on command entry)
  373.     #8 Command data. Depends on the type of the command (see E-command):
  374.         0 No data
  375.         1 List of #4 bytes then align
  376.         2 List of #4 words
  377.         3 0 terminated string then align
  378.         4 Pointer to the data block 
  379.  
  380. NEWVIEW
  381. Open a new window on this file (copying the old window mode and format).
  382.  
  383. NEXTMARK
  384. Jump to next mark in the marker buffer.
  385.  
  386. NEXTMATCH
  387. Move to the next match after using the Search Box.
  388.  
  389. NEXTSECTOR
  390. Move to the next sector on a file read from disc.
  391.  
  392. NEXTTRACK
  393. Move to the next track on a file read from disc.
  394.  
  395. NOLINENOS
  396. Switch off line numbers by clearing b8 of w_format.
  397.  
  398. NONSTANDARD
  399. Toggles non standard editing on and off (b15 of w_flags).
  400.  
  401. NULL
  402. Do nothing, but prevents key from being passed on via Wimp_ProcessKey.
  403.  
  404. OPENPRINTER
  405. Open a filer window on printer:$ via *Filer_OpenDir.
  406.  
  407. OUTDENT
  408. Outdents the selected region (by the length of the current indent string).
  409.  
  410. PASTE
  411. Pastes the last cut region repeatedly. Use YANK to cycle through previously
  412. deleted regions.
  413.  
  414. PHYSICAL
  415. Switch on physical line numbers by changing b8-b9,b11 of w_format.
  416.  
  417. PRINTFILE
  418. Open the fancy print window.
  419.  
  420. QUICKPRINT
  421. Open the quick print window.
  422.  
  423. QUICKSAVE
  424. Save the file directly to disc with no prompt.
  425.  
  426. QUIT
  427. Kill Zap.
  428.  
  429. QUOTE
  430. Causes the next key which is typed to be sent to the CHAR command. Hence the
  431. next key is inserted into the file, instead of having the command associated
  432. to that key executed.
  433.  
  434. READONLY
  435. Toggle the read only state of a file (b8 of f_flags).
  436.  
  437. REDO
  438. Redo the last undone operation whether full or fast.
  439.  
  440. RENUMBER
  441. This calls e_renumber and is thus mode independent. ZapBasic uses it to
  442. renumber a file.
  443.  
  444. REPLACE
  445. Open the Search & Replace window.
  446.  
  447. RETURN
  448. Cancel split cursor copying and then call e_return to perform the return
  449. action for the current mode.
  450.  
  451. RETURNNOINDENT
  452. This acts as the return function except that it clears the auto indent flag
  453. across the call to e_return thus giving a single return without auto indent.
  454.  
  455. RIGHT
  456. Move cursor right using mode entry point e_plus.
  457.  
  458. RUN
  459. Call e_run mode entry point. ZapBasic uses this to Run a file at PAGE.
  460.  
  461. RUNANDQUIT
  462. Call e_runandquit mode entry point. ZapBasic runs the file at PAGE and then
  463. quits.
  464.  
  465. SAVE
  466. Open save box.
  467.  
  468. SAVESEL
  469. Open save selection box.
  470.  
  471. SAVEANDRUN
  472. Call e_saveandrun mode entry point. ZapBasic save the file, chains it from
  473. disc and then quits.
  474.  
  475. SAVEFILE <string>
  476. Save the buffer with filename <string>. This differs from WRITEFILE in that
  477. if <string> is omitted, then the file will be saved with its current name, if
  478. this is a full path name, and the minibuffer will not be opened.
  479.  
  480. SCDOWN
  481. Move down display one line (without moving cursor).
  482.  
  483. SCLEFT
  484. Move to left of display one character (without moving cursor).
  485.  
  486. SCRIGHT
  487. Move to right of display one character (without moving cursor).
  488.  
  489. SCUP
  490. Move up display one line (without moving cursor).
  491.  
  492. SDOWN
  493. Move down a page.
  494.  
  495. SEARCHBACK <string>
  496. Searches backwards for string and then places the cursor at then end of the
  497. match (if found).
  498.  
  499. SEARCHBUF
  500. Open Search window with output to buffer option set.
  501.  
  502. SEARCHCUR
  503. Open Search window with output to cursor option set.
  504.  
  505. SEARCHFORWARD <string>
  506. Searches forwards for string and then places the cursor at then end of the
  507. match (if found).
  508.  
  509. SELECTBUFFER
  510. Select entire buffer.
  511.  
  512. SELREGION
  513. Start selection of region by cursor movement. This sets the cursor mode to 4.
  514.  
  515. SETWIDTH <string>
  516. This evaluates <string> to a number and then sets the width of the mode to
  517. this number by calling the mode entry point e_setwidth.
  518.  
  519. SLEFT
  520. Move cursor back a word by calling e_sminus.
  521.  
  522. SPLITLINE
  523. Split line at current cursor posn by calling e_splitline.
  524.  
  525. SRIGHT
  526. Move cursor forward a word by calling e_splus.
  527.  
  528. SUP
  529. Move up a page.
  530.  
  531. SUSPEND
  532. Brings up the command line (same as F12).
  533.  
  534. SWAPCASE
  535. Swap case of next character/selected region if there is one.
  536.  
  537. SWAPCHARS
  538. Swap characters either side of cursor.
  539.  
  540. SWAPWINDOW
  541. Swap window. If possible it swaps to the last used window on the current
  542. file using the marker buffer to determine this. Otherwise it swaps to the
  543. next file in the order files are stored within zap.
  544.  
  545. SWITCHTAB
  546. This toggles the TAB mode for a file (w_flags b9-b10) between UNIX and
  547. TRUETAB modes.
  548.  
  549. TAB
  550. Calls e_tab so that the mode can enter the tab as it wishes.
  551.  
  552. TABDISPLAYARROW
  553. Displays tabs as an arrow followed by spaces (b12-13 of w_format).
  554.  
  555. TABDISPLAYDASHES
  556. Displays tabs as dashes leading to an arrow (b12-13 of w_format).
  557.  
  558. TABDISPLAYNONE
  559. Displays tabs as the character 9, (b12-13 of w_format).
  560.  
  561. TABDISPLAYSPACES
  562. Displays tabs as spaces (b12-13 of w_format).
  563.  
  564. TABSASSPACES
  565. Toggles b11 of w_flags which governs whether spaces or tab characters are
  566. used for edit/column tabs.
  567.  
  568. TOBACK
  569. Moves the window to the back of the window stack via Zap_OpenWindow 4.
  570.  
  571. TOFRONT
  572. Moves the window to the front of the window stack via Zap_OpenWindow 3.
  573.  
  574. TOGGLEHEX
  575. Toggle hex/decimal display of line numbers (b10 of w_format).
  576.  
  577. TOGGLEINSERT
  578. Toggle insert/overwrite modes (b1 w_flags).
  579.  
  580. TOGGLEMARK
  581. Insert/delete mark from marker buffer at current marker offset.
  582.  
  583. TOGGLEWIND
  584. Toggles the window size. The not-fully-open size is stored in the variables
  585. w_togminx to w_togmaxy.
  586.  
  587. UNIVERSALARG <string>
  588. This command evaluates the string to a number and then calls the next
  589. executed command (executed via Zap_ProcessCommand) that number of times.
  590.  
  591. UNIXTAB
  592. Switches to unix tab mode by clearing b9-10 of w_flags.
  593.  
  594. UP
  595. Move cursor up a line.
  596.  
  597. WORDWRAP
  598. Toggle wordwrap mode on/off (toggles b13 w_flags)
  599.  
  600. WRITEFILE <string>
  601. Saves the buffer with filename <string>. Also see SAVEFILE.
  602.  
  603. YANK
  604. Paste last cut region from undo buffer to current cursor position. On
  605. repeated action it pastes previously cut regions in a cyclic manor.
  606.