home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Applications / Alpha.5.96 folder / Help / Intro < prev    next >
Encoding:
Text File  |  1994-09-21  |  59.5 KB  |  1,867 lines  |  [TEXT/ALFA]

  1.           Copyright © 1990-1995 Pete Keleher. All Rights Reserved
  2.  
  3. The Author(s) of this product are in no way liable for any direct or 
  4. indirect damage caused by the product. 
  5.  
  6. You may freely copy and distribute ALPHA, but please bear in mind that 
  7. ALPHA is Shareware. If you decide to keep it, please register your copy by 
  8. sending $25 to the author. Site licences are $200. Source licenses are also 
  9. available, inquire with the author. If you include an internet (or 
  10. Compuserve) address with your registration, I will notify you when new 
  11. versions become available. 
  12.  
  13. E-mail address:     pete@cs.rice.edu
  14. Snail-mail address: Pete Keleher
  15.                     1658 Bonnie Brae #2
  16.                     Houston, TX 77006
  17.  
  18. I am collecting user-written Tcl procs and XTCLs in public/Alpha/contrib on 
  19. cs.rice.edu. If you have written anything that you think may be of general 
  20. interest, please send it to me and I will make it available. 
  21.  
  22. Alpha contains source from main places, but in particular I'm grateful to 
  23. Ray Johnson and Tim Endres for their working on porting TCL to the mac, 
  24. and to Tom Scavo and Tom Pollard for their Tcl code contributions. 
  25. The following people have also provided considerable code and/or help 
  26. debugging the one or two bugs Alpha has had: Masatsugu Nagata, Karl J.  
  27. Smith, Eric Sink, David C. Black, Richard T. Austin, Henry Spencer, 
  28. and Jerry Fowler.
  29.  
  30.  
  31. What to do: USE THE MARKS MENU IN THIS FILE!.  This file contains "marks" 
  32. in a popup menu above the vertical scrollbar on the right, that let you 
  33. jump to different sections of this file.  Mouse-down on the curly braces.
  34.  
  35. Alpha is a very powerful, multi-purpose editor that allows any program- 
  36. or user-defined function to be bound to any keystroke, or placed into 
  37. user-defined menus. Every menu is defined in the macro language Tcl by 
  38. one of the startup files ("AlphaBits.tcl" or one of the files sourced 
  39. from inside it). 
  40.  
  41. Alpha uses Dr. Ousterhout's Tool Command Language (Tcl) as an extension 
  42. language. See the "Help" menu for a complete definition of the language. 
  43. Alpha uses a port of Tcl done by Tim Endres for his "Tickle" application, 
  44. and supports many of the same extensions. Many of the functions bound to 
  45. keystrokes, as well as many of the functions in the user-defined menus, are 
  46. written in Tcl. 
  47.  
  48. Callable functions in Alpha come in three different flavors. First, there 
  49. are the basic Alpha editor functions; these are discussed in the section 
  50. entitled "Simple Cmds" below. These functions take no arguments and do 
  51. not return values.
  52.  
  53. Second, there are additional Tcl extensions discussed in the "Alpha Tcl 
  54. Extensions" help file (look in the "Help" menu). Most of these functions 
  55. either take arguments or return values. 
  56.  
  57. Finally, there are the Tcl functions defined with "proc". Most of Alpha's 
  58. predefined functions are in "procs.tcl", some are in "shell.tcl". 
  59.  
  60. The only way to get to know the editor and the language is to try different 
  61. things out. Play around. Choose "Misc:List Bindings" to get a listing of 
  62. all the current keystoke bindings. Look in "procs.tcl" for definitions of 
  63. the routines. Look in "AlphaBits.tcl" for definitions of the last six 
  64. menus. And finally, please feel free to send suggestions/"feature" 
  65. reports/questions to me at pete@cs.rice.edu. I am not able to answer US 
  66. postal mail, but if you send it to me I will at least read it. Have fun! 
  67.  
  68.  
  69.  
  70.           Colorizing
  71.  
  72. Version 5.80 and up support automatic "colorizing" of text. This is 
  73. controlled by the function 'regModeKeywords', which registers keywords to 
  74. colorize in a specific mode. By default, color schemes are supplied for 
  75. C, C++, Tcl, and TeX. Colorizing can be turned off via the 'coloring' 
  76. flag. 
  77.  
  78.  
  79.           File Detritus
  80.  
  81. The primary method of either reading or storing files with Alpha, or any 
  82. other Mac editor, is through the GetFile and PutFile dialogs. However, 
  83. Alpha's dialogs are not exactly like those of other applications. 
  84.  
  85. The GetFile dialog has two additional items: a "Read-only" checkbox and an 
  86. "All Files" checkbox.  The first allows you to open a file as read only.  
  87. Files in the read-only state can not be modified, only read.  A read-only 
  88. file is indicated by a lock icon replacing the grow zone icon.  Read-only 
  89. status can be toggled by command-clicking on the icon.
  90.  
  91. The second checkbox, "All Files", allows Alpha to open any file rather 
  92. than just those of type 'TEXT'. The type of a file can be determined by 
  93. using the 'll' alias in the Tcl shell.
  94.  
  95.  
  96. The PutFile dialog is used to prompt the user for a new name under which to 
  97. save the contents of a window. This dialog has been enhanced by two popup 
  98. menus: "State" and "Format". "State" allows you to specify how much 
  99. information should be saved in the resource fork of files that you use. If 
  100. the state is set to "MPW", window position, current selection, tab sizes, 
  101. and font information are saved into the resource fork of your application 
  102. every time you open and close it, *even if you don't modify the file*. 
  103. Alpha still manages to coexist with build or make files because saving this 
  104. information does not change the modification date of the file. If the state 
  105. is set to "Think", neither the window position nor the current selection 
  106. are saved. If state is set to "None", no information is saved. The default 
  107. value for saved state can by changed by setting the Alpha variable 
  108. 'savedState' to "mpw", "think", or "none". Note that if a given file 
  109. already has mpw information in it when the file is open, Alpha will always 
  110. update that information when the file is closed. Note also that "marks" 
  111. are always saved in the resource fork whenever a file is saved, 
  112. regardless of the setting of the 'savedState' variable.
  113.  
  114. The "Format" menus allows the way Alpha terminates lines to be changed. 
  115. The Mac uses a carriage return to mark the end of a line, Unix uses a 
  116. linefeed, and IBM uses both (of course). Alpha can read and write any of 
  117. these formats, and can convert between them just by opening a file, 
  118. choosing "Save As", and changing the selection in this menu. Note that if 
  119. you are going to be sharing files with a Unix or IBM machine, you 
  120. probably don't want anything in your resource fork, so you'd probably 
  121. want to set 'savedState' to 'none' in your AlphaBits.tcl file.
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.           Windows
  129.  
  130. Alpha's windows have several non-standard features. 
  131.  
  132. First, the horizontal scrollbar can be turned on and off via the window 
  133. menu. The default for subsequent windows is controlled via the 
  134. Utils:Flags:horScrollBar flag.
  135.  
  136. Secondly, above the vertical scrollbar on the right are at least three 
  137. icons.  The bottom-most icon is the "Mode Vars" popup menu (see the Mode 
  138. section of this file).  The next icon is the "Mode" popup menu, which shows 
  139. the window's current mode and allows it to be changed.  The next icon shows 
  140. all marks for the current window, and allows them to be cleared or 
  141. automatically created (through the Tcl proc 'markFile' that calls 
  142. mode-specific routines).  Finally, above this icon a red disk icon appears 
  143. if the window is currently dirty.  Clicking on this icon saves the file.
  144.  
  145. Command-clicking inside a window also brings up the mark menu.
  146.  
  147. The grow region in the lower right corner is replaced by a lock icon if 
  148. the file is read-only. Read-only status can be changed by 
  149. command-clicking in this area.
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.           Marks
  165.  
  166. Alpha allows the user to use "marks" to remember positions in files. Marks 
  167. "float". That is, if a mark is initially at position 312 and then five 
  168. characters are inserted at location 297, the mark's new value will be 317. 
  169. Alpha uses three different types of marks. 
  170.  
  171. The first is generically referred to as "the mark". The mark is set to the 
  172. current insertion point by the command 'setMark' (control-space by 
  173. default). The position in the file indicated by the blinking cursor is 
  174. referred to as the current insertion point. Many commands (such as "cut" 
  175. and "copy") can operate either on the currently selected (hilighted) text, 
  176. or the text between the current insertion point and "the mark". For 
  177. example, if you move the cursor to the beginning of the work "allybaba", 
  178. hit command-space (the status bar should say "Mark set"), move to the end 
  179. of the word and hit option-w (the status bar should say "Region copied"), 
  180. the effect is the same as if you had used the mouse to select the text and 
  181. then selected the "Copy" command from the "Edit" menu.
  182.  
  183. The second type of mark are the permanent marks. Permanent marks are set, 
  184. removed, and moved-to through the three corresponding menu items in the 
  185. "Search" menu. Permanent marks differ from the generic mark in that they 
  186. have names, there can be any number of them, and they are saved in the 
  187. resource fork if the file is subsequently saved.
  188.  
  189. Permanent marks can be access via the "Search:Named Marks" menu items, by 
  190. a popup menu called by mousing down on the curly braces above a vertical 
  191. scrollbar, or by command-mousing on a window's titlebar.
  192.  
  193. The third type of mark is the temporary mark. Like permanent marks, 
  194. temporary marks can be named and there can be any number of them. Unlike 
  195. permanent marks, temporary marks do not "dirty" the file, and they aren't 
  196. saved. So far, temporary marks are used exclusively to implement higher 
  197. order functions in TCL procedures. In the 5.0 release, temporary marks are 
  198. used to implement a "mark stack" and a for loop template.
  199.  
  200. At the time a file is saved, the marks for that file are stored into the 
  201. file's resource fork in an order determined by the variable 
  202. 'markSorting'. The choices are either 0 (no sorting), 1 (sort by file 
  203. position), or 2 (sort alphabetically).
  204.  
  205.  
  206.           Mark Stack
  207.  
  208. The mark stack is a last-in-first-out (LIFO) stack of temporary marks 
  209. managed by the TCL procedures 'pushMark' and 'popMark'. 'pushMark' creates 
  210. a new temporary mark of the current insertion point and adds it on to the 
  211. top of the stack. 'popMark' removes the top mark from the stack and goes 
  212. toit. A typical use of the mark stack is a 'pushMark' at the current 
  213. position, go look somewhere else in the file, and then 'popMark' to get 
  214. back to where you were. However, the stack is recursive, so there can be 
  215. any number of 'pushMarks' before the marks start to be popped back off the 
  216. stack.
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.           Templates
  242.  
  243. Temporary marks can also be used to with language construct templates. The 
  244. file "template.tcl" contains an example implementing a template for C's 
  245. 'for' command. Depressing control-i will insert a template for the "for" 
  246. command into the current window. Five temporary marks are defined in the 
  247. for structure, three inside the parenthesis, one where the "for" body text 
  248. will be inserted, and one after outside the for body entirely. Depressing 
  249. control-shift-i moves the cursor to the next of the five temporary marks 
  250. allowing quick entry of the entire command.
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.           TCL
  277.  
  278. See the Tcl manual page under the 'Help' menu for a complete description of 
  279. Tcl, the Tcl shell, and it's commands. Each of the Tcl commands and several 
  280. sections have a mark defined, so you can use the "Mark" menu to 
  281. navigate through the manual page. If you define the file
  282. ":Tcl:UserCode:userStartup.tcl", Alpha will load it at startup.
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.           Key Bindings
  313.  
  314. Any TCL command can be bound to any single keystroke. One way to bind a 
  315. function is with a statement such as:
  316.   
  317.       bind 'c' <modifier string> funcName [<mode>]
  318.           
  319. where c is a character, <modifier string> is an optional string containing 
  320. one or more of:
  321.  
  322.       c   - command modifier
  323.       o   - option modifier
  324.       s   - shift modifier
  325.       z   - control modifier
  326.       e   - escape modifier      
  327.  
  328. Additionally, the modifier string can contain a capital letter specifying 
  329. that the binding is only activated if preceded by control and the lowercase 
  330. version of that letter. This feature allows multiple-key combinations ala 
  331. Emacs. The following line binds cmd-shift-f to the function 'forwardChar': 
  332.  
  333.  bind 'f' <cs> forwardChar 
  334.  
  335. The next line would bind the same function to C-x C-f: 
  336.  
  337.  bind 'f' <cX> forwardChar 
  338.  
  339. 'mode' is an optional parameter that specifies, when present, that the 
  340. binding is only active in a given mode, where the current mode is the 
  341. parameter to the last call of 'displayMode' (look in "procs.tcl"). Note 
  342. that given a general binding (no mode specification) and a binding specific 
  343. to the current mode, the last binding to have been created is the one found 
  344. first. 
  345.  
  346. Additionally, most keyboards have keypads and/or Function Keys. These 
  347. keys can be bound using case-insensitive numeric labels using the same 
  348. bind command as above, with the label replacing the character. For 
  349. example, to bind F1 to function 'funcName', the following would work:
  350.  
  351.     bind F1 funcName
  352.  
  353. As above, the binding can include a modifier string. The following labels 
  354. are defined for US keyboards:
  355.  
  356.   Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15 Help Home Pgup Del 
  357.   End Pgdn Left Right Up Down Clear Kpad0 Kpad1 Kpad2 Kpad3 Kpad4 Kpad5
  358.   Kpad6 Kpad7 Kpad8 Kpad9 Kpad= Kpad/ Kpad* Kpad- Kpad+ Enter Kpad.
  359.  
  360. The function 'listBindings' will list all of the bindings currently in 
  361. effect in a format suitable for re-loading.
  362.  
  363. The above labels may not be sufficient for all keyboards (attention 
  364. international users). If a hex number is used instead of a character inside 
  365. the single quotes, the binding is done to key codes instead of ascii 
  366. values. The following is a key code version of the same binding: 
  367.  
  368.       bind 0x03 <cs> forwardChar
  369.  
  370. The key code for any given key can be obtained by using the 'keyCode' 
  371. function. 
  372.  
  373. Also, there is an alternate form that allows the specification of an 
  374. ascii code directly:
  375.  
  376.     ascii 0x20 <z> setMark
  377.     
  378. Binds control-space to 'setMark'.
  379.  
  380. Note that menu item command equivalents take precedence over bindings, 
  381. and that the 'bind' command does not affect the command equivalents 
  382. displayed in the menus. Command equivalents can only be changed by using
  383. an external tool like 'ResEdit'. Also note that key code bindings take 
  384. precedence over ascii bindings. 
  385.  
  386. Finally, there are 'unbind' and 'unascii' functions, with identical 
  387. arguments to their counterparts. 
  388.  
  389.  
  390.  
  391.           Menus
  392.  
  393. Alpha's menus are completely reconfigurable. Some of the menu items are 
  394. internal alpha commands, while others are Tcl procs defined in one of the 
  395. files of the "Tcl" subdirectory. Most of these procs are defined in 
  396. "procs.tcl". The following is an explanation of the default menus. The 
  397. explanations of items that are defined as Tcl procs are implemented by the 
  398. Tcl proc specified by "(proc <name>)", and can be found in one of the .tcl 
  399. files. All others are internal functions. 
  400.  
  401. File
  402.     New                      New file.
  403.     Open…                   Open file.
  404.     Close                   Close file.
  405.     Save                       Save file.
  406.     SaveAs…                   Prompt for name to same file under.
  407.     Revert                   Revert to last saved version, throw away undo history. 
  408.     Shell                   Start up command-line shell that interprets Tcl 
  409.                             commands. The shell has a few csh-type features, 
  410.                             such as 'ls', 'rm', etc. commands, as well as file 
  411.                             completion with the TAB key. 
  412.     Page Setup…               Set print options.
  413.     Print…                  Print file.
  414.     Quit                       Quit Alpha.
  415.  
  416. Edit
  417.     Undo                    Undo. 
  418.     Redo                    Redo. 
  419.     Load                    Execute either the window or the selection as Tcl 
  420.                             source. 
  421.     Cut                        Cut selection to scrap.
  422.     Copy                    Copy selection to scrap.
  423.     Paste                    Paste from scrap.
  424.     Paste Pop                Immediately after a paste, use a previous paste 
  425.                             instead.
  426.     Yank                    Paste last deleted text. Concatenates together 
  427.                             consecutive, adjoining deletions.
  428.     Select All                Select entire file.
  429.     Clear                    Delete selection.
  430.     Shift Left                Shift selection left one tab.
  431.     Shift Right                Shift selection right one tab.
  432.     Balance                    Select text out to the next set of matching braces.
  433.     
  434. Search
  435.     Find..                    Present a search dialog.
  436.     Repeat Search Forward    Search forward again w/ same settings.
  437.     Repeat Search Backward    Search backward again w/ same settings.
  438.     Find in Next File        Restart multiple-file search in next file after 
  439.                             stopping at a match.
  440.     Search Start            Set mark at current position and return to where
  441.                             the last incremental or normal search started.
  442.                             
  443.     Enter Selection            Make the current selection the text to be searched 
  444.                             for.
  445.  
  446.     Replace                    Replace the selection.
  447.     Replace and Find Again.    Replace the selection and search again forward.
  448.     Replace All                Replace all of occurances of the search string 
  449.                             in the rest of the file.
  450.     Goto Line…                Go to specific line.
  451.     Named Marks
  452.         Set…
  453.         Goto…
  454.         Remove…
  455.     Unnamed Marks
  456.         Set…
  457.         Exchange Point and Mark
  458.         Hilite                Select text between current insertion and the 
  459.                             generic "mark". Or, if there is already a selection, 
  460.                             unselect the text, place the insertion at the 
  461.                             beginning of the unselection, and place the 
  462.                             "mark" at the end of the unselection. The function 
  463.                             'exchangePointAndMark' (by default mapped to the 
  464.                             "5" on the keypad and control-x,control-x) exchanges 
  465.                             the character positions of the insertion and the 
  466.                             "mark". 
  467.     Mark Stack
  468.         Push                Push current pos onto a "stack".
  469.         Pop                    Pop last pos from stack and go to it.
  470.         
  471.     Registers
  472.         Point To Register    Create a single-char-named temporary mark at 
  473.                             insertion.
  474.         Jump To Register    Jump to mark made as above.
  475.     
  476. Utils
  477.     File Utils
  478.         Insert Path Name…    Prompt for a file and insert complete pathname in 
  479.                             window.
  480.         Insert File…        Insert the text of another file.
  481.         File Remove…        Remove a file.
  482.         File Info…            Display/edit info about a file.
  483.         Word Count            Count lines, words, chars in window (proc wordCount).
  484.     Compare
  485.         Windows                Compare top two windows, sending output to a third. 
  486.                             Selecting a line in the third window and hitting 
  487.                             return (or enter) moves that line to the top of 
  488.                             the window.
  489.         Files                Same as above, but prompts for files.
  490.         Directories            As above, but works for entire directories. 
  491.  
  492.     Evaluate…                Evaluate complex command.
  493.     Kbd Macros
  494.         Start Keyboard Macro    Start creating anonymous macro.
  495.         End Keyboard Macro        Finish.
  496.         Execute Keyboard Macro    Execute.
  497.         Dump Macro                Dump to current file.
  498.  
  499.     Sort Lines                Sort selected lines (proc sortLines).
  500.     Matching Lines            Grab all lines from current position on that match a 
  501.                             regular expression and dump in new buffer (proc 
  502.                             matchingLines). 
  503.     Goto Match                If cursor on line in output of batch search or 
  504.                             "Matching Lines", goto the match specified by 
  505.                             that line.
  506.                             
  507.     Spellcheck Window
  508.     Select Paragraph
  509.     Named Clipboards
  510.         Copy…
  511.         Cut…
  512.         Paste…
  513.         
  514.     Install
  515.         Electric Alias        Loads David Black's "electric alias" routines, see 
  516.                             the appropriate help file.
  517.         Mac Perl            Permanently loads the Tom Pollard's perl mode.
  518.         HTML                Permanently loads the Scott Brim's HTML mode.
  519.  
  520. Mode
  521.     Flags                    A submenu of Tcl flags to be turned on and off. 
  522.                             Look under "Variables" for explanations of 
  523.                             individual flags (proc editFlag).
  524.     Vars                    Same as Flags, except these variables may be 
  525.                             arbitrary integers or strings (proc editVar).
  526.  
  527.     Describe Binding…        Wait for a keystroke, then display that keystroke's 
  528.                             binding.
  529.     List Bindings            Create a new file containing all current key bindings.
  530.     Ascii Etc
  531.         Key Code…            Wait for key press and insert keycode and modifier 
  532.                             string suitable for key binding.
  533.         Key Ascii…            Same as above, but use ascii form.
  534.         Get Ascii…            Display ascii code for char to right of insertion.
  535.         Insert Ascii…        Prompt for ascii code and insert character.
  536.  
  537.     Set Font Tabs…            Change font and/or tabs for current file.
  538.         
  539.     Switch To                Bring other apps to front.
  540.     ToolServer Shell        Start a window that sends 'DOSC' events to Apple's 
  541.                             toolserver. 
  542.     
  543.  
  544. Convert
  545.     Fill Region                "Fill" selection subject to 'leftFillColumn' and 
  546.                             'fillColumn', (proc fillRegion).
  547.     Fill Paragraph            "Fill" paragraph that contains the insertion (proc 
  548.                             fillParagraph).
  549.     Wrap Region                Break lines longer than 'fillColumn' in selection 
  550.                             (proc wrapRegion).
  551.     Wrap Paragraph            Break lines longer than 'fillColumn' in paragraph 
  552.                             containing insertion pt (proc wrapParagraph).
  553.  
  554.     Zap Invisibles            Delete all chars in file w/ ASCII code < 32, except 
  555.                             for LF, TAB and CR.
  556.     Tabs To Spaces            Convert tabs to space runs.
  557.     Spaces To Tabs            Convert space runs to tabs.
  558.  
  559.     Strings
  560.         Insert Prefix        Prepend string 'prefixString' to every line in 
  561.                             selection (proc insertPrefix).
  562.         Insert Suffix        Append string 'suffixString' to every line in 
  563.                             selection (proc insertSuffix).
  564.         Remove Prefix        Remove prefix string from lines in selection 
  565.                             (proc removePrefix). 
  566.         Remove Suffix        Remove suffix string from lines in selection 
  567.                             (proc removeSuffix). 
  568.         Set Prefix…            Change prefix string (proc setPrefix).
  569.         Set Suffix…            Change suffix string (proc setSuffix).
  570.     Comment
  571.         Transpose Chars        Transpose two chars around cursor.
  572.         Transpose Words        Transpose two words around cursor.
  573.         Comment Box            Create a comment box around selected text.
  574.         UnComment Box        Remove such a comment box.
  575.         
  576.     Filters
  577.         Replace In Region
  578.         Filter Lines
  579.         Filter Paragraphs
  580.         Sort Paragraphs
  581.         Fill Region By Par
  582.         Line To Paragraph        Convert long line to paragraph, useful for 
  583.                                 importing text from word processors (proc 
  584.                                 lineToParagraph).
  585.         Paragraph To Line        Convert paragraph to single long line, 
  586.                                 useful for exporting text to word processors 
  587.                                 (proc paragraphToLine).
  588.     Downcase Region            Downcase all chars in region.
  589.     Upcase Region            Upcase all chars in region.
  590.  
  591.  
  592. Help
  593.     Editor help files (proc helpMenu).
  594.     
  595. Wins (an icon with three windows)
  596.     Arrange                    Rearrange open windows.
  597.  
  598.     Zoom                    Zoom windows in and out.
  599.     Iconify                    Replace window w/ small icon (proc iconify).
  600.     Toggle Scrollbar        Toggle the horizontal scrollbar on the frontmost 
  601.                             window. The scrollbar can be enabled/disabled on 
  602.                             subsequent variables by changing the value of 
  603.                             the 'horScrollBar' flag.
  604.  
  605.     Next Window                Select next window (proc nextWindow).
  606.     Swap With Next            Swap topmost two windows (proc swapWithNext).
  607.     Choose A Window            Choose window to select from list (proc 
  608.                             chooseAWindow).
  609.     Close All                Close all windows (proc closeAll).
  610.     Save All                Save all dirty windows (proc saveAll).
  611.  
  612. File Sets            
  613.         (hierarchical menus containing fileset and their files, select file to 
  614.          edit)
  615.  
  616.         Utilities
  617.             Choose                Set current fileset.
  618.             Create Fileset        Create a fileset on the fly.
  619.             Create Think Fileset Create a fileset containing the source files
  620.                                 of a THINK 7.0 project.
  621.             Dump Fileset        Dump a fileset definition into the current window.
  622.             Edit File            Edit a file from one of the filesets.
  623.             Find Tag            Find a function definition.
  624.             Create Tag File        Create a "tag" file specifying where functions
  625.                                 are defined.
  626.     
  627.     
  628.           Menus, User-Defined 
  629.  
  630. All of Alpha's menus are defined in the initialization files that Alpha 
  631. loads on startup.  They can be altered or discarded at well.  Alpha's menu 
  632. commands allow the the user to build custom menus which contain names of 
  633. functions, macros, or arbitary TCL commands that just HAVE to be in the 
  634. menus, as opposed to being merely callable through the bindings.  The 
  635. syntax is dead simple.  Menus can be nested, allowing heirachical menus to 
  636. be defined.  See the 'AlphaBits.tcl' file for examples (only the first 
  637. three Alpha menus are hard-coded into the Application, the others are set 
  638. up through the AlphaBits file).  The following meta characters can be 
  639. embedded in the strings:
  640.  
  641.    Meta-character     Usage
  642.    --------------     -----
  643.  
  644.     ; or Return       Separates multiple items.
  645.     ^                 Followed by an icon number, adds 
  646.                       that icon to the item.
  647.     !                 Followed by a character, marks the
  648.                       item with that character.
  649.     <                 Followed by B, I, U, O, or S, sets 
  650.                       the character style of the item.
  651.     /                 Followed by a character, sets up
  652.                       a keyboard equivalent.
  653.     (                 Disables the item.
  654.  
  655. The menu creation syntax is :
  656.  
  657.     menu <-n name> <-i num> [-p procName] [-m] "Tcl list of items"
  658.  
  659. Where the arguments have the followings meanings:
  660.   '-i <num>'    Resource id of icon suite to use for menu title.
  661.   '-n <name>'    Name of menu.
  662.   '-m'            No menu form. If not supplied, each menu item is split into 
  663.                   words at each capitalized letter.
  664.   '-p <pname>'     Rather that having alpha call a Tcl proc named by the menu 
  665.                   item's text, this option tells Alpha to call the tcl proc 
  666.                   named by 'pname' with two arguments: the menu name, and the
  667.                   text of the menu item chosen.
  668.  
  669. Once the menus are created, they can be inserted and  deleted from the 
  670. menu bar by the syntax:
  671.  
  672.    insertMenu "name"
  673.    deleteMenu "name"
  674.  
  675. as well as through macros.
  676.  
  677.  
  678. As alluded to above, Alpha attempts to make procedure names readable in the 
  679. menus by separating words at any capitalized letter. For example, 
  680. 'findFile' becomes "Find File". This function is turned off by the '-m' 
  681. option. 
  682.  
  683. Menu items can be enabled and disabled through the TCL command 
  684. 'enableMenuItem'. Menu items checkmarks can be turned on and off via 
  685. 'markMenuItem'. Menu items can be appended via 'addMenuItem' and deleted 
  686. via 'deleteMenuItem'. See the "Alpha Tcl Extensions" help file for syntax. 
  687.  
  688. If an ellipsis ('…') is the last character in a menu item, it is stripped 
  689. off before searching for the function corresponding to the chosen item. 
  690.  
  691.  
  692. #================================================================================
  693. # Just for the heck of it, the following is a script that I put in my 
  694. # userStartup.tcl file. It creates a menu for all the .tex files in my 
  695. # thesis directory, minus the dirname and .tex extension.
  696. #
  697. set THESIS "Internal:Textures:thesis"
  698. proc thesisMenuProc {menu item} {
  699.     global THESIS
  700.     edit -r -m $THESIS:$item.tex
  701. }
  702.  
  703. set files ""
  704. foreach f [glob $THESIS:*.tex] {
  705.     lappend files [file rootname [file tail $f]]
  706. }
  707. menu -n Thesis -m -p thesisMenuProc $files
  708. unset files
  709. #================================================================================
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.           Event Hooks
  720.  
  721. Alpha calls the TCL procs "openHook", "saveHook", "saveasHook", "closeHook", 
  722. "activateHook", "deactivateHook", "suspendHook", and "resumeHook" when the 
  723. corresponding events occur. With the exception of "saveasHook", the proc 
  724. are all called with the complete pathname as the sole argument. 
  725. "saveasHook" is called with the old pathname as the first argument and the 
  726. new pathname as the second argument. Default implementations for these 
  727. commands are in the file 'proc.tcl'. These commands can be modified to 
  728. perform arbitrary commands, including saving of files, backups, 
  729. implementations of per-window variables, etc. 
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.           Searches
  758.  
  759. ALPHA has a full repertoire of searching commands.  The 'find' command 
  760. brings up a dialog allowing the search and replacement text to be 
  761. specified.  The dialog also allows 'Forward', 'Ignore Case', 'Reg Expr', 
  762. and 'Word Match' options to be set.  These options can be toggled via the 
  763. keyboard by clover-<first letter of option>.  For example, clover-w toggles 
  764. the 'Word Match' option.
  765.  
  766. The 'Mult Files' option tells Alpha to search through all files in a given 
  767. file set.  Filesets can be specified in 'procs.tcl' (see the section on 
  768. filesets) or on the fly, via the "Add Fileset…" item of the "Utils" menu. 
  769. Filesets can be chosen via the popup fileset menu.
  770.  
  771. In addition to the current filesets, the fileset menu has an entry called 
  772. "Directory Scan". Selecting this menu item enables the "Scan Options" 
  773. button. This button, in turn, allows the specification of a directory and 
  774. a file pattern to be searched instead of a fileset. To set the directory, 
  775. hit the "Dir:" button. The pattern is used to select files of the 
  776. selected directory. The '*' wildcard character can be used to replace any 
  777. sequence of characters. For example, the pattern '*.c' will select any 
  778. file ending with ".c". If this doesn't work, be sure that you executed 
  779. all of the following steps:
  780.         1) select "Directory Scan" in the popup menu of the find dialog
  781.         2) Hit the "Scan Options" button.
  782.         3) Select a directory via the "Dir:" button.
  783.  
  784. All multiple searches can be "Batch" searches, a list of all matches in the 
  785. fileset are displayed in a new window.  A particular match can be displayed 
  786. by moving the cursor to a line in the file of matches and selecting "Goto 
  787. Match" from the Utils menu (also bound to control-c control-c).
  788.  
  789. And finally, Alpha allows a library of useful search and replace texts to 
  790. be defined as a tcl list of lists (each sublist containing a name, search 
  791. text, and replacement text). This list, the 'patternLibrary' variable 
  792. defined at the end of 'procs.tcl', is used to create a popup menu in the 
  793. find dialog allowing these patterns to be easily entered.
  794.  
  795. Once the text and options have been set, the 'Search' menu contains several 
  796. commands for repeated searching, replacing, etc. 
  797.  
  798.  
  799.           Regular Expressions
  800.  
  801. If the variable 'regExpr' is true, the search functions interpret the 
  802. search text as regular expressions, which have the following elements:
  803.  
  804.  c        literal char.
  805.  ^        beginning of line.
  806.  $        end of line.
  807.  .        any character except carriage return.
  808.  [...]    character class, can use ranges such as '0-9'.
  809.           inside classes. Matches one character of the 
  810.           enclosed choices. Ex: '[ac0-2]' matches 'a', 
  811.           'c', '0', '1', or '2'.
  812.  [^...]   negated character class, matches anything but
  813.           the enclosed characters. ']' can be included
  814.           by putting it immediately after the '^'.
  815.  \t       tab.
  816.  \r       carriage return or line break.
  817.  *        zero or more occurrences of the previous
  818.           pattern. Ex: 'ab*' matches 'a', 'ab', 'abb',
  819.           'abbb' etc.
  820.  +        one or more occurrences of the previous 
  821.           pattern. 
  822.  ?        zero or one occurrences of the previous 
  823.           pattern. Ex: 'ab?' matches 'a' or 'ab'.
  824.  a|b      matches either a or b. If enclosed in
  825.           parenthesis, the extent of the alternated
  826.           expressions is limited. Ex: (pete|bob) 
  827.           matches either 'pete' or 'bob'.
  828.  (...)    The interior elements are grouped together. 
  829.  
  830. Regular expressions constructed from the above elements can be 
  831. concatenated to create larger expressions. 
  832.  
  833. The parenthesis also define substrings of the total matched string that 
  834. can be used either later during substitution. The substring delimited by 
  835. the pair of parenthesis that includes the nth left paren is denoted \n, 
  836. where n is 1, 2, .... 9.  '\0' and '&' both refer to the matched text.
  837.  
  838. EXAMPLE: 
  839. The following regular expression will match either 'aabox' or 'bbbox':
  840.  
  841.               (aa|bb)box
  842.  
  843. Regular expressions can be very difficult to master, but they the 
  844. following section shows how useful they can be.
  845.  
  846.  
  847.           Searches, Incremental
  848.  
  849. Emacs users will be happy that both forward and backward incremental 
  850. searches are implemented. Incremental searches bypass the normal search 
  851. dialog and search for the current text after each keystroke. The result is 
  852. often much faster and less intrusive. Executing either while an incremental 
  853. search is in progress causes the search to proceed to the next instance of 
  854. the current text. Incremental search mode is exited when any other command 
  855. (executed through the menus or through bindings that include at least one of 
  856. the control key and the option key) is executed, or when the escape or 
  857. delete key is used. Typing control-w while incremental search is active 
  858. causes all the characters to the end of the next word boundary to be 
  859. added to the search.
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.           Tags, 'C'
  886.  
  887. ALPHA supports the use of tags to find declarations of functions. When 
  888. searching for a tag, ALPHA looks for the tag file specified by the 
  889. "tagFile" string variable. ALPHA's tag generating routines use the regular 
  890. expression in the string variable "funcExpr" to look for function 
  891. declarations. In other words, we don't parse the text. If you declare your 
  892. functions differently, you can change " funcExpr" to suit your own style. 
  893. Alpha currently uses the following regular expression to find C function 
  894. declarations:
  895.  
  896.               ^[^ \t#\r/@][^\r]*\([^\r]*\)$
  897.  
  898. (NOTE: the above expressions won't pick up many C++ method definitions. To 
  899. pick them up, add a question mark '?' after the last right parenthesis.) 
  900. Although complicated, this expression makes sense if you slowly wade 
  901. through it. The string that we are looking for must take up an entire 
  902. line. It must begin with a character other than '\t', '#', '\r', '/', ' ', 
  903. or '@'. There must be a set of parenthesis.   
  904.  
  905. Note that not only can you customize this to your style of 'C' 
  906. declarations, you could also use it to generate tags for other languages. 
  907. The only thing you need to bear in mind is that the tag routines use the 
  908. complete word previous to the first '(' in the selected line as the 
  909. function's name. If there is no '(' in the selected line, the last word in 
  910. the line is used. Therefore, Pascal procedures w/ or w/o parameters can be 
  911. identified.
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.           Backups
  920.  
  921. If the 'backup' variable is set in userStartup.tcl, or from the 
  922. Utils:Flags menu, Alpha backs up each file before saving new 
  923. modifications. By default, the backup file is in the same directory, and 
  924. its name is formed by suffixing a tilde to the name of the saved file. 
  925. Backups are actually performed in the 'saveHook' proc (see above), in the 
  926. file procs.tcl. The Tcl variables 'backDir' and 'backExtension' can be 
  927. used to modify this behavior.
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.           Fill Routines
  956.  
  957. The "fill" and "wrap" routines reformat text to specified line lengths. 
  958. This is useful in two case. First, word processors such as Microsoft Word 
  959. only insert carriage returns at the end of paragraphs. Secondly, while 
  960. typing and inserting text into pre-existing paragraphs, the line lengths 
  961. become unequal. 
  962.  
  963. The "wrap" routine handles word processor documents quickly by merely 
  964. inserting carriage returns as necessary to ensure all lines in the 
  965. selected region are shorter than specified by the variable 'fillColumn'. 
  966. Alpha asks the user if wrapping should be done whenever the user opens 
  967. files that have lines longer than 'paraColumn' characters.
  968.  
  969. The TCL routines 'fillRegion' and 'fillParagraph' go further. Not only do 
  970. they break lines, but they also coalesce lines to eliminate short lines. 
  971. Both routines work by stripping the relevent text of white space, then 
  972. re-inserting white space and carriage returns so that no line extends past 
  973. 'fillColumn' characters in length and begins with 'leftFillColumn' spaces 
  974. characters. Both routines are implemented in the file 'procs.tcl', and 
  975. therefore different definitions of paragraphs can be accomodated by 
  976. modifying the appropriate TCL procedures.
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.           Word Breaking
  991.  
  992. Alpha allows you to redefine it's internal notion of what a word is, 
  993. through the variables 'wordBreak', and 'wordBreakPreface'. 'wordBreak' is 
  994. set to a regular expression that defines a word to you. 'wordBreakPreface' 
  995. should be a regular expression that matches exactly one of any characters 
  996. that are not in your word definition. 
  997.  
  998. For instance, the default definition of 'wordBreak' is '[a-zA-Z0-9_]+'. 
  999. This matches any contiguous sequence of contiguous alphanumeric 
  1000. characters, plus underscore.
  1001.  
  1002. The default value for wordBreakPreface is '[^a-zA-Z0-9_]', basically just 
  1003. the negation of any any of the characters in your 'wordBreak' definition. 
  1004.  
  1005. The need for both these variables in backward searches can be seen as 
  1006. follows. Suppose your window's text is "hey hello", and the current 
  1007. insertion is between the two 'l's. Now, searching backwards for the above 
  1008. 'wordBreak' definition will take the insertion to between the 'e' and the 
  1009. first 'l', not really where we want to say is the start of the word. By 
  1010. contrast, if we search backwards for 'wordBreak' and 'wordBreakPreface' 
  1011. concatenated together, and then move forward one character after a 
  1012. successful search, we end up right before the 'h' in 'hello', just where 
  1013. we want to be.
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.           File Sets
  1030.  
  1031. File Sets are lists of files that Alpha uses for multiple-file searches and 
  1032. tag searches, among other things. Typically, a user will set up several 
  1033. different file sets in the AlphaBits.tcl file, perhaps one specifying all 
  1034. the source files in a project, another specifying all the Mac include 
  1035. files, and another specifying all the UNIX include files. When a command 
  1036. using file sets is initiated, Alpha evaluates the command "getCurrFileSet", 
  1037. which returns a list of complete pathnames to search. Some of the lists are 
  1038. set up explicitly (see the 'noGlobNecessary' definition in "procs.tcl"), 
  1039. while other file sets are defined at startup time through the use of file 
  1040. globbing. See the TCL manual page for a definition of "glob"ing. The 
  1041. definition of the variable "globNecessary" in "procs.tcl" shows how to to 
  1042. this. 
  1043.  
  1044. Functions that use file sets operate on the "current" fileset, which is 
  1045. specified by the 'fileSet' variable. The current file set can also be 
  1046. switched by using  the "File Set" heirarchical menu. 
  1047.  
  1048.  
  1049. 5.02 includes a new Tcl proc 'addFileset', which allows a fileset to be 
  1050. created on the fly. This 
  1051. fileset remains usable until Alpha is restarted. It should be quite simple 
  1052. to use Tcl to make this new fileset permanent. A Tcl proc could also be 
  1053. written to create a heirarchical menus that has a submenu for each fileset, 
  1054. the items of each submenu being the files for that fileset. However, I'm 
  1055. not going to write everything... 
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.           Macros, Keyboard
  1071.  
  1072. Defining and Using Keyboard Macros ALPHA supports keyboard macros which 
  1073. record a sequence of keystrokes to be played back later w/ the function 
  1074. 'executeKeyboardMacro' (this function is also in the 'Utilities' menu) or 
  1075. written into a buffer by selecting 'Dump Macro' from the 'Utilities' menu. 
  1076. The dump function prompts you for a macro name, which must consist only of 
  1077. letters of the alphabet, digits, and '_'. 
  1078.  
  1079. These macro declarations can then be edited, loaded, and bound to 
  1080. keystrokes. Loading a macro or a binding is accomplished by hiliting the 
  1081. text and selecting the "Load Selection" item of the 'Customize' window. If 
  1082. no text is hilited, the entire window is loaded by the same command. 
  1083. Macros can be bound to keys in exactly the same manner as functions (see 
  1084. above). 
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.           Undo + Redo
  1105.  
  1106. ALPHA supports unlimited undo and redo. This means that most changes can 
  1107. be undone, and then redone, at will. Bear in mind that once you create new 
  1108. modifications, all changes that you have undone but not redone are lost. 
  1109. Another point to bear in mind is that saving a buffer to disk currently 
  1110. flushes the undo buffer. 
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.           THINK and Alpha
  1139.  
  1140. Yes! Finally Think has support for external editors (7.0 or better).  To 
  1141. make this work, put an alias of Alpha in the "Tools" subdirectory of the 
  1142. directory the project manager is in, and name the alias "Editor".  
  1143. Secondly, check the "Use External Editor" button in the project manager's 
  1144. option dialog.  You do not have to check the "Always Check File Dates" 
  1145. button.
  1146.  
  1147. Any open window events will now be vectored to Alpha, and from within 
  1148. Alpha you can initiate compiles, disassembles, makes, etc. Errors are 
  1149. reported back to Alpha.
  1150.  
  1151. Look in :Tcl:SystemCode:"think.tcl" for the code controlling much of the 
  1152. interactions between THINK and Alpha.  If you improve anything, please send 
  1153. it back to me.
  1154.  
  1155. If a window contains a file that is part of the a project that is 
  1156. currently open in the Think Project Manager, selecting "Open Header" from 
  1157. the Think menu will put up a list of include files. The same files can be 
  1158. accessed by option-clicking on the window's title-bar.
  1159.  
  1160. A fileset consisting of the source to a think project can be created 
  1161. through the "File:File Sets" menu.
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.           Rectangular Editing
  1182.  
  1183. If the option key is pressed while the mouse is dragged,  a rectangular 
  1184. section of text is selected instead of the normal selection. This 
  1185. rectangular selection may extend over multiple lines, but contains only 
  1186. text between the column of the drag start and the column of the drag end. 
  1187. The drag cannot end on a column or row less than the start. This selection 
  1188. can be extended by option-shift-mouse, but not dragged further.
  1189.  
  1190. The rectangular selection can be deleted, copied, and pasted. This is very 
  1191. useful for tables and arrays, such as in LaTeX. Usually, the operation 
  1192. will be intuitive. However, if you use proportional fonts the selection 
  1193. may appear ragged. If some of the line contain tabs, the result may not be 
  1194. want you want. Converting tabs to spaces in the desired region before 
  1195. attempting rectangular selection usually fixes the problems. 
  1196.  
  1197. The most natural semantics of rectangular selection aren't obvious. I 
  1198. chose to implement it in a similar fashion to that of Microsoft Word. 
  1199. Preditor does it in another way, and has many bugs (and it's  commercial, 
  1200. hah!).
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.           LaTeX
  1216.  
  1217. See the "LaTeX Help" file under the help menu.
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.           Option Key
  1226.  
  1227. ALPHA's default setup uses the command key like any other mac application. 
  1228. Problems arise in ALPHA's emulation of emacs key bindings. Emacs uses an 
  1229. escape key and a control key.  Alpha's default configuration is set up for 
  1230. Mac II's. Emacs's escape and control keys are emulated by the Mac's 
  1231. corresponding keys. For Mac+'s, however, the situation is much more 
  1232. complicated. They don't have an escape key, so the the backquote key, '`', 
  1233. must be used instead. This can be set up by uncommenting the appropriate 
  1234. line in the "AlphaBits.tcl" file. Also, Mac+'s don't have control keys, so 
  1235. the option key can be used instead.  However....
  1236.  
  1237. Using the option key isn't quite that simple. First, the option key is 
  1238. already used in two contexts. There may be other option bindings. Also, if 
  1239. the variable 'optionIsEscape' is set, the option key is treated as if it 
  1240. is an escape so as to allow single keystroke calls of Alpha functions. In 
  1241. order to use the option key as an escape key, this variable must be set to 
  1242. zero in the AlphaBits file. Also, all the relevant bindings must have 
  1243. their modifier strings changed from using 'z' to 'o'.
  1244.  
  1245. There are other problems. Several option combinations are "dead keys" 
  1246. (option-e, option-o....), they are used to create bizarre (sorry to y'all 
  1247. non-Amuricans) characters through multiple keystrokes. Alpha can fix this 
  1248. by overlaying the system 'KCHR' resource with a private modified resource. 
  1249. This happens at startup time if the "AlphaBits.tcl" file specifies a zero 
  1250. value for the variable 'noRemapOption'. Unfortunately, this is just a US 
  1251. version of the resource, it won't work "fur the non-Amuricans".
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.           System Software 7.0
  1264.  
  1265. Alpha is 32-bit clean and high-level event aware. 
  1266.  
  1267. Under 7.0, Alpha uses temporary memory to accommodate large files. This 
  1268. allows you to open multi-megabyte files even when Alpha's partition is set 
  1269. only at 512k, if the system has that much memory available. Note that 
  1270. using temporary memory makes that much memory unavailable to other 
  1271. applications. Contrary to all admonishments, Alpha does not unlock 
  1272. temporary memory across WaitNextEvent calls and may eventually use all the 
  1273. memory in your system. You can turn this feature off through 'tempMem'.
  1274.  
  1275. Note, however, that the clipboard is allocated by the system in Alpha's 
  1276. heap, and therefore cannot take advantage of temporary memory.
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.           Apple Events
  1299.  
  1300. See the Help file on AppleEvents.
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.           MPW
  1333.  
  1334. Alpha's 'dosc' capability (see the function "dosc") can be used to send 
  1335. events to MPW's ToolServer. Using about ten lines of C code and the ~40 
  1336. lines of Tcl code in 'mpw.tcl', I created a pseudo mpw shell (look under 
  1337. the "Misc" menu). This shell uses Alpha's 'dosc' function to package each 
  1338. shell command up into an Apple Event and send it to the ToolServer, which 
  1339. then evaluates the command and returns the result to be displayed in the 
  1340. shell. I'm rather new to Apple Events and the ToolServer, so there are 
  1341. probably a few rough edges. 
  1342.  
  1343. If anyone has extensive docs for ToolServer I'd appreciate looking at them. 
  1344. I only have the application because I am a beta tester for another product 
  1345. that supports ToolServer. I was given the application for the beta testing, 
  1346. but not any docs. And of course, I can *not* give away copies of 
  1347. ToolServer because it is a licensed Apple product.
  1348.  
  1349. Finally, Tom Moertel (thor@vivaldi.psu.edu) has written and provided a set 
  1350. of tools that make life easier while writing code in Alpha for the MPW 
  1351. environment. The tools make extensive use of Apple Events, so you must be 
  1352. using MPW 3.3a or greater. (Earlier versions cannot receive commands via 
  1353. Apple Events.) 
  1354.  
  1355.   With the MPW-Alpha package you can:
  1356.   
  1357.     o  Send TCL commands to Alpha from MPW
  1358.     o  Use MPW 411 from Alpha for instant access to programming help
  1359.     o  Automagically locate source code errors from your last MPW compile
  1360.     o  Use the MPW CDent tool to reformat (grind) C/C++ source code
  1361.        from within Alpha
  1362.  
  1363. This package is available via anonymous ftp from cs.rice.edu.
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.           File Formats
  1381.  
  1382. Alpha reads and writes files stored in three (or maybe four) different 
  1383. formats. The three main formats are mac (lines end with a carriage 
  1384. return), unix (lines end with linefeed), and IBM pc (lines end with both 
  1385. carriage return and linefeed. Typical, isn't it?).
  1386.  
  1387. Alpha will transparently read and write all three of these formats. You 
  1388. don't have to do anything special to use different formats, but the 
  1389. 'SaveAs...' dialog allows you to specify the format that a file is written 
  1390. in through the 'Format' button.
  1391.  
  1392. The fourth file format is just a modification of the ordinary mac format. 
  1393. Word processors such as Microsoft Word and MacWrite only put carriage 
  1394. returns at the end of paragraphs, so that they can wrap  the paragraphs on 
  1395. the fly. This is what is referred to as 'paragraph format' in the rest of 
  1396. the help text. Alpha does not transparently convert to and from this 
  1397. format because there are valid reasons why someone might want to edit a 
  1398. paragraph formatted file while not in paragraph mode. 
  1399.  
  1400. Therefore, when Alpha detects reads a paragraph-mode file, it asks the 
  1401. user whether or not to remap it. Files can be mapped back to paragraph 
  1402. mode by setting 'fillColumn' to a very large number and executing 
  1403. 'fillRegion' on the text.
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.           Printing
  1415.  
  1416. The current window is printed through the "Page Setup..." and "Print..." 
  1417. File menu items. The variable 'suppressHeader' controls whether a header 
  1418. is printed on each page, 'leftMargin', 'topMargin', and 'bottomMargin' 
  1419. control margins on the printed page.
  1420.  
  1421. 'printerFont' and 'printerFontSize' allows the size and type of the 
  1422. printed font to be specified.
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.           Tips
  1452.  
  1453. - When a window is "dirty" (has unsaved changes), a
  1454.   red disk icon appears just below the titlebar in the
  1455.   upper right corner of the window, and a diamond 
  1456.   appears next to the corresponding item in the Windows
  1457.   menu. 
  1458.  
  1459. - All dialogs that have editable text can use the Cut, 
  1460.   Copy, and Paste menu command equivalents.
  1461.  
  1462. - In all dialogs, non-editable controls can be selected 
  1463.   by typing Command-<first char of control>. If there 
  1464.   are no editable controls in the dialog, simply typing 
  1465.   the first letter of the desired control suffices. PgUp,
  1466.   PgDown, Home, and End keys now work for most list dialogs.
  1467.  
  1468. - Set the flag 'undoOn' to 0 in order to speed up long 
  1469.   replace-all and macro modifications.
  1470.  
  1471. - After a piece of text has been yank'd or paste'd, the 
  1472.   'mark' is set to the beginning of the new text and the
  1473.   selection is at the end. 'markHilite' will now hilite 
  1474.   the entire insertion. This is especially useful when
  1475.   moving code. Cut the code, insert at a new position,
  1476.   select the inserted text by selecting "Edit:Hilite", and 
  1477.   then use "Edit:Shift Left" and "Edit: Shift Right" to move
  1478.   the text to the proper indentation.
  1479.  
  1480. - Most help files have marks in them, which let you quickly
  1481.   navigate to places of interest. You can access these marks
  1482.   by command-clicking on the title-bar or on the "{}" icon
  1483.   above the vertical scrollbar.
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.           Variables 
  1493.  
  1494. There are two different kinds of variables in the Alpha world. These are 
  1495. internal variables and Tcl variables. You can only directly access the 
  1496. latter. However, the internal variables can be modified by creating a Tcl 
  1497. variable of the same name and "binding" it to its internal counterpart via 
  1498. the 'shadowVar' command (See the "Alpha Tcl Extensions" file under the 
  1499. "Help" menu for 'shadowVar's syntax). The following is a listing of the 
  1500. internal variables that can be bound using 'shadowVar': 
  1501.  
  1502. autoSave       • If TRUE, buffers (except untitled buffers) are automatically
  1503.                  saved every 'changesLim' changes.
  1504. backDir           • Directory in which to store backup files.
  1505. backSuffix     • Suffix to append to backup files.
  1506. backup         • if TRUE, the default Tcl proc 'saveHook' makes a backup 
  1507.                  of a file before the data is written. The default backup scheme has 
  1508.                  extension "~".
  1509. blockCursor    • if true, Alpha uses a block cursor instead of a vertical 
  1510.                  line. 
  1511. bwWindows      • if true, Alpha will use 1-bit windows
  1512.                  even if color is available. This speeds
  1513.                  refresh quite a bit on slow color 
  1514.                  machines such as the IIsi.
  1515. changesLim     • number of changes to a window before 
  1516.                  garbage collection or autosave is done.
  1517. currFileSet    • name of currently selected file set.
  1518. defaultFont    • font to use on new windows and files 
  1519.                  which don't have associated font 
  1520.                  specification resources.
  1521. defHeight      • If 'fullScreen' set, this is default 
  1522.                  height in pixels.
  1523. defWidth       • If 'fullScreen' set, this is default 
  1524.                  width in pixels.
  1525. elecLBrace     • Electric 'C' left brace on.
  1526. elecRBrace     • Electric 'C' right brace on.
  1527. electricSemi   • Electric 'C' semicolon on.
  1528. fillColumn     • Number of columns use as limit for
  1529.                  "fill" routines. See 'leftFillColumn'
  1530. fontSaving     • if '-1', Alpha never saves font info,
  1531.                  if '1', Alpha always saves font info,
  1532.                  '0', Alpha saves font info if the font
  1533.                  or size is different than the default.
  1534. fontSize       • Default size of fonts used to display 
  1535.                  files.
  1536. fullNames      • Windows display pathnames instead of 
  1537.                  mere file names.
  1538. fullScreen     • If on, all windows are start in the 
  1539.                  same place, and have the dimension 
  1540.                  specified by 'defHeight' and 
  1541.                  'defWidth'.
  1542. funcPar        • Used in defining the "Func" title-bar menu, see Alpha 
  1543.                    help.
  1544. funcExpr       • Set to the regular expression that 
  1545.                  ALPHA uses to find function 
  1546.                  declarations.
  1547. funcTitle      • Text to put in title-bar menu header.
  1548.                  See the Popup-Menus section for more
  1549.                  information.
  1550. horScrollBar   • If set, use horizontal scrollbar.
  1551. includePath    • A list of the path-names of the 
  1552.                  directories to search for include 
  1553.                  files, separated by semi-colons, such
  1554.                  as:
  1555.                    "Disk:C:edit;Disk:C:THINK C:include;"
  1556.                  The current directory can be included
  1557.                  by using consecutive semi-colons as:
  1558.                  "Disk:C:edit;Disk:C:THINK C:inc;;"
  1559. indentOnCR     • Auto-indent on carriage return.
  1560. leftFillColumn • Number of blanks left at beginning of 
  1561.                  lines by 'fill' routines. 
  1562. markLabel       • If a window is opened through either 'edit' or 'fileMenu' 
  1563.                  and the '-m' option was set, this string is used as the label
  1564.                  of the marks menu.
  1565. markSorting       • Controls the order in which marks are saved into a file. 
  1566.                  '0' means the order in which they are defined, '1' means file 
  1567.                  order, and '2' means alphabetical order.
  1568. moveInsertion  • if true, 'pageBack' and 'pageForward'
  1569.                  move the insertion point
  1570. numWinsToTile  • specifies the number of windows tile
  1571.                  commands should affect.
  1572. openAllFIles   • if true, or it option key down, files 
  1573.                  of all types are openable, not just
  1574.                  'TEXT'.
  1575. optionIsMeta   • If set, the key combination with escape
  1576.                  is used instead of the option key
  1577.                  combination. Note that some 
  1578.                  combinations with option chars are
  1579.                  dead keys.
  1580. paraColumn     • Alpha automatically wraps files
  1581.                 that contains lines longer than this. 
  1582. posActivate    • If true, then merely moving the mouse
  1583.                  over a window activates. For those
  1584.                  X11-twm lovers.
  1585. powerThumb       • If true, vertical scrollbars have power thumbs.
  1586. protoFile      • name of file to dump prototypes into.
  1587. replaceStr       • Text for the search and replace functions.
  1588. savedState       • set to either "mpw", "think", or "none" depending on how 
  1589.                  much information you wish Alpha to save in the resource 
  1590.                  fork of the files you edit. See the "Files" section of 
  1591.                  this file for more information.
  1592. searchStr       • Text for the search and replace functions.
  1593. showRowCol     • if set, row and col are continuously
  1594.                  displayed in the title bar. 
  1595. showMenuHeads  • If set, the function and mark menus can 
  1596.                  be selected from the title bar.
  1597. intelCutPaste  • If enabled, cut and paste routines try to 
  1598.                  intelligently treat surrounding white space.
  1599. sortColumn     • column to use for sort routine.
  1600. sortedIsDefault• if set, sorted is the default for 
  1601.                  function and section menus.
  1602. suppressHeader • Suppress header on printed pages.
  1603. tabSize        • Default number of characters per tab.
  1604. tagFile        • complete path-name of tag file
  1605. tempMem        • if zero, Alpha will not use temporary
  1606.                  memory.
  1607. undoOn         • used to turn undo on and off. When undo
  1608.                  is turned off, all undo info is lost.
  1609.                  Useful when doing global replaces, etc.
  1610. wordBreak       • Regular expression used to defines words for all internal 
  1611.                  operations. 
  1612. wordBreakPreface • Prepended to 'wordBreak' when looking backwards for a 
  1613.                  word. See the "Word Break" section of this file for more 
  1614.                  information.
  1615. wordWrap       • if true, lines exceeding 'fillColumn'
  1616.                  in length are automatically wrapped
  1617.                  during normal text insertion (typing)
  1618.  
  1619.  
  1620.  
  1621.           Spellchecking
  1622.  
  1623. Alpha has the capability to interact with the spell-check 'Excalibur', 
  1624. written by Robert Gottshall and Rick Zaccone.  The menu item 'Spellcheck 
  1625. Window' is always available in either the menu w/ Excalibur's icon, or 
  1626. under the Latex menu (with the OzTex menu).  Selecting this item will start 
  1627. up Excalibur and send an OpenDoc event describing the current window.  For 
  1628. version 1.4 and earlier, if Alpha has to launch Excalibur you will need to 
  1629. dismiss Excalibur's opening dialog by hitting the Cancel button.  
  1630. Subsequent selections of the menu item will switch right into Excalibur 
  1631. with the correct file displayed.  In future versions, this will become even 
  1632. more automatic.
  1633.  
  1634. Excalibur is free, but not in the public domain.  It can be obtained from 
  1635. all the usual Internet ftp sites, as well as cs.rice.edu under 
  1636. public/Alpha.
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.           International Users
  1658.  
  1659. Remember, if you want to use anything other than the US KCHR resource 
  1660. (si vous voulez ecrire en francais, par exemple), change the line:
  1661.  
  1662.  init 0 2
  1663.  
  1664. of :Tcl:SystemCode:AlphaBits.tcl to
  1665.  
  1666.  init 1 2
  1667.  
  1668. and restart. Alpha will now use your native KCHR, but the key binding labels
  1669. (such as F1 etc.) may not work, and option-e etc. are now "dead keys", 
  1670. which means that they don't produce events and Alpha won't see them.
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.           Drag and Drop
  1701.  
  1702. Alpha supports drag and drop cut, copy, clear, and paste. To use this 
  1703. feature, select some text, then move the cursor over the selected text. 
  1704. The cursor should then turn into an open hand. Mouse down, and move the 
  1705. cursor to the place you wish to paste the text. When the mouse is 
  1706. released, the hilited text is moved to the new location.
  1707.  
  1708. Option-mouse does a "copy" instead. Dragging the cursor from the selected 
  1709. text off the edge of the window will clear it.
  1710.  
  1711. Alpha does not currently support drag and drop editing between windows or 
  1712. files. 
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.           Status Bar
  1740.  
  1741. The stripe across the bottom of the screen is a floating window that 
  1742. displays status information, certain prompts (option-x, and see the func 
  1743. 'statusPrompt'), and the current row and column.
  1744.  
  1745. You can't make this window go away. However, both 'sizeWin' and 'moveWin' 
  1746. accept "StatusWin" as a window specification and will act on this window, 
  1747. so you can move the window offscreen if you really wish. The height
  1748. parameter to 'sizeWin' is ignored.
  1749.  
  1750. The status bar can be dragged if the flag 'lockStatus' is turned off.
  1751.  
  1752. Clicking over the row and column indicators allows you to jump to a 
  1753. particular line.
  1754.  
  1755. Finally, if you turn horizontal scrollbars off (via the 'horScrollBar' 
  1756. flag in the "Mode:Flags" menu, you haven't lost any real estate. 
  1757. Furthermore, when tiling windows vertically, you actually have *more* 
  1758. real estate. 
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.           Modes
  1781.  
  1782. Each window in Alpha is always in a single "mode", such as the "C++" 
  1783. mode, or the "TeX" mode. A mode describes bindings and variable values 
  1784. particular to that mode. By default, the mode of the frontmost window is 
  1785. displayed on the status bar, and can be changed by the Mode Menu, which 
  1786. is accessed via the second icon above the vertical scroll bar in each 
  1787. window.
  1788.  
  1789. Alpha sets modes for new windows based on file name suffixes.  For instance, 
  1790. "files.c" is started up in mode "C" because of the ".c" suffix.  Below 
  1791. are the standard suffixes recognized by Alpha. You can add more suffixes 
  1792. in your userStartup.tcl file by duplicating the lines adding these suffixes 
  1793. in :Tcl:SystemCode:modes.tcl. The default mode is "Text".
  1794.  
  1795.     .h, .c, .r                        C
  1796.     .cc, .cp, .cpp, .CPP, .C        C++
  1797.     .f .fcm .for .FOR                Fort
  1798.     .tcl                            Tcl
  1799.     .tex, .sty, .ltx, .dtx, .ins    TeX
  1800.     .pl                                Perl
  1801.     .html .HTML                        HTML
  1802.     
  1803. Bindings for a specific mode can be specified by passing the desired mode 
  1804. as the last argument to a 'bind' command (see "Key Bindings"). 
  1805.  
  1806. Alpha has two different types of immediately visible flags and variables. 
  1807. "Global" variables don't change from mode to mode. These are listed in 
  1808. "Modes:Flags" and "Modes:Vars". Any change there affects 
  1809. every mode.
  1810.  
  1811. "Mode" flags and variables are instantiated separately for each mode.  
  1812. These are inspected and set via the "Mode Vars" popup menu, called by 
  1813. clicking on the flag icon above the vertical scrollbar. Changing these 
  1814. values affects every window in that mode, but doesn't affect windows
  1815. in other modes.
  1816.  
  1817. The variables displayed in the "Mode Vars" popup menu are all the variables 
  1818. that the current mode cares about.  The "Set Mode Menus…" item allows you 
  1819. to specify which of the extra menus should be present whenever the 
  1820. frontmost window is in that mode.  Select multiple menus by shift-clicking.
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.         File Comparison
  1831.  
  1832. Version 5.94 and above can create UNIX "diffs" of two text files. Among 
  1833. other things, diffs allow you to easily pinpoint what has changed between 
  1834. two different versions of the same file. 
  1835.  
  1836. Alpha's interface (under the "Utils" menu) allows you to compare either 
  1837. the two topmost windows, or two arbitrary files (later, Alpha will be 
  1838. able to compare entire directories). Alpha opens the two files in windows 
  1839. at the top of the screen with the diff file at the bottom. You can 
  1840. navigate between individual differences in the diff file by using the Up 
  1841. and Down arrows. Pressing either a carriage return or the Enter key 
  1842. displays the affected portions of the two files in the above windows.
  1843.  
  1844. I'm currently using a hack of QUED's GNU diff port.  My hack allows 
  1845. it to work as an AppleEvent server.  However, it handles most errors by 
  1846. quitting without responding, and handles only a single message before 
  1847. quitting. It also doesn't deal with directories. 
  1848.  
  1849. The interface is a 'dosc' script event containing the command-line 
  1850. arguments that would be used in running 'diff' from a UNIX shell. The 
  1851. result is the diff. On the command line, file names containing spaces can 
  1852. be specified by delimiting the entire file name with double quotes. The 
  1853. source for my version of the diff application (crude though it is), is 
  1854. available in public/Alpha on cs.rice.edu.
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.  
  1862.  
  1863.  
  1864.  
  1865.  
  1866.  
  1867.