home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / nedit50.zip / XFree86 / doc / nedit / nedit.doc next >
Text File  |  1997-10-22  |  134KB  |  2,851 lines

  1.                                  NEDIT 5.0
  2.  
  3. NEdit is a GUI (Graphical User Interface) style text editor for programs and
  4. plain-text files.  Users of Macintosh and MS Windows based text editors will
  5. find NEdit a familiar and comfortable environment.  NEdit provides all of the
  6. standard menu, dialog, editing, and mouse support, as well as all of the
  7. standard shortcuts to which the users of modern GUI based environments are
  8. accustomed.  For users of older style Unix editors, welcome to the world of
  9. mouse-based editing!
  10.  
  11. NEdit is free, available in source and binary form for Silicon Graphics, HP,
  12. DEC, IBM, Sun, and Linux systems, as well as for VAX and Alpha VMS. Executables
  13. for non-supported systems are also available.  Porting to other Motif platforms
  14. has generally been easy.
  15.  
  16.  
  17. INSTALLING NEDIT
  18.  
  19. NEdit is a single stand-alone executable file which can be installed by simply
  20. copying the appropriate executable "nedit" for your system.  Both sources
  21. and executables are available via anonymous ftp to ftp.fnal.gov in the
  22. /pub/nedit directory.  The optional "nc" (NEdit Client) program is also
  23. available for users who want to run nedit in client/server mode.
  24.  
  25.  
  26. GETTING STARTED
  27.  
  28. If you are new to X windows, you may need some help setting up your X
  29. environment or using X across a network.  If you have used other Motif
  30. programs before, you can probably use NEdit without much instruction.
  31.  
  32. Start NEdit by typing nedit.  You can specify a file or several files to edit
  33. on the command line, but you can also open them from inside of NEdit.  If you
  34. don't specify a file name to edit, NEdit will open a window titled "Untitled".
  35. You can create a new file by typing into this window and choosing Save or
  36. Save As... from the File menu.  There is no "main window" in NEdit, all
  37. editor windows are equivalent, and NEdit remains running as long as at least
  38. one window is open.
  39.  
  40. Most editor commands are available from the pulldown menus (File, Edit, Search,
  41. etc.).  If you make a mistake, any editing operation can be undone by
  42. selecting Undo from the Edit menu.  Online help is also available through the
  43. Help menu on the right-hand side of the menu bar.
  44.  
  45. To open an existing file once nedit is running, choose Open... from the File
  46. menu.   Select the file that you want to open in the pop-up dialog that
  47. appears, and click on OK.  You may have any number of files open at the same
  48. time.  Each file will appear in its own editor window.  Using Open..., rather
  49. than re-typing the nedit command and running additional copies of NEdit, is
  50. both more memory-efficient, and allows NEdit to better manage your files.
  51.  
  52. As you become more familiar with NEdit, you can use the control and function
  53. keys shown on the right side of the pull-down menus, as a substitute for
  54. selecting items with the mouse.
  55.  
  56. Dialogs are also streamlined so you can enter information quickly and without
  57. using the mouse.  Keyboard focus is automatically directed to the first field
  58. in a dialog when the dialog pops up.  To move the keyboard focus around a
  59. dialog, use the tab and arrow keys.  One of the buttons in a dialog is usually
  60. drawn with a thick, indented, outline.  This button can be activated by
  61. pressing return or enter.  For example, to replace the string "thing" with
  62. "things" type:
  63.  
  64.     <ctrl-r>thing<tab>things<return>
  65.  
  66. To open a file named "whole_earth.c", type:
  67.  
  68.     <ctrl-o>who<return>
  69.  
  70. (how much of the filename you need to type depends on the other files in the
  71. directory).  See the section titled KEYBOARD SHORTCUTS for more information.
  72.  
  73.  
  74. SELECTING TEXT
  75.  
  76. NEdit has two general types of selections, primary (highlighted text), and
  77. secondary (underlined text). Selections can cover either a simple range of text
  78. between two points in the file, or they can cover a rectangular area of the
  79. file.  Rectangular selections are only useful with non-proportional (fixed
  80. spacing) fonts.
  81.  
  82. To select text for copying, deleting, or replacing, press the left mouse button
  83. with the pointer at one end of the text you want to select, and drag it to the
  84. other end.  The text will become highlighted.  To select a whole word, double
  85. click (click twice quickly in succession).  Double clicking and then dragging
  86. the mouse will select a number of words.  Similarly, you can select a whole line
  87. or a number of lines by triple clicking or triple clicking and dragging. 
  88. Quadruple clicking selects the whole file.  After releasing the mouse button,
  89. you can still adjust a selection by holding down the shift key and dragging on
  90. either end of the selection.  To delete the selected text, press delete or
  91. backspace.  To replace it, begin typing.
  92.  
  93. To select a rectangle or column of text, hold the Ctrl key while dragging the
  94. mouse.  Rectangular selections can be used in any context that normal selections
  95. can be used, including cutting and pasting, filling, shifting, dragging, and
  96. searching.  Operations on rectangular selections automatically fill in tabs and
  97. spaces to maintain alignment of text within and to the right of the selection. 
  98. Note that the interpretation of rectangular selections by Fill Paragraph is
  99. slightly different from that of other commands, the section titled "Shifting and
  100. Filling" has details.
  101.  
  102. The middle mouse button can be used to make an additional selection (called the
  103. secondary selection).  As soon as the button is released, the contents of this
  104. selection will be copied to the insert position of the window where the mouse
  105. was last clicked (the destination window).  This position is marked by a caret
  106. shaped cursor when the mouse is outside of the destination window.  If there is
  107. a (primary) selection, adjacent to the cursor in the window, the new text will
  108. replace the selected text.  Holding the shift key while making the secondary
  109. selection will move the text, deleting it at the site of the secondary
  110. selection, rather than copying it.
  111.  
  112. Selected text can also be dragged to a new location in the file using the middle
  113. mouse button.  Holding the shift key while dragging the text will copy the
  114. selected text, leaving the original text in place.  Holding the control key will
  115. drag the text in overlay mode.
  116.  
  117. Normally, dragging moves text by removing it from the selected position at the
  118. start of the drag, and inserting it at a new position relative to to the mouse. 
  119. Dragging a block of text over existing characters, displaces the characters to
  120. the end of the selection.  In overlay mode, characters which are occluded by
  121. blocks of text being dragged are simply removed.  When dragging non-rectangular
  122. selections, overlay mode also converts the selection to rectangular form,
  123. allowing it to be dragged outside of the bounds of the existing text.
  124.  
  125. The section "Using the Mouse" sumarizes the mouse commands for making primary
  126. and secondary selections.  Primary selections can also be made via keyboard
  127. commands, see "Keyboard Shortcuts".
  128.  
  129.  
  130. CUTTING and PASTING
  131.  
  132. The easiest way to copy and move text around in your file or between windows, is
  133. to use the clipboard, an imaginary area that temporarily stores text and data. 
  134. The Cut command removes the selected text (see SELECTING TEXT) from your file
  135. and places it in the clipboard.  Once text is in the clipboard, the Paste
  136. command will copy it to the insert position in the current window.  For example,
  137. to move some text from one place to another, select it by dragging the mouse
  138. over it, choose Cut to remove it, click the pointer to move the insert point
  139. where you want the text inserted, then choose Paste to insert it.  Copy copies
  140. text to the clipboard without deleting it from your file.  You can also use the
  141. clipboard to transfer text to and from other Motif programs and X programs which
  142. make proper use of the clipboard.
  143.  
  144. There are many other methods for copying and moving text within NEdit windows
  145. and between NEdit and other programs.  The most common such method is clicking
  146. the middle mouse button to copy the primary selection (to the clicked
  147. position).  Copying the selection by clicking the middle mouse button in many
  148. cases is the only way to transfer data to and from many X programs.  Holding
  149. the Shift key while clicking the middle mouse button moves the text, deleting
  150. it from its original position, rather than copying it.  Other methods for
  151. transferring text include secondary selections, primary selection dragging,
  152. keyboard-based selection copying, and drag and drop.  These are described in
  153. detail in the sections: Selecting Text, Using the Mouse, and Keyboard
  154. Shortcuts.
  155.  
  156.  
  157. FINDING AND REPLACING TEXT
  158.  
  159. The Search menu contains a number of commands for finding and replacing text.
  160.  
  161. The Find... and Replace... commands present dialogs for entering text for
  162. searching and replacing.  These dialogs also allow you to choose whether you
  163. want the search to be sensitive to upper and lower case, or whether to use the
  164. standard Unix pattern matching characters (regular expressions).  Searches
  165. begin at the current text insertion position.
  166.  
  167. Find Again and Replace Again repeat the last find or replace command without
  168. prompting for search strings.  To selectively replace text, use the two
  169. commands in combination: Find Again, then Replace Again if the highlighted
  170. string should be replaced, or Find Again again to go to the next string.
  171.  
  172. Find Selection searches for the text contained in the current primary
  173. selection (see SELECTING TEXT).  The selected text does not have to be in the
  174. current editor window, it may even be in another program.  For example, if the
  175. word dog appears somewhere in a window on your screen, and you want to find it
  176. in the file you are editing, select the word dog by dragging the mouse across
  177. it, switch to your NEdit window and choose Find Selection from the Search
  178. menu.
  179.  
  180. Searching Backwards
  181.  
  182. Holding down the shift key while choosing any of the search or replace
  183. commands from the menu (or using the keyboard shortcut), will search in the
  184. reverse direction.  Users who have set the search direction using the buttons
  185. in the search dialog, may find it a bit confusing that Find Again and Replace
  186. Again don't continue in the same direction as the original search (for
  187. experienced users, consistency of the direction implied by the shift key is
  188. more important).
  189.  
  190. Selective Replacement
  191.  
  192. To replace only some occurrences of a string within a file, choose Replace...
  193. from the Search menu, enter the string to search for and the string to
  194. substitute, and finish by pressing the Find button.  When the first occurrence
  195. is highlighted, use either Replace Again (^T) to replace it, or Find Again
  196. (^G) to move to the next occurrence without replacing it, and continue in such
  197. a manner through all occurrences of interest.
  198.  
  199. To replace all occurrences of a string within some range of text, select the
  200. range (see SELECTING TEXT), choose Replace... from the Search menu, type the
  201. string to search for and the string to substitute, and press the "R. in
  202. Selection" button in the dialog.  Note that selecting text in the Replace...
  203. dialog will unselect the text in the window.
  204.  
  205. Regular Expressions
  206.  
  207. egular expressions are available in the Find... and Replace... dialogs as a way
  208. to match inexact sequences of characters.  Regular expression substitution can
  209. also be used to program automatic editing operations.  For example, the
  210. following are search and replace strings to find occurrences of the subroutine
  211. get_x, reverse the first and second parameters, add a third parameter of NULL,
  212. and change the name to new_get_x":
  213.  
  214.     Search string:  get_x\(([^ ,]*), ([^\)]*)\)
  215.     Replace string: new_get_x(\2, \1, NULL)
  216.  
  217. To use regular expressions, click on the Regular Expression button in the
  218. Find... or Replace... dialogs before doing a search or replacement.
  219.  
  220. Regular Expression Syntax
  221.  
  222. The components of a regular expression are: branches, pieces, atoms, and
  223. ranges. A regular expression consists of zero or more branches, separated by
  224. `|'.  It matches anything that matches one of the branches.
  225.  
  226. A branch is zero or more pieces, concatenated.  It matches a match for the
  227. first, followed by a match for the second, etc.
  228.  
  229. A piece is an atom possibly followed by `*', `+', or `?'.  An atom followed by
  230. `*' matches a sequence of 0 or more matches of the atom.  An atom followed by
  231. `+' matches a sequence of 1 or more matches of the atom.  An atom followed by
  232. `?' matches a match of the atom, or the null string.
  233.  
  234. An atom is a regular expression in parentheses (matching a match for the
  235. regular expression), a range (see below), `.' (matching any single character),
  236. `^' (matching the null string at the beginning of a line string), `$' (matching
  237. the null string at the end of a line), `<' or `>' (matching the null string at
  238. a word boundary), a `\' followed by a single character (matching that
  239. character), or a single character with no other significance (matching that
  240. character).  \t, \n, \b, \r, and \f represent the characters tab newline,
  241. backspace, carriage return, and form feed.
  242.  
  243. A range is a sequence of characters enclosed in `[]'.  It normally matches any
  244. single character from the sequence.  If the sequence begins with `^', it
  245. matches any single character not from the rest of the sequence.  If two
  246. characters in the sequence are separated by `-', this is shorthand for the full
  247. list of ASCII characters between them (e.g. `[0-9]' matches any decimal digit).
  248.  To include a literal `]' in the sequence, make it the first character
  249.  (following a possible `^').  To include a literal `-', make it the first or
  250.  last character.  A backslash `\' followed by a single character includes that
  251.  character, however backslashes are not necessary for most special characters,
  252.  since inside a range, only the `]', `-', and '\' characters are treated
  253.  specially.
  254.  
  255. Substitution
  256.  
  257. Wherever the substitution string contains the character `&', NEdit will
  258. substitute the the entire string that was matched in the Find operation.  Up to
  259. nine sub-expressions of the match string can also be inserted into the
  260. replacement string, using `\' followed by a digit. \1 through \9 represent the
  261. strings that matched parenthesized expressions within the regular expression,
  262. numbered left-to-right in order of their opening parentheses.  Preceding & or
  263. \1-9 with \U, \u, \L, or \l adjusts the case of the inserted text.  \u and \l
  264. change only the first character, while \U and \L change the entire string to
  265. upper or lower case.  \t, \n, \b, \r, and \f represent the characters tab
  266. newline, backspace, carriage return, and form feed in a substitution string
  267. represent the tab and newline characters as they do in match strings.
  268.  
  269. Ambiguity
  270.  
  271. If a regular expression could match two different parts of the text, it will
  272. match the one which begins earliest.  If both begin in the same place but match
  273. different lengths, or match the same length in different ways, life gets
  274. messier, as follows.
  275.  
  276. In general, the possibilities in a list of branches are considered in
  277. left-to-right order, the possibilities for `*', `+', and `?' are considered
  278. longest-first, nested constructs are considered from the outermost in, and
  279. concatenated constructs are considered leftmost-first.  The match that will be
  280. chosen is the one that uses the earliest possibility in the first choice that
  281. has to be made.  If there is more than one choice, the next will be made in the
  282. same manner (earliest possibility) subject to the decision on the first choice.
  283.  And so forth.
  284.  
  285. For example, `(ab|a)b*c' could match `abc' in one of two ways.  The first
  286. choice is between `ab' and `a'; since `ab' is earlier, and does lead to a
  287. successful overall match, it is chosen.  Since the `b' is already spoken for,
  288. the `b*' must match its last possibility-the empty string-since it must respect
  289. the earlier choice.
  290.  
  291. In the particular case where no `|'s are present and there is only one `*',
  292. `+', or `?', the net effect is that the longest possible match will be chosen. 
  293. So `ab*', presented with `xabbbby', will match `abbbb'.  Note that if `ab*' is
  294. tried against `xabyabbbz', it will match `ab' just after `x', due to the
  295. begins-earliest rule.  (In effect, the decision on where to start the match is
  296. the first choice to be made, hence subsequent choices must respect it even if
  297. this leads them to less-preferred alternatives.)
  298.  
  299.  
  300. USING THE MOUSE
  301.  
  302. NEdit is one of the most mouse interactive text editors around, but you don't
  303. need to know all of the details below to be productive.  You can get by with
  304. just the left mouse button, clicking to move the cursor, and dragging to make a
  305. selection.
  306.  
  307. This section will make more sense if you also read the sections, SELECTING,
  308. and CUTTING, and PASTING, which explain the terminology of selections, i.e.
  309. what is meant by primary, secondary, rectangular, etc.
  310.  
  311. The general meaning of mouse buttons and modifier keys is as follows:
  312.  
  313.     Buttons
  314.  
  315.       Button 1 (left)    Cursor position and primary selection
  316.  
  317.       Button 2 (middle)  Secondary selections, and dragging and
  318.                      copying primary selection
  319.   
  320.       Button 3 (right)   Quick-access programmable menu and pan
  321.                          scrolling
  322.  
  323.     Modifier keys
  324.  
  325.       Shift   On primary selections, (left mouse button):
  326.              Extends selection to the mouse pointer
  327.               On secondary and copy operations, (middle):
  328.              Toggles between move and copy
  329.  
  330.       Ctrl    Makes selection rectangular or insertion
  331.               columnar
  332.  
  333.       Alt*    (on release) Exchange primary and secondary
  334.               selections.
  335.  
  336.  
  337. Left Mouse Button
  338.  
  339.     The left mouse button is used to position the cursor and to make primary
  340.     selections.
  341.  
  342.       Click             Moves the cursor
  343.  
  344.       Double Click    Selects a whole word
  345.  
  346.       Triple Click    Selects a whole line
  347.  
  348.       Quadruple Click    Selects the whole file
  349.  
  350.       Shift Click    Adjusts (extends or shrinks) the selection,
  351.                           or if there is no existing selection, begins a
  352.                           new selection between the cursor and the mouse.
  353.  
  354.       Ctrl+Shift+Click    Adjusts (extends or shrinks) the selection
  355.                        rectangularly.
  356.  
  357.       Drag        Selects text between where the mouse was pressed
  358.                           and where it was released.
  359.  
  360.       Ctrl+Drag         Selects rectangle between where the mouse was
  361.                           pressed and where it was released.
  362.  
  363.  
  364. Right Mouse Button
  365.  
  366.     The right mouse button posts a programmable menu for frequently used
  367.     commands.
  368.  
  369.       Click/Drag    Pops up the background menu (programmed from
  370.              Preferences -> Default Settings -> Customize
  371.              Menus -> Window Background).
  372.  
  373.       Ctrl+Drag     Pan scrolling.  Scrolls the window both
  374.              vertically and horizontally, as if you had
  375.              grabbed it with your mouse.
  376.  
  377.  
  378. Middle Mouse Button
  379.  
  380.    The middle mouse button is for making secondary selections, and copying
  381.    and dragging the primary selection
  382.  
  383.       Click       Copies the primary selection to the clicked position.
  384.  
  385.       Shift+Click  Moves the primary selection to the clicked position,
  386.             deleting it from its original position.
  387.  
  388.       Drag       1) Outside of the primary selection:
  389.                   Begins a secondary selection.
  390.             2) Inside of the primary selection:
  391.                   Moves the entire selection by dragging.
  392.  
  393.       Ctrl+Drag    1) Outside of the primary selection:
  394.                   Begins a rectangular secondary selection.
  395.             2) Inside of the primary selection:
  396.                   Drags the selection in overlay mode (see below).
  397.  
  398. When the mouse button is released after creating a secondary selection:
  399.  
  400.    No Modifiers  If there is a primary selection, replaces it with the
  401.             secondary selection.  Otherwise, inserts the secondary
  402.             selection at the cursor position.
  403.  
  404.    Shift     Move the secondary selection, deleting it from its
  405.             original position.  If there is a primary selection,
  406.             the move will replace the primary selection with the
  407.             secondary selection. Otherwise, moves the secondary
  408.             selection to to the cursor position.
  409.  
  410.    Alt*      Exchange the primary and secondary selections.
  411.  
  412.  
  413. While moving the primary selection by dragging with the middle mouse button:
  414.  
  415.    Shift   Leaves a copy of the original selection in place rather than
  416.           removing it or blanking the area.
  417.  
  418.    Ctrl    Changes from insert mode to overlay mode (see below).
  419.  
  420.    Escape  Cancels drag in progress.
  421.  
  422. Overlay Mode: Normally, dragging moves text by removing it from the selected
  423. position at the start of the drag, and inserting it at a new position relative
  424. to to the mouse.  When you drag a block of text over existing characters, the
  425. existing characters are displaced to the end of the selection.  In overlay
  426. mode, characters which are occluded by blocks of text being dragged are simply
  427. removed.  When dragging non-rectangular selections, overlay mode also converts
  428. the selection to rectangular form, allowing it to be dragged outside of the
  429. bounds of the existing text. 
  430.  
  431. * The Alt key may be labeled Meta or Compose-Character on some keyboards.  Some
  432. window managers, including default configurations of mwm, bind combinations of
  433. the Alt key and mouse buttons to window manager operations.  In NEdit, Alt is
  434. only used on button release, so regardless of the window manager bindings for
  435. Alt-modified mouse buttons, you can still do the corresponding NEdit operation
  436. by using the Alt key AFTER the initial mouse press, so that Alt is held while
  437. you release the mouse button.  If you find this difficult or annoying, you can
  438. re-configure most window managers to skip this binding, or you can re-configure
  439. NEdit to use a different key combination.
  440.  
  441.  
  442. KEYBOARD SHORTCUTS
  443.  
  444. Most of the keyboard shortcuts in NEdit are shown on the right hand sides of
  445. the pull-down menus.  However, there are more which are not as obvious.  These
  446. include; dialog button shortcuts; menu and dialog mnemonics; labeled keyboard
  447. keys, such as the arrows, page-up, page-down, and home; and optional Shift
  448. modifiers on accelerator keys, like [Shift]Ctrl+F.
  449.  
  450. Menu Accelerators
  451.  
  452. Pressing the key combinations shown on the right of the menu items is a
  453. shortcut for selecting the menu item with the mouse.  Some items have the shift
  454. key enclosed in brackets, such as [Shift]Ctrl+F.  This indicates that the shift
  455. key is optional.  In search commands, including the shift key reverses the
  456. direction of the search.  In Shift commands, it makes the command shift the
  457. selected text by a whole tab stop rather than by single characters.
  458.  
  459. Menu Mnemonics
  460.  
  461. Pressing the Alt key in combination with one of the underlined characters in
  462. the menu bar pulls down that menu.  Once the menu is pulled down, typing the
  463. underlined characters in a menu item (without the Alt key) activates that
  464. item.  With a menu pulled down, you can also use the arrow keys to select menu
  465. items, and the space or enter keys to activate them.
  466.  
  467. Keyboard Shortcuts within Dialogs
  468.  
  469. One button in a dialog is usually marked with a thick indented outline. 
  470. Pressing the Return or Enter key activates this button.
  471.  
  472. All dialogs have either a Cancel or Dismiss button.  This button can be
  473. activated by pressing the Escape (or Esc) key.
  474.  
  475. Pressing the tab key moves the keyboard focus to the next item in a dialog. 
  476. Within an associated group of buttons, the arrow keys move the focus among the
  477. buttons.  Shift+Tab moves backward through the items.
  478.  
  479. Most items in dialogs have an underline under one character in their name. 
  480. Pressing the Alt key along with this character, activates a button as if you
  481. had pressed it with the mouse, or moves the keyboard focus to the associated
  482. text field or list.
  483.  
  484. You can select items from a list by using the arrow keys to move the selection
  485. and space to select.
  486.  
  487. In file selection dialogs, you can type the beginning characters of the file
  488. name or directory in the list to select files
  489.  
  490. Labeled Function Keys 
  491.  
  492. The labeled function keys on standard workstation and PC keyboards, like the
  493. arrows, and page-up and page-down, are active in NEdit, though not shown in the
  494. pull-down menus. 
  495.  
  496. Holding down the control key while pressing a named key extends the scope of
  497. the action that it performs.  For example, Home normally moves the insert
  498. cursor the beginning of a line.  Ctrl+Home moves it to the beginning of the
  499. file. Backspace deletes one character, Ctrl+Backspace deletes one word. 
  500.  
  501. Holding down the shift key while pressing a named key begins or extends a
  502. selection.  Combining the shift and control keys combines their actions.  For
  503. example, to select a word without using the mouse, position the cursor at the
  504. beginning of the word and press Ctrl+Shift+RightArrow.  The Alt key modifies
  505. selection commands to make the selection rectangular. 
  506.  
  507. Under X and Motif, there are several levels of translation between keyboard
  508. keys and the actions they perform in a program.  The "KEY BINDING", and "X
  509. RESOURCES" sections below have more information on this subject.  Because of
  510. all of this configurability, and since keyboards and standards for the meaning
  511. of some keys vary from machine to machine, the mappings may be changed from the
  512. defaults listed below.
  513.  
  514. Modifier Keys (in general)
  515.  
  516.   Ctrl     Extends the scope of the action that the key would otherwise
  517.       perform.  For example, Home normally moves the insert cursor the
  518.       beginning of a line. Ctrl+Home moves it to the beginning of the
  519.       file.  Backspace deletes one character, Ctrl+ Backspace deletes
  520.       one word.
  521.  
  522.   Shift  Extends the selection to the cursor position. If there's no
  523.       selection, begins one between the old and new cursor positions.
  524.  
  525.   Alt     When modifying a selection, makes the selection rectangular.
  526.  
  527. (For the effects of modifier keys on mouse button presses, see the section
  528. titled "Using the Mouse")
  529.  
  530. All Keyboards
  531.  
  532.   Escape    Cancels operation in progress: menu selection, drag,
  533.           selection, etc.  Also equivalent to cancel button in
  534.           dialogs.
  535.  
  536.   Backspace    Delete the character before the cursor
  537.  
  538.   Ctrl+BS    Delete the word before the cursor
  539.  
  540.   Arrows
  541.  
  542.     Left    Move the cursor to the left one character
  543.  
  544.     Ctrl+Left   Move the cursor backward one word (Word delimiters
  545.             are settable, see CUSTOMIZATION)
  546.  
  547.     Right    Move the cursor to the right one character
  548.  
  549.     Ctrl+Right  Move the cursor forward one word
  550.  
  551.     Up      Move the cursor up one line
  552.  
  553.     Ctrl+Up    Move the cursor up one paragraph.  (Paragraphs are
  554.                 delimited by blank lines.)
  555.  
  556.     Down    Move the cursor down one line.
  557.  
  558.     Ctrl+Down    Move the cursor down one paragraph.
  559.  
  560.   Ctrl+Return    Return with automatic indent, regardless of the setting
  561.                 of Auto Indent.
  562.  
  563.   Shift+Return    Return without automatic indent, regardless of the
  564.           setting of Auto Indent.
  565.  
  566.   Ctrl+Tab    Insert an ascii tab character, without processing
  567.           emulated tabs.
  568.  
  569.   Alt+Ctrl+<c>    Insert the control-code equivalent of a key <c>
  570.  
  571.   Ctrl+/    Select everything (same as Select All menu item or ^A)
  572.  
  573.   Ctrl+\    Unselect
  574.  
  575.   Ctrl+U    Delete to start of line
  576.  
  577. PC Standard Keyboard
  578.  
  579.   Ctrl+Insert    Copy the primary selection to the clipboard (same as
  580.          Copy menu item or ^C) for compatibility with Motif
  581.          standard key binding
  582.  
  583.   Shift+Ctrl+
  584.   Insert    Copy the primary selection to the cursor location.
  585.  
  586.   Delete    Delete the character before the cursor. (Can be
  587.          configured to delete the character after the cursor,
  588.          see CUSTOMIZATION, and X RESOURCES)
  589.  
  590.  
  591.   Ctrl+Delete    Delete to end of line.
  592.  
  593.   Shift+Delete    Cut, remove the currently selected text and place it
  594.          in the clipboard. (same as Cut menu item or ^X) for
  595.          compatibility with Motif standard key binding.
  596.  
  597.   Shift+Ctrl+
  598.   Delete    Cut the primary selection to the cursor location.
  599.  
  600.   Home        Move the cursor to the beginning of the line.
  601.  
  602.   Ctrl+Home    Move the cursor to the beginning of the file.
  603.  
  604.   End        Move the cursor to the end of the line.
  605.  
  606.   Ctrl+End    Move the cursor to the end of the file.
  607.  
  608.   PageUp    Scroll and move the cursor up by one page.
  609.  
  610.   Ctrl+PageUp   Scroll and move the cursor left by one page.
  611.   
  612.   PageDown    Scroll and move the cursor down by one page.
  613.  
  614.   Ctrl+PageDown Scroll and move the cursor right by one page.
  615.  
  616.   F10        Make the menu bar active for keyboard input (Arrow
  617.           Keys, Return, Escape, and the Space Bar)
  618.  
  619.  
  620. Specialty Keyboards 
  621.  
  622. On machines with different styles of keyboards, generally, text editing actions
  623. are properly matched to the labeled keys, such as Remove, Next-screen, etc.. 
  624. If you prefer different key bindings, see the heading titled "Binding Keys to
  625. Actions" in the X RESOURCES section below.
  626.  
  627.  
  628. TEXT FILLING
  629.  
  630. Text filling using the Fill Paragraph command in the Edit menu is one of the
  631. most important concepts in NEdit.  And it will be well worth your while to
  632. understand how to use it properly.
  633.  
  634. In plain text files, unlike word-processor files, there is no way to tell which
  635. lines are continuations of other lines, and which lines are meant to be
  636. separate, because there is no distinction in meaning between newline characters
  637. which separate lines in a paragraph, and ones which separate paragraphs from
  638. other text.  This makes it impossible for a text editor like NEdit to tell
  639. parts of the text which belong together as a paragraph from carefully arranged
  640. individual lines.
  641.  
  642. In continuous wrap mode, lines automatically wrap and unwrap themselves to
  643. line up properly at the right margin.  In this mode, you simply omit the
  644. newlines within paragraphs and let NEdit make the line breaks as needed. 
  645. Unfortunately, continuous wrap mode is not appropriate in the majority of
  646. situations, because files with extremely long lines are not common under Unix
  647. and may not be compatible with all tools, and because you can't achieve
  648. effects like indented sections, columns, or program comments, and still take
  649. advantage of the automatic wrapping.
  650.  
  651. Without continuous wrapping, paragraph filling is not entirely automatic. 
  652. Auto-Newline wrapping keeps paragraphs lined up as you type, but once entered,
  653. NEdit can no longer distinguish newlines which join wrapped text, and newlines
  654. which must be preserved.  Therefore, editing in the middle of a paragraph will
  655. often leave the right margin messy and uneven.
  656.  
  657. Since NEdit can't act automatically to keep your text lined up, you need to
  658. tell it explicitly where to operate, and that is what Fill Paragraph is for. 
  659. It arranges lines to fill the space between two margins, wrapping the lines
  660. neatly at word boundaries.  Normally, the left margin for filling is inferred
  661. from the text being filled.  The first line of each paragraph is considered
  662. special, and its left indentation is maintained separately from the remaining
  663. lines (for leading indents, bullet points, numbered paragraphs, etc.). 
  664. Otherwise, the left margin is determined by the furthest left non-whitespace
  665. character.  The right margin is either the Wrap Margin, set in the preferences
  666. menu (by default, the right edge of the window), or can also be chosen on the
  667. fly by using a rectangular selection (see below).
  668.  
  669. There are three ways to use Fill Paragraph.  The simplest is, while you are
  670. typing text, and there is no selection, simply select Fill Paragraph (or type
  671. Ctrl+J), and NEdit will arrange the text in the paragraph adjacent to the
  672. cursor.  A paragraph, in this case, means an area of text delimited by blank
  673. lines.
  674.  
  675. The second way to use Fill Paragraph is with a selection.  If you select a
  676. range of text and then chose Fill Paragraph, all of the text in the selection
  677. will be filled.  Again, continuous text between blank lines is interpreted as
  678. paragraphs and filled individually, respecting leading indents and blank lines.
  679.  
  680. The third, and most versitile, way to use Fill Paragraph is with a rectangular
  681. selection.  Fill Paragraph treats rectangular selections differently from other
  682. commands.  Instead of simply filling the text inside the rectangular selection,
  683. NEdit interprets the right edge of the selection as the requested wrap margin. 
  684. Text to the left of the selection is not disturbed (the usual interpretation of
  685. a rectangular selection), but text to the right of the selection is included in
  686. the operation and is pulled in to the selected region.  This method enables you
  687. to fill text to an arbitrary right margin, without going back and forth to the
  688. wrap-margin dialog, as well as to exclude text to the left of the selection
  689. such as comment bars or other text columns.
  690.  
  691. SHIFT LEFT, SHIFT RIGHT
  692.  
  693. While shifting blocks of text is most important for programmers (See FEATURES
  694. FOR PROGRAMMING), it is also useful for other tasks, such as creating indented
  695. paragraphs. 
  696.  
  697. To shift a block of text one tab stop to the right, select the text, then
  698. choose Shift Right from the Edit menu.  Note that the accelerator keys for
  699. these menu items are Ctrl+9 and Ctrl+0, which correspond to the right and left
  700. parenthesis on most keyboards.  Remember them as adjusting the text in the
  701. direction pointed to by the parenthesis character.  Holding the Shift key while
  702. selecting either Shift Left or Shift Right will shift the text by one character.
  703.  
  704. It is also possible to shift blocks of text by selecting the text
  705. rectangularly, and dragging it left or right (and up or down as well).  Using
  706. a rectangular selection also causes tabs within the selection to be
  707. recalculated and substituted, such that the non-whitespace characters remain
  708. stationary with respect to the selection.
  709.  
  710.  
  711. FEATURES FOR PROGRAMMERS
  712.  
  713. Though general in appearance, NEdit has many features intended specifically
  714. for programmers.  Programming-related topics are listed here, and in the next
  715. four sections: TABS AND TAB EMULATION, AUTOMATIC INDENT, SYNTAX HIGHLIGHTING,
  716. and FINDING SUBROUTINE AND DATA DECLARATIONS (CTAGS).
  717.  
  718. Language Modes
  719.  
  720. When nedit initially reads a file, it attempts to determine whether the file is
  721. in one of the computer languages that it knows about.  Knowing what language a
  722. file is written in allows NEdit to assign highlight patterns and smart indent
  723. macros, and to set language specific preferences like word delimiters, tab
  724. emulation, and auto-indent.  Language mode can be recognized from both the file
  725. name and from the first 200 characters of content.  Language mode recognition
  726. and language-specific preferences are configured in: Preferences -> Default
  727. Settings -> Language Modes....
  728.  
  729. You can set the language mode manually for a window, by selecting it from the
  730. menu: Preferences -> Language Modes.
  731.  
  732. Line Numbers
  733.  
  734. To find a particular line in a source file by line number, choose Goto Line
  735. #... from the Search menu.  You can also directly select the line number text
  736. in the compiler message in the terminal emulator window (xterm, decterm,
  737. winterm, etc.) where you ran the compiler, and choose Goto Selected from the
  738. Search menu.
  739.  
  740. To find out the line number of a particular line in your file, turn on
  741. Statistics Line in the Preferences menu and position the insertion point
  742. anywhere on the line.  The statistics line continuously updates the line number
  743. of the line containing the cursor.
  744.  
  745. Matching Parentheses
  746.  
  747. To help you inspect nested parentheses, brackets, braces, quotes, and other
  748. characters, NEdit has both an automatic parenthesis matching mode, and a Find
  749. Matching command.  Automatic parenthesis matching is activated when you type,
  750. or move the insertion cursor after a parenthesis, bracket, or brace.  It
  751. momentarily highlights the matching character if that character is visible in
  752. the window.  To find a matching character anywhere in the file, select it or
  753. position the cursor after it, and choose Find Matching from the Search menu. 
  754. If the character matches itself, such as a quote or slash, select the first
  755. character of the pair.  NEdit will match {, (, [, <, ", ', `, /, and \.
  756.  
  757. Opening Included Files
  758.  
  759. The Open Selected command in the File menu understands the C preprocessor's
  760. #include syntax, so selecting an #include line and invoking Open Selected will
  761. generally find the file referred to, unless doing so depends on the settings of
  762. compiler switches or other information not available to NEdit.
  763.  
  764. Interface to Programming Tools
  765.  
  766. Integrated software development environments such as SGI's CaseVision and
  767. Centerline Software's Code Center, can be interfaced directly with NEdit via
  768. the client server interface.  These tools allow you to click directly on
  769. compiler and runtime error messages and request NEdit to open files, and select
  770. lines of interest.  The easiest method is usually to use the tool's interface
  771. for character-based editors like vi, to invoke nc, but programatic interfaces
  772. can also be derived using the source code for nc.
  773.  
  774. There are also some simple compile/review, grep, ctree, and ctags browsers
  775. available in the NEdit contrib directory on ftp.fnal.gov.
  776.  
  777.  
  778. TABS AND TAB EMULATION
  779.  
  780. Tabs are important for programming in languages which use indentation to show
  781. nesting, as short-hand for producing white-space for leading indents.  As a
  782. programmer, you have to decide how to use indentation, and how or whether tab
  783. characters map to your indentation scheme.
  784.  
  785. Ideally, tab characters map directly to the amount of indent that you use to
  786. distinguish nesting levels in your code.  Unfortunately, the Unix standard for
  787. interpretation of tab characters is eight characters (probably dating back to
  788. mechanical capabilities of the original teletype), which is usually too coarse
  789. for a single indent.
  790.  
  791. Most text editors, NEdit included, allow you to change the interpretation of
  792. the tab character, and many programmers take advantage of this, and set their
  793. tabs to 3 or 4 characters to match their programming style.  In NEdit you set
  794. the hardware tab distance in Preferences -> Tabs... for the current window, or
  795. Preferences -> Default Settings -> Tabs... (general), or Preferences -> Default
  796. Settings -> Language Modes... (language-specific) to change the defaults for
  797. future windows.
  798.  
  799. Changing the meaning of the tab character makes programming much easier while
  800. you're in the editor, but can cause you headaches outside of the editor,
  801. because there is no way to pass along the tab setting as part of a plain-text
  802. file.  All of the other tools which display, print, and otherwise process your
  803. source code have to be made aware of how the tabs are set, and must be able to
  804. handle the change.  Non-standard tabs can also confuse other programmers, or
  805. make editing your code difficult for them if their text editors don't support
  806. changes in tab distance.
  807.  
  808. Emulated Tabs
  809.  
  810. An alternative to changing the interpretation of the tab character is tab
  811. emulation.  In the Tabs... dialog(s), turning on Emulated Tabs causes the Tab
  812. key to insert the correct number of spaces and/or tabs to bring the cursor the
  813. next emulated tab stop, as if tabs were set at the emulated tab distance rather
  814. than the hardware tab distance.  Backspacing immediately after entering an
  815. emulated tab will delete the fictitious tab as a unit, but as soon as you move
  816. the cursor away from the spot, NEdit will forget that the collection of spaces
  817. and tabs is a tab, and will treat it as separate characters.  To enter a real
  818. tab character with "Emulate Tabs" turned on, use Ctrl+Tab.
  819.  
  820. It is also possible to tell NEdit not to insert ANY tab characters at all in
  821. the course of processing emulated tabs, and in shifting and rectangular
  822. insertion/deletion operations, for programmers who worry about the
  823. misinterpretation of tab characters on other systems.
  824.  
  825.  
  826. AUTOMATIC INDENT
  827.  
  828. Programmers who use structured languages usually require some form of automatic
  829. indent, so that they don't have to continually re-type the sequences of tabs
  830. and/or spaces needed to maintain lengthy running indents.  Version 5.0 of NEdit
  831. is the first release of NEdit to offer "smart" indent, at least experimentally,
  832. in addition to the traditional automatic indent which simply lines up the
  833. cursor position with the previous line.
  834.  
  835. Smart Indent
  836.  
  837. Smart Indent in this release must still be considered somewhat experimental. 
  838. Smart indent macros are only available by default for C and C++, and while
  839. these can easily be configured for different default indentation distances,
  840. they may not conform to everyone's exact C programming style.  Smart indent is
  841. programmed in terms of macros in the NEdit macro language which can be entered
  842. in: Preferences -> Default Settings -> Indent -> Program Smart Indent.  Hooks
  843. are provided for intervening at the point that a newline is entered, either via
  844. the user pressing the Enter key, or through auto-wrapping; and for arbitrary
  845. type-in to act on specific characters typed.
  846.  
  847. To type a newline character without invoking smart-indent when operating in
  848. smart-indent mode, hold the Ctrl key while pressing the Return or Enter key.
  849.  
  850. Auto-Indent
  851.  
  852. With Indent set to Auto (the default), NEdit keeps a running indent.  When you
  853. press the Return or Enter key, spaces and tabs are inserted to line up the
  854. insert point under the start of the previous line.  Ctrl+Return in auto-indent
  855. mode acts like a normal return, With auto-indent turned off, Ctrl+Return does
  856. indentation.
  857.  
  858. Block Indentation Adjustment
  859.  
  860. The Shift Left and Shift Right commands as well as rectangular dragging can be
  861. used to adjust the indentation for several lines at once.  To shift a block of
  862. text one character to the right, select the text, then choose Shift Right from
  863. the Edit menu.  Note that the accelerator keys for these menu items are Ctrl+9
  864. and Ctrl+0, which correspond to  the right and left parenthesis on most
  865. keyboards.  Remember them as adjusting the text in the direction pointed to by
  866. the parenthesis character.  Holding the Shift key while selecting either Shift
  867. Left or Shift Right will shift the text by one tab stop (or by one emulated tab
  868. stop if tab emulation is turned on).  The help section: "SHIFT LEFT, SHIFT
  869. RIGHT" above has details.
  870.  
  871.  
  872. SYNTAX HIGHLIGHTING
  873.  
  874. Syntax Highlighting means using colors and fonts to help distinguish language
  875. elements in programming languages and other types of structured files. 
  876. Programmers use syntax highlighting to understand code faster and better, and
  877. to spot many kinds of syntax errors more quickly.
  878.  
  879. To use syntax highlighting in NEdit, select Highlight Syntax in the Preferences
  880. menu.  If NEdit recognizes the computer language that you are using, and
  881. highlighting rules (patterns) are available for that language, it will
  882. highlight your text, and maintain the highlighting, automatically, as you type.
  883.  
  884. If NEdit doesn't correctly recognize the type of the file you are editing, you
  885. can manually select a language mode from Language Modes in the Preferences
  886. menu.  You can also program the method that NEdit uses to recognize language
  887. modes in Preferences -> Default Settings -> Language Modes....
  888.  
  889. If no highlighting patterns are available for the language that you want to
  890. use, you can create new patterns relatively quickly.  The section below titled
  891. "WRITING SYNTAX HIGHLIGHTING PATTERNS", has details.
  892.  
  893. If you are satisfied with what NEdit is highlighting, but would like it to use
  894. different colors or fonts, you can change these by selecting Preferences ->
  895. Default Settings -> Syntax Highlighting -> Text Drawing Styles.  Highlighting
  896. patterns are connected with font and color information through a common set of
  897. styles so that colorings defined for one language will be similar across
  898. others, and patterns within the same language which are meant to appear
  899. identical can be changed in the same place.  To understand which styles are
  900. used to highlight the language you are interested in, you may need to look at
  901. "Patterns for Highlighting" section, as well.
  902.  
  903. Syntax highlighting is CPU intensive, and under some circumstances can affect
  904. NEdit's responsiveness.  If you have a particularly slow system, or work with
  905. very large files, you may not want to use it all of the time.  Syntax
  906. highlighting introduces two kinds of delays.  The first is an initial parsing
  907. delay, proportional to the size of the file.  This delay is also incurred when
  908. pasting large sections of text, filtering text through shell commands, and
  909. other circumstances involving changes to large amounts of text.  The second
  910. kind of delay happens when text which has not previously been visible is
  911. scrolled in to view.  Depending on your system, and the highlight patterns you
  912. are using, this may or may not be noticeable.  A typing delay is also possible,
  913. but unlikely if you are only using the built-in patterns.
  914.  
  915.  
  916. FINDING SUBROUTINE AND DATA DECLARATIONS (CTAGS)
  917.  
  918. NEdit can process tags files generated using the Unix ctags command.  Ctags
  919. creates index files correlating names of functions and declarations with their
  920. locations in C, Fortran, or Pascal source code files. (See the ctags manual
  921. page for more information).  Ctags produces a file called "tags" which can be
  922. loaded by NEdit.  Once loaded, the information in the tags file enables NEdit
  923. to go directly to the declaration of a highlighted function or data structure
  924. name with a single command.  To load a tags file, select "Load Tags File" from
  925. the File menu and choose a tags file to load, or specify the name of the tags
  926. file on the NEdit command line:
  927.  
  928.     nedit -tags tags
  929.  
  930. NEdit can also be set to load a tags file automatically when it starts up.
  931. Setting the X resource nedit.tagFile to the name of a tag file tells NEdit to
  932. look for that file at startup time (see X RESOURCES).  The file name can be
  933. either a complete path name, in which case NEdit will always load the same tags
  934. file, or a file name without a path or with a relative path, in which case
  935. NEdit will load it starting from the current directory.  The second option
  936. allows you to have different tags files for different projects, each
  937. automatically loaded depending on the directory you're in when you start
  938. NEdit.  Setting the name to "tags" is an obvious choice since this is the name
  939. that ctags uses.
  940.  
  941. To find the definition of a function or data structure once a tags file is
  942. loaded, select the name anywhere it appears in your program (see SELECTING,
  943. CUTTING, and PASTING) and choose "Find Definition" from the Search menu.
  944.  
  945.  
  946. SHELL COMMANDS AND FILTERS
  947.  
  948. The Shell menu (Unix versions only) allows you to execute Unix shell commands
  949. from within NEdit.  You can add items to the menu to extend NEdit's command set
  950. or to incorporate custom automatic editing features using shell commands or
  951. editing languages like awk and sed.  To add items to the menu, select
  952. Preferences -> Default Settings Customize Menus -> Shell Menu.  NEdit comes
  953. pre-configured with a few useful Unix commands like spell and sort, but we
  954. encourage you to add your own custom extensions.
  955.  
  956. Filter Selection... prompts you for a Unix command to use to process the
  957. currently selected text.  The output from this command replaces the contents of
  958. the selection.
  959.  
  960. Execute Command... prompts you for a Unix command and replaces the current
  961. selection with the output of the command.  If there is no selection, it
  962. deposits the output at the current insertion point.
  963.  
  964. Execute Command Line uses the position of the cursor in the window to indicate
  965. a line to execute as a shell command line.  The cursor may be positioned
  966. anywhere on the line.  This command allows you to use an NEdit window as an
  967. editable command window for saving output and saving commands for re-execution.
  968.  
  969. The X resource called nedit.shell (See X RESOURCES) determines which Unix
  970. shell is used to execute commands.  The default value for this resource is
  971. /bin/csh.
  972.  
  973.  
  974. LEARN/REPLAY
  975.  
  976. Selecting Learn Keystrokes from the Macro menu puts NEdit in learn mode.  In
  977. learn mode, keystrokes and menu commands are recorded, to be played back later,
  978. using the Replay Keystrokes command, or pasted into a macro in the Macro
  979. Commands dialog of the Default Settings menu in Preferences.
  980.  
  981. Note that only keyboard and menu commands are recorded, not mouse clicks or
  982. mouse movements since these have no absolute point of reference, such as cursor
  983. or selection position.  When you do a mouse-based operation in learn mode,
  984. NEdit will beep (repeatedly) to remind you that the operation was not recorded.
  985.  
  986. Learn mode is also the quickest and easiest method for writing macros.  The
  987. dialog for creating macro commands contains a button labeled "Paste Learn /
  988. Replay Macro", which will deposit the last sequence learned into the body of
  989. the macro.
  990.  
  991. Repeat
  992.  
  993. Individual actions or Learn/Replay sequences can be repeated any number of
  994. times by using the Repeat command in the Macro menu.  By default, Repeat
  995. repeats the last (keyboard-based) command entered.  For example, to move down
  996. 30 lines through a file, you could type: <Down Arrow> Ctrl+, 29 <Return>
  997.  
  998.  
  999. MACRO LANGUAGE
  1000.  
  1001. Macros can be called from Macro menu commands, window background menu commands,
  1002. within the smart-indent framework, and from the .neditmacro file.  Macro menu
  1003. and window background menu commands are defined under Preferences -> Default
  1004. Settings -> Customize Menus.  See the section below titled, "PREFERENCES," for
  1005. more information on creating items in these menus.  The .neditmacro file is a
  1006. file of macro commands and definitions which you can create in your home
  1007. directory, and which NEdit will automatically load when it is first started.
  1008.  
  1009. NEdit's macro language is a simple interpreter with integer arithmetic, dynamic
  1010. strings, and C-style looping constructs (very similar to the procedural portion
  1011. of the Unix awk program).  From the macro language, you can call the same
  1012. action routines which are bound to keyboard keys and menu items, as well
  1013. additional subroutines for accessing and manipulating editor data, which are
  1014. specific to the macro language (these are listed in the sections titled Macro
  1015. Subroutines, and Actions).
  1016.  
  1017. Syntax
  1018.  
  1019. An NEdit macro language program consists of a list of statements, each
  1020. terminated by a newline.  Groups of statements which are executed together
  1021. conditionally, such as the body of a loop, are surrounded by curly braces "{}".
  1022.  
  1023. Blank lines and comments are also allowed.  Comments begin with a "#" and end
  1024. with a newline, and can appear either on a line by themselves, or at the end of
  1025. a statement.
  1026.  
  1027. Statements which are too long to fit on a single line may be split across
  1028. several lines, by placing a backslash "\" character at the end of each line to
  1029. be continued.
  1030.  
  1031. Data Types
  1032.  
  1033. The NEdit macro language recognizes only two data types, dynamic character
  1034. strings, and integer values.  In general strings and integers can be used
  1035. interchangeably.  If a string represents an integer value, it can be used as an
  1036. integer.  Integers can be compared and concatenated with strings.
  1037.  
  1038. Integer Constants:
  1039. Integers are non-fractional numbers in the range of -2147483647 to 2147483647. 
  1040. Integer constants must be in decimal.  For example:
  1041.  
  1042.   a = -1
  1043.   b = 1000
  1044.  
  1045. Character String Constants:
  1046. Character string constants are enclosed in double quotes.  For example:
  1047.  
  1048.    a = "a string"
  1049.    dialog("Hi there!", "Dismiss")
  1050.  
  1051. Strings may also include C-language style escape sequences:
  1052.  
  1053.    \\ Backslash      \t Tab          \f Form feed
  1054.    \" Double quote   \b Backspace      \a Alert
  1055.    \n Newline         \r Carriage return   \v Vertical tab
  1056.  
  1057. For example, to send output to the terminal from which nedit was started, a
  1058. newline character is neccessary because, like printf, t_print requires explicit
  1059. newlines, and also buffers its output on a per-line basis:
  1060.  
  1061.    t_print("a = " a "\n")
  1062.  
  1063. Variables
  1064.  
  1065. Variable names must begin either with a letter (local variables), or a $
  1066. (global variables).  Beyond the first character, variables may also contain
  1067. numbers and underscores `_'.  Variables are called in to existence just by
  1068. setting them (no explicit declarations are necessary).
  1069.  
  1070. Local variables are limited in scope to the subroutine (or menu item
  1071. definition) in which they appear.  Global variables are accessible from all
  1072. routines, and their values persist beyond the call which created them, until
  1073. reset.
  1074.  
  1075. Built-in Variables:
  1076. NEdit has a number of permanently defined variables, which are used to access
  1077. global editor information and information about the the window in which the
  1078. macro is executing.  These are listed along with the built in functions in the
  1079. section titled Macro Subroutines.
  1080.  
  1081. Functions and Subroutines
  1082.  
  1083. The syntax of a function or subroutine call is:
  1084.  
  1085.    function_name(arg1, arg2, ...)
  1086.  
  1087. where arg1, arg2, etc. represent up to 9 argument values which are passed to
  1088. the routine being called.  A function or subroutine call can be on a line by
  1089. itself, as above, or if it returns a value, can be invoked within a character
  1090. or numeric expression:
  1091.  
  1092.    a = fn1(b, c) + fn2(d)
  1093.    dialog("fn3 says: " fn3())
  1094.  
  1095. Arguments are passed by value.  This means that you can not return values via
  1096. the argument list, only through the function value or indirectly through
  1097. agreed-upon global variables.
  1098.  
  1099. Built-in Functions:
  1100. NEdit has a wide range of built in functions which can be called from the macro
  1101. language.  These routines are divided into two classes, macro-language
  1102. functions, and editor action routines.  Editor action routines are more
  1103. flexible, in that they may be called either from the macro language, or bound
  1104. directly to keys via translation tables.  They are also limited, however, in
  1105. that they can not return values.  Macro language routines can return values,
  1106. but can not be bound to keys in translation tables.
  1107.  
  1108. Nearly all of the built-in subroutines operate on an implied window, which is
  1109. initially the window from which the macro was started.  To manipulate the
  1110. contents of other windows, use the focus_window subroutine to change the focus
  1111. to the ones you wish to modify.  focus_window can also be used to iterate over
  1112. all of the currently open windows, using the special keyword names, "last" and
  1113. "next".
  1114.  
  1115. For backwards compatibility, hyphenated action routine names are allowed, and
  1116. most of the existing action routines names which contain underscores have an
  1117. equivalent version containing hyphens ('-') instead of underscores.  Use of
  1118. these names is discouraged.  The macro parser resolves the ambiguity between
  1119. '-' as the subtraction/negation operator, and - as part of an action routine
  1120. name by assuming subtraction unless the symbol specifically matches an action
  1121. routine name.
  1122.  
  1123. User Defined Functions:
  1124. Users can define their own macro subroutines, using the define keyword:
  1125.  
  1126.    define subroutine_name {
  1127.       < body of subroutine >
  1128.    }
  1129.  
  1130. Macro definitions can not appear within other definitions, or within macro menu
  1131. item definitions (usually they are found in the .neditmacro file).
  1132.  
  1133. The arguments with which a user-defined subroutine or function was invoked, are
  1134. presented as $1, $2, ... , $9.  The number of arguments can be read from
  1135. $n_args.
  1136.  
  1137. Operators and Expressions
  1138.  
  1139. Operators have the same meaning and precedence that they do in C, except for ^,
  1140. which raises a number to a power (y^x means y to the x power), rather than
  1141. bitwise exclusive OR.  The table below lists operators in decreasing order of
  1142. precedence.
  1143.  
  1144.    Operators            Associativity
  1145.    ()
  1146.    ^                right to left
  1147.    - ! ++ --            (unary)
  1148.    * / %            left to right
  1149.    + -              left to right
  1150.    > >= < <= == !=        left to right
  1151.    &                left to right
  1152.    |                left to right
  1153.    &&                left to right
  1154.    ||                left to right
  1155.    (concatenation)        left to right
  1156.    = += -= *= /= %=, &= |=  right to left
  1157.  
  1158. The order in which operands are evaluated in an expression is undefined, except
  1159. for && and ||, which like C, evaluate operands left to right, but stop when
  1160. further evaluation would no longer change the result.
  1161.  
  1162. Numerical Operators:
  1163. The numeric operators supported by the NEdit macro language are listed below:
  1164.  
  1165.    + addition
  1166.    - subtraction or negation
  1167.    * multiplication
  1168.    / division
  1169.    % modulo
  1170.    ^ power
  1171.    & bitwise and
  1172.    | bitwise or
  1173.  
  1174. Increment (++) and decrement (--) operators can also be appended or prepended
  1175. to variables within an expression.  Prepended increment/decrement operators act
  1176. before the variable is evaulated.  Appended increment/decrement operators act
  1177. after the variable is evaluated.
  1178.  
  1179. Logical and Comparison Operators:
  1180. Logical operations produce a result of 0 (for false) or 1 (for true).  In a
  1181. logical operation, any non-zero value is recognized to mean true.  The logical
  1182. and comparison operators allowed in the NEdit macro language are listed below:
  1183.  
  1184.    && logical and
  1185.    || logical or
  1186.    !  not
  1187.    >  greater
  1188.    <  less
  1189.    >= greater or equal
  1190.    <= less or equal
  1191.    == equal (integers and/or strings)
  1192.    != not equal (integers and/or strings)
  1193.  
  1194. Character String Operators:
  1195. The "operator" for concatenating two strings is the absence of an operator. 
  1196. Adjoining character strings with no operator in between means concatenation:
  1197.  
  1198.    d = a b "string" c
  1199.    t_print("the value of a is: " a)
  1200.  
  1201. Comparison between character strings is done with the == and != operators, (as
  1202. with integers).  There are a number of useful built-in routines for working
  1203. with character strings, which are listed in the section called Macro
  1204. Subroutines.
  1205.  
  1206. Looping and Conditionals
  1207.  
  1208. NEdit supports looping constructs: for and while, and conditional statements:
  1209. if and else, with essentially the same syntax as C:
  1210.  
  1211.    for (<init>, ...; <condition>; <increment>, ...) <body>
  1212.  
  1213.    while (<condition>) <body>
  1214.  
  1215.    if (<condition>) <body>
  1216.  
  1217.    if (<condition>) <body> else <body>
  1218.  
  1219. <body>, as in C, can be a single statement, or a list of statements enclosed in
  1220. curly braces ({}).  <condition> is an expression which must evaluate to true
  1221. for the statements in <body> to be executed.  for loops may also contain
  1222. initialization statements, <init>, executed once at the beginning of the loop,
  1223. and increment/decrement statements (or any arbitrary statement), which are
  1224. executed at the end of the loop, before the condition is evaluated again.
  1225.  
  1226. Examples:
  1227.  
  1228.   for (i=0; i<100; i++)
  1229.      j = i * 2
  1230.  
  1231.   for (i=0, j=20; i<20; i++, j--) {
  1232.      k = i * j
  1233.      t_print(i, j, k)
  1234.   }
  1235.  
  1236.   while (k > 0)
  1237.   {
  1238.      k = k - 1
  1239.      t_print(k)
  1240.   }
  1241.  
  1242.   for (;;) {
  1243.      if (i-- < 1)
  1244.          break
  1245.   }
  1246.  
  1247. Loops may contain break and continue statements.  A break statement causes an
  1248. exit from the innermost loop, a continue statement transfers control to the end
  1249. of the loop.
  1250.  
  1251.  
  1252. BUILT IN VARIABLES
  1253.  
  1254.    $cursor -- Position of the cursor in the current window
  1255.  
  1256.    $file_name -- Name of the file being edited in the current window, stripped
  1257.       of directory component.
  1258.  
  1259.    $file_path -- Directory component of file being edited in the current
  1260.       window.
  1261.  
  1262.    $language_mode -- Name of language mode set in the current window.
  1263.  
  1264.    $selection_start, $selection_end -- Beginning and ending positions of the
  1265.       primary selection in the current window, or -1 if there is no text
  1266.       selected in the current window.
  1267.  
  1268.    $selection_left, $selection_right -- Left and right character offsets of
  1269.       the rectangular (primary) selection in the current window, or -1 if
  1270.       there is no selection or it is not rectangular.
  1271.  
  1272.    $tab_dist -- The distance between tab stops for a hardware tab character,
  1273.       as set in the Tabs... dialog of the Preferences menu.
  1274.  
  1275.    $text_length -- The length of the text in the current window.
  1276.  
  1277.    $use_tabs -- Whether the user is allowing the NEdit to insert tab
  1278.       characters to maintain spacing in tab emulation and rectangular dragging
  1279.       operations. (The setting of the "Use tab characters in padding and
  1280.       emulated tabs" button in the Tabs... dialog of the Preferences menu.)
  1281.  
  1282.    $wrap_margin -- The right margin in the current window for text wrapping
  1283.       and filling.
  1284.  
  1285.  
  1286. BUILT-IN SUBROUTINES
  1287.  
  1288.    append_file(string, filename) -- Appends a string to a named file.  Returns
  1289.       1 on successful write, or 0 if unsuccessful.
  1290.  
  1291.    beep() -- Ring the bell
  1292.  
  1293.    dialog(message, btn_1_label, btn_2_label, ...) -- Pop up a dialog for
  1294.       querying and presenting information to the user.  First argument is a
  1295.       string to show in the message area of the dialog.  Up to nine additional
  1296.       optional arguments represent labels for buttons to appear along the
  1297.       bottom of the dialog.  Returns the number of the button pressed (the
  1298.       first button is number 1), or 0 if the user closed the dialog via the
  1299.       window close box.
  1300.  
  1301.    focus_window(window_name) -- Sets the window on which subsequent macro
  1302.       commands operate.  window_name can be either a fully qualified file name,
  1303.       or one of "last" for the last window created, or "next" for the next
  1304.       window in the chain from the currently focused window (the first window
  1305.       being the one returned from calling focus_window("last").  Returns the
  1306.       name of the newly-focused window, or an empty string if the requested
  1307.       window was not found.
  1308.  
  1309.    get_character(position) -- Returns the single character at the position
  1310.       indicated by the first argument to the routine from the current window.
  1311.  
  1312.    get_range(start, end) -- Returns the text between a starting and ending
  1313.       position from the current window.
  1314.  
  1315.    get_selection() -- Returns a string containing the text currently selected
  1316.       by the primary selection either from the current window (no keyword), or
  1317.       from anywhere on the screen (keyword "any").
  1318.  
  1319.    length(string) -- Returns the length of a string
  1320.  
  1321.    max(n1, n2, ...) -- Returns the maximum value of all of its arguments
  1322.  
  1323.    min(n1, n2, ...) -- Returns the minimum value of all of its arguments
  1324.  
  1325.    read_file(filename) -- Reads the contents of a text file into a string.  On
  1326.       success, returns 1 in $read_status, and the contents of the file as a
  1327.       string in the subroutine return value.  On failure, returns the empty
  1328.       string "" and an 0 $read_status.
  1329.  
  1330.    replace_in_string(string, search_for, replace_with, [type]) -- Replaces all
  1331.       occurrences of a search string in a string with a replacement string. 
  1332.       Arguments are 1: string to search in, 2: string to search for, 3:
  1333.       replacement string.  Argument 4 is an optional search type, one of
  1334.       "literal", "case" or "regex".  The default search type is "literal". 
  1335.       Returns a new string with all of the replacements done, or an empty
  1336.       string ("") if no occurrences were found.
  1337.  
  1338.    replace_range(start, end, string) -- Replaces all of the text in the current
  1339.       window between two positions.
  1340.  
  1341.    replace_selection(string) -- Replaces the primary-selection selected text in
  1342.       the current window.
  1343.  
  1344.    replace_substring(string, start, end, replace_with) -- Replacing a substring
  1345.       between two positions in a string within another string.
  1346.  
  1347.    search(search_for, start, [search_type, wrap, direction]) -- Searches
  1348.       silently in a window without dialogs, beeps, or changes to the
  1349.       selection.  Arguments are: 1: string to search for, 2: starting position.
  1350.       Optional arguments may include the strings: "wrap" to make the search
  1351.       wrap around the beginning or end of the string, "backward" or "forward"
  1352.       to change the search direction ("forward" is the default), "literal",
  1353.       "case" or "regex" to change the search type (default is "literal").
  1354.       Returns the starting position of the match, or -1 if nothing matched.
  1355.       also returns the ending position of the match in search_end
  1356.  
  1357.    search_string(string, search_for, start, [search_type, direction]) --
  1358.       Built-in macro subroutine for searching a string.  Arguments are 1:
  1359.       string to search in, 2: string to search for, 3: starting position.
  1360.       Optional arguments may include the strings: "wrap" to make the search
  1361.       wrap around the beginning or end of the string, "backward" or "forward"
  1362.       to change the search direction ("forward" is the default), "literal",
  1363.       "case" or "regex" to change the search type (default is "literal").
  1364.       Returns the starting position of the match, or -1 if nothing matched.
  1365.       Also returns the ending position of the match in $search_end
  1366.  
  1367.    select(start, end) -- Selects (with the primary selection) text in the
  1368.       current buffer between a starting and ending position.
  1369.  
  1370.    select_rectangle(start, end, left, right) -- Selects a rectangular area of
  1371.       text between a starting and ending position, and confined horizontally to
  1372.       characters displayed between positions "left", and "right".
  1373.  
  1374.    set_cursor_pos() -- Set the cursor position for the current window.
  1375.  
  1376.    shell_command(command, input_string) -- executes a shell command, feeding it
  1377.       input from input_string.  On completion, output from the command is
  1378.       returned as the function value, and the command's exit status is returned
  1379.       in the global variable $shell_cmd_status.
  1380.  
  1381.    string_dialog(message, btn_1_label, btn_2_label, ...) -- Pop up a dialog for
  1382.       prompting the user to enter information.  The first argument is a string
  1383.       to show in the message area of the dialog.  Up to nine additional
  1384.       optional arguments represent labels for buttons to appear along the
  1385.       bottom of the dialog.  Returns the string entered by the user as the
  1386.       function value, and number of the button pressed (the first button is
  1387.       number 1), in $string_dialog_button.  If the user closes the dialog via
  1388.       the window close box, the function returns the empty string, and
  1389.       $string_dialog_button returns 0.
  1390.  
  1391.    substring(string, start, end) -- Returns the portion of a string between a
  1392.       starting and ending position.
  1393.  
  1394.    t_print(string1, string2, ...) -- Writes strings to the terminal (stdout)
  1395.       from which NEdit was started.
  1396.  
  1397.    write_file(string, filename) -- Writes a string (parameter 1) to a file
  1398.       named in parameter 2.  Returns 1 on successful write, or 0 if
  1399.       unsuccessful.
  1400.  
  1401.  
  1402. ACTION ROUTINES
  1403.  
  1404. All of the editing capabilities of NEdit are represented as a special type of
  1405. subroutine, called an action routine, which can be invoked from both macros and
  1406. translation table entries (see KEY BINDING below).
  1407.  
  1408.  
  1409. Actions Representing Menu Commands:
  1410.  
  1411.     File Menu              Search Menu
  1412.     ---------------------     -----------------------
  1413.     new()              find()
  1414.     open()              find_dialog()
  1415.     open_dialog()          find_again()
  1416.     open_selected()          find_selection()
  1417.     close()              replace()
  1418.     save()              replace_dialog()
  1419.     save_as()              replace_all()
  1420.     save_as_dialog()          replace_in_selection()
  1421.     revert_to_saved()          replace_again()
  1422.     include_file()          goto_line_number()
  1423.     include_file_dialog ()    goto_line_number_dialog()
  1424.     load_tags_file()          goto_selected()
  1425.     load_tags_file_dialog()   mark()
  1426.     load_macro_file()         mark_dialog()
  1427.     load-macro-file-dialog()  goto_mark()
  1428.     print()              goto_mark_dialog()
  1429.     print_selection()          match()
  1430.     exit()                   find_definition()
  1431.                       split_window()
  1432.                       close_pane()
  1433.     Edit Menu              
  1434.     ---------------------     Shell Menu
  1435.     undo()              -----------------------
  1436.     redo()              filter_selection_dialog()
  1437.     delete()              filter_selection()
  1438.     select_all()          execute_command()
  1439.     shift_left()          execute_command_dialog()
  1440.     shift_left_by_tab()       execute_command_line()
  1441.     shift_right()          shell_menu_command()
  1442.     shift_right_by_tab()      
  1443.     uppercase()           Macro Menu
  1444.     lowercase()           -----------------------
  1445.     fill_paragraph()          macro_menu_command()
  1446.     control_code_dialog()     repeat_macro()
  1447.                       repeat_dialog()
  1448.  
  1449. The actions representing menu commands are named the same as the menu item with
  1450. punctuation removed, all lower case, and underscores replacing spaces.  Without
  1451. the _dialog suffix, commands which normally prompt the user for information,
  1452. instead take the information from the routine's arguments (see below).  To
  1453. present a dialog and ask the user for input, rather than supplying it in via
  1454. arguments, use the actions with the _dialog suffix.
  1455.  
  1456. Menu Action Routine Arguments:
  1457.  
  1458. Arguments are text strings enclosed in quotes.  Below are the menu action
  1459. routines which take arguments.  Optional arguments are inclosed in [].
  1460.  
  1461.   open(filename)
  1462.  
  1463.   save_as(filename)
  1464.  
  1465.   include(filename)
  1466.  
  1467.   load_tags_file(filename)
  1468.  
  1469.   find_dialog([search_direction])
  1470.  
  1471.   find(search_string [, search-direction], [search-type])
  1472.  
  1473.   find_again([search-direction])
  1474.  
  1475.   find_selection([search-direction])
  1476.  
  1477.   replace_dialog([search-direction])
  1478.  
  1479.   replace(search-string, replace-string,
  1480.       [, search-direction] [, search-type])
  1481.  
  1482.   replace_in_selection(search-string, replace-string
  1483.       [, search-type])
  1484.  
  1485.   replace_again([search-direction])
  1486.  
  1487.   goto_line_number([line-number])
  1488.  
  1489.   mark(mark-letter)
  1490.  
  1491.   goto_mark(mark-letter)
  1492.  
  1493.   filter_selection(shell-command)
  1494.  
  1495.   execute_command(shell-command)
  1496.  
  1497.   shell_menu_command(shell-menu-item-name)
  1498.  
  1499.   macro_menu_command(macro-menu-item-name)
  1500.  
  1501. Some notes on argument types above:
  1502.  
  1503.   filename        Path names are interpreted relative
  1504.              to the directory from which NEdit was
  1505.              started, wildcards and ~ are not
  1506.              expanded.
  1507.              
  1508.   search-direction  Either "forward" or "backward"
  1509.  
  1510.   search-type        Either "literal", "case", or "regex"
  1511.  
  1512.   mark-letter        The mark command limits users to
  1513.              single letters.  Inside of macros,
  1514.              numeric marks are allowed, which won't
  1515.              interfere with marks set by the user.
  1516.  
  1517.   (macro or shell)  Name of the command exactly as
  1518.   -menu-item-name   specified in the Shell Menu or
  1519.              Macro Menu dialogs
  1520.  
  1521.  
  1522. Keyboard-Only Actions
  1523.  
  1524.    backward_character() -- Moves the cursor one character to the left.
  1525.  
  1526.    backward_paragraph() -- Moves the cursor to the beginning of the paragraph,
  1527.       or if the cursor is already at the beginning of a paragraph, moves the
  1528.       cursor to the beginning of the previous paragraph.  Paragraphs are
  1529.       defined as regions of text delimited by one or more blank lines.
  1530.  
  1531.    backward_word() -- Moves the cursor to the beginning of a word, or, if the
  1532.       cursor is already at the beginning of a word, moves the cursor to the
  1533.       beginning of the previous word.  Word delimiters are user-settable, and
  1534.       defined by the X resource wordDelimiters.
  1535.  
  1536.    beginning_of_file() -- Moves the cursor to the beginning of the file.
  1537.  
  1538.    beginning_of_line() -- Moves the cursor to the beginning of the line.
  1539.  
  1540.    beginning_of_selection() -- Moves the cursor to the beginning of the
  1541.       selection without disturbing the selection.
  1542.  
  1543.    copy_clipboard() -- Copies the current selection to the clipboard.
  1544.  
  1545.    copy_primary() -- Copies the primary selection to the cursor.
  1546.  
  1547.    copy_to() -- If a secondary selection exists, copies the secondary selection
  1548.       to the cursor.  If no secondary selection exists, copies the primary
  1549.       selection to the pointer location.
  1550.  
  1551.    copy_to_or_end_drag() -- Completes either a secondary selection operation,
  1552.       or a primary drag.  If the user is dragging the mouse to adjust a
  1553.       secondary selection, the selection is copied and either inserted at the
  1554.       cursor location, or, if pending-delete is on and a primary selection
  1555.       exists in the window, replaces the primary selection.  If the user is
  1556.       dragging a block of text (primary selection), completes the drag
  1557.       operation and leaves the text at it's current location.
  1558.  
  1559.    cut_clipboard() -- Deletes the text in the primary selection and places it
  1560.       in the clipboard.
  1561.  
  1562.    cut_primary() -- Copies the primary selection to the cursor and deletes it
  1563.       at its original location.
  1564.  
  1565.    delete_selection() -- Deletes the contents of the primary selection.
  1566.  
  1567.    delete_next_character() -- If a primary selection exists, deletes its
  1568.       contents. Otherwise, deletes the character following the cursor.
  1569.  
  1570.    delete_previous_character() -- If a primary selection exists, deletes its
  1571.       contents.  Otherwise, deletes the character before the cursor.
  1572.  
  1573.    delete_next_word() -- If a primary selection exists, deletes its contents.
  1574.       Otherwise, deletes the word following the cursor.
  1575.  
  1576.    delete_previous_word() -- If a primary selection exists, deletes its
  1577.       contents. Otherwise, deletes the word before the cursor.
  1578.  
  1579.    delete_to_start_of_line() -- If a primary selection exists, deletes its
  1580.       contents. Otherwise, deletes the characters between the cursor and the
  1581.       start of the line.
  1582.  
  1583.    delete_to_end_of_line() -- If a primary selection exists, deletes its
  1584.       contents. Otherwise, deletes the characters between the cursor and the
  1585.       end of the line.
  1586.  
  1587.    deselect_all() -- De-selects the primary selection.
  1588.  
  1589.    end_of_file() -- Moves the cursor to the end of the file.
  1590.  
  1591.    end_of_line() -- Moves the cursor to the end of the line.
  1592.  
  1593.    end_of_selection() -- Moves the cursor to the end of the selection without
  1594.       disturbing the selection.
  1595.  
  1596.    exchange() -- Exchange the primary and secondary selections.
  1597.  
  1598.    extend_adjust() -- Attached mouse-movement events to begin a selection
  1599.       between the cursor and the mouse, or extend the primary selection to the
  1600.       mouse position.
  1601.  
  1602.    extend_end() -- Completes a primary drag-selection operation.
  1603.  
  1604.    extend_start() -- Begins a selection between the cursor and the mouse.  A
  1605.       drag-selection operation can be started with either extend_start or
  1606.       grab_focus.
  1607.  
  1608.    forward_character() -- Moves the cursor one character to the right.
  1609.  
  1610.    forward_paragraph() -- Moves the cursor to the beginning of the next
  1611.       paragraph. Paragraphs are defined as regions of text delimited by one or
  1612.       more blank lines.
  1613.  
  1614.    forward_word() -- Moves the cursor to the beginning of the next word.  Word
  1615.       delimiters are user-settable, and defined by the X resource
  1616.       wordDelimiters.
  1617.  
  1618.    grab_focus() -- Moves the cursor to the mouse pointer location, and prepares
  1619.       for a possible drag-selection operation (bound to extend_adjust), or
  1620.       multi-click operation (a further grab_focus action).  If a second
  1621.       invocation of grab focus follows immediately, it selects a whole word, or
  1622.       a third, a whole line.
  1623.  
  1624.    insert_string("string")  If pending delete is on and the cursor is inside
  1625.       the selection, replaces the selection with "string".  Otherwise, inserts
  1626.       "string" at the cursor location.
  1627.  
  1628.    key_select("direction") Moves the cursor one character in "direction"
  1629.       ("left", "right", "up", or "down") and extends the selection.  Same as
  1630.       forward/backward-character("extend"), or process-up/down("extend"), for
  1631.       compatibility with previous versions.
  1632.  
  1633.    move-destination() -- Moves the cursor to the pointer location without
  1634.       disturbing the selection.  (This is an unusual way of working.  We left
  1635.       it in for compatibility with previous versions, but if you actually use
  1636.       this capability, please send us some mail, otherwise it is likely to
  1637.       disappear in the future.
  1638.  
  1639.    move_to() -- If a secondary selection exists, deletes the contents of the
  1640.       secondary selection and inserts it at the cursor, or if pending-delete is
  1641.       on and there is a primary selection, replaces the primary selection.  If
  1642.       no secondary selection exists, moves the primary selection to the pointer
  1643.       location, deleting it from its original position.
  1644.  
  1645.    move_to_or_end_drag() -- Completes either a secondary selection operation,
  1646.       or a primary drag.  If the user is dragging the mouse to adjust a
  1647.       secondary selection, the selection is deleted and either inserted at the
  1648.       cursor location, or, if pending-delete is on and a primary selection
  1649.       exists in the window, replaces the primary selection.  If the user is
  1650.       dragging a block of text (primary selection), completes the drag
  1651.       operation and deletes the text from it's current location.
  1652.  
  1653.    newline() -- Inserts a newline character.  If Auto Indent is on, lines up
  1654.       the indentation of the cursor with the current line.
  1655.  
  1656.    newline_and_indent() -- Inserts a newline character and lines up the
  1657.       indentation of the cursor with the current line, regardless of the
  1658.       setting of Auto Indent.
  1659.  
  1660.    newline_no_indent() -- Inserts a newline character, without automatic
  1661.       indentation, regardless of the setting of Auto Indent.
  1662.  
  1663.    next_page() -- Moves the cursor and scroll forward one page.
  1664.  
  1665.    page_left() -- Move the cursor and scroll left one page.
  1666.  
  1667.    page_right() -- Move the cursor and scroll right one page.
  1668.  
  1669.    paste_clipboard() -- Insert the contents of the clipboard at the cursor, or
  1670.       if pending delete is on, replace the primary selection with the contents
  1671.       of the clipboard.
  1672.  
  1673.    previous_page() -- Moves the cursor and scroll backward one page.
  1674.  
  1675.    process_bdrag() -- Same as secondary_or_drag_start for compatibility with
  1676.       previous versions.
  1677.  
  1678.    process_cancel() -- Cancels the current extend_adjust, secondary_adjust, or
  1679.       secondary_or_drag_adjust in progress.
  1680.  
  1681.    process_down() -- Moves the cursor down one line.
  1682.  
  1683.    process_return() -- Same as newline for compatibility with previous
  1684.       versions.
  1685.  
  1686.    process_shift_down() -- Same as process_down("extend") for compatibility
  1687.       with previous versions.
  1688.  
  1689.    process_shift_up() -- Same as process_up("extend") for compatibility with
  1690.       previous versions.
  1691.  
  1692.    process_tab() -- If tab emulation is turned on, inserts an emulated tab,
  1693.       otherwise inserts a tab character.
  1694.  
  1695.    process_up() -- Moves the cursor up one line.
  1696.  
  1697.    scroll_down(nLines) Scroll the display down (towards the end of the file) by
  1698.       nLines.
  1699.  
  1700.    scroll_up(nLines) Scroll the display up (towards the beginning of the file)
  1701.       by nLines.
  1702.  
  1703.    scroll_to_line(lineNum) Scroll to position line number lineNum at the top of
  1704.       the pane.  The first line of a file is line 1.
  1705.  
  1706.    secondary_adjust() -- Attached mouse-movement events to extend the secondary
  1707.       selection to the mouse position.
  1708.  
  1709.    secondary_or_drag_adjust() -- Attached mouse-movement events to extend the
  1710.       secondary selection, or reposition the primary text being dragged.  Takes
  1711.       two optional arguments, "copy", and "overlay".  "copy" leaves a copy of
  1712.       the dragged text at the site at which the drag began.  "overlay" does the
  1713.       drag in overlay mode, meaning the dragged text is laid on top of the
  1714.       existing text, obscuring and ultimately deleting it when the drag is
  1715.       complete.
  1716.  
  1717.    secondary_or_drag_start() -- To be attached to a mouse down event.  Begins
  1718.       drag selecting a secondary selection, or dragging the contents of the
  1719.       primary selection, depending on whether the mouse is pressed inside of an
  1720.       existing primary selection.
  1721.  
  1722.    secondary_start() -- To be attached to a mouse down event.  Begin drag
  1723.       selecting a secondary selection.
  1724.  
  1725.    select_all() -- Select the entire file.
  1726.  
  1727.    self_insert() -- To be attached to a key-press event, inserts the character
  1728.       equivalent of the key pressed.
  1729.       
  1730. Arguments to Keyboard Action Routines 
  1731.  
  1732. In addition to the arguments listed in the call descriptions, any routine
  1733. involving cursor movement can take the argument "extend", meaning, adjust the
  1734. primary selection to the new cursor position.  Routines which take the "extend"
  1735. argument as well as mouse dragging operations for both primary and secondary
  1736. selections can take the optional keyword "rect", meaning, make the selection
  1737. rectangular.
  1738.     
  1739.  
  1740. CUSTOMIZATION
  1741.  
  1742. NEdit can be customized many different ways.  The most important user-settable
  1743. options are presented in the Preferences menu, including all options that users
  1744. might need to change during an editing session.  Options set in the Default
  1745. Settings sub-menu of the Preferences menu can be preserved between sessions by
  1746. selecting Save Defaults, which writes a file called .nedit in the user's home
  1747. directory.  See the section titled PREFERENCES for more details.
  1748.  
  1749. User defined commands can be added to NEdit's Shell, Macro, and window
  1750. background menus.  Dialogs for creating items in these menus can be found under
  1751. Customize Menus in the Default Settings sub menu of the Preferences menu.
  1752.  
  1753. For users who depend on NEdit every day and want to tune every excruciating
  1754. detail, there are also X resources for tuning a vast number of such details,
  1755. down to the color of each individual button.  See the section "X Resources" for
  1756. more information, as well as a list of selected resources.
  1757.  
  1758. The most common reason customizing your X resources for NEdit, however, is key
  1759. binding.  While limited key binding can be done through Preferences settings
  1760. (Preferences -> Default Settings -> Customize Menus), you can really only add
  1761. keys this way, and each key must have a corresponding menu item.  Any
  1762. significant changes to key binding should be made via the Translations resource
  1763. and menu accelerator resources.  The sections titled "Key Binding" and "X
  1764. Resources" have more information.
  1765.  
  1766.  
  1767. PREFERENCES
  1768.  
  1769. The Preferences menu allows you to set options for both the current editing
  1770. window, and default values for newly created windows and future NEdit
  1771. sessions.  Options in the Preferences menu itself (not in the Default Settings
  1772. sub-menu) take effect immediately and refer to the current window only. 
  1773. Options in the Default Settings sub-menu have no effect on the current window,
  1774. but instead provide initial settings for future windows created using the New
  1775. or Open commands.  Preferences set in the Default Settings sub-menu can also be
  1776. saved in a file that is automatically read by NEdit at startup time, by
  1777. selecting Save Defaults.
  1778.  
  1779. Preferences Menu
  1780.  
  1781.    Default Settings -- Menu of initial settings for future windows.
  1782.       Generally the same as the options in the main part of the menu, but
  1783.       apply as defaults for future windows created during this NEdit
  1784.       session.  These settings can be saved using the Save Defaults command
  1785.       below, to be loaded automatically each time NEdit is started.
  1786.  
  1787.    Save Defaults -- Save the default options as set under Default Settings
  1788.       for future NEdit sessions.
  1789.  
  1790.    Statistics Line -- Show the full file name, line number, and length of the
  1791.       file being edited.
  1792.  
  1793.    Language Mode -- Tells NEdit what language (if any) to assume, for
  1794.       selecting language-specific features such as highlight patterns and
  1795.       smart indent macros, and setting language specific preferences like
  1796.       word delimiters, tab emulation, and auto-indent.  See FEATURES FOR
  1797.       PROGRAMMING for more information.
  1798.  
  1799.    Auto Indent -- Setting Auto Indent "on" maintains a running indent
  1800.       (pressing the return key will line up the cursor with the indent level
  1801.       of the previous line).  If smart indent macros are available for the
  1802.       current language mode, smart indent can be selected and NEdit will
  1803.       attempt to guess proper language indentation for each new line.  See
  1804.       AUTOMATIC INDENT for more information.
  1805.  
  1806.    Wrap -- Choose between two styles of automatic wrapping or none.  Auto
  1807.       Newline wrap, wraps text at word boundaries when the cursor reaches the
  1808.       right margin, by replacing the space or tab at the last word boundary
  1809.       with a newline character.  Continuous Wrap wraps long lines which
  1810.       extend past the right margin. Continuous Wrap mode is typically used to
  1811.       produce files where newlines are ommitted within paragraphs, to make
  1812.       text filling automatic (a kind of poor-man's word processor).  Text of
  1813.       this style is common on Macs and PCs but is not necessarily supported
  1814.       very well under Unix (except in programs which deal with e-mail, for
  1815.       which it is often the format of choice).
  1816.  
  1817.       Wrap Margin -- Set margin for Auto Newline Wrap, Continuous Wrap, and
  1818.      Fill Paragraph.  Lines may, be wrapped at the right margin of the
  1819.      window, or the margin can be set at a specific column.
  1820.  
  1821.    Tabs -- Set the tab distance (number of characters between tab stops) for
  1822.       tab characters, and control tab emulation and use of tab characters in
  1823.       padding and emulated tabs.
  1824.  
  1825.    Text Font... -- Change the font(s) used to display text (fonts for menus
  1826.       and dialogs must be set using X resources for the text area of the
  1827.       window). See below for more information.
  1828.  
  1829.    Highlight Syntax -- If NEdit recognizes the language being edited, and
  1830.       highlighting patterns are available for that language, use fonts and
  1831.       colors to enhance viewing of the file.  See "SYNTAX HIGHLIGHTING" for
  1832.       more information.
  1833.  
  1834.    Make Backup Copy -- On Save, write a backup copy of the file as it existed
  1835.       before the Save command with the extension .bck (Unix only).
  1836.  
  1837.    Incremental Backup -- Periodically make a backup copy of the file being
  1838.       edited under the name ~filename on Unix or _filename on VMS (see CRASH
  1839.       RECOVERY).
  1840.  
  1841.    Show Matching (..) -- Momentarily highlight matching parenthesis,
  1842.       brackets, and braces when one of these characters is typed, or when the
  1843.       insertion cursor is positioned after it.
  1844.  
  1845.    Overtype -- In overtype mode, new characters entered replace the
  1846.       characters in front of the insertion cursor, rather than being inserted
  1847.       before them.
  1848.  
  1849.    Read Only -- Lock the file against accidental modification.  This
  1850.       temporarily prevents the file from being modified in this NEdit
  1851.       session. Note that this is diferent from setting the file protection.
  1852.  
  1853. Preferences -> Default Settings Menu
  1854.  
  1855. Options in the Preferences -> Default Settings menu have the same meaning as
  1856. those in the top-level Preferences menu, except that they apply to future NEdit
  1857. windows and future NEdit sessions if saved with the Save Defaults command. 
  1858. Additional options which appear in this menu are:
  1859.  
  1860.    Language Modes -- Define language recognition information (for
  1861.       determining language mode from file name or content) and set language
  1862.       specific preferences.
  1863.  
  1864.    Customize Menus -- Add/remove items from the Shell, Macro, and window
  1865.       background menus (see below).
  1866.  
  1867.    Searching -- Options for controlling the behavior of Find and Replace
  1868.       commands:
  1869.  
  1870.         Verbose - Presents search results in dialog form, asks before
  1871.            wrapping a search back around the beginning (or end) of the
  1872.            file.
  1873.  
  1874.         Keep Dialogs Up - Don't pop down Replace and Find boxes after
  1875.            searching.
  1876.  
  1877.         Default Search Style - Initial setting for search type in Find and
  1878.            Replace dialogs.
  1879.  
  1880.    Syntax Highlighting -- Program and configure enhanced text display for
  1881.       new or supported languages (See SYNTAX HIGHLIGHTING and WRITING SYNTAX
  1882.       HIGHLIGHTING PATTERNS).
  1883.  
  1884.    Initial Window Size -- Default size for new windows.
  1885.  
  1886. Changing Font(s)
  1887.  
  1888. The font used to display text in NEdit is set under Preferences -> Text Font
  1889. (for the current window), or Preferences -> Default Settings Text Font (for
  1890. future windows).  These dialogs also allow you to set fonts for syntax
  1891. highlighting.  If you don't intend to use syntax highlighting, you can ignore
  1892. most of the dialog, and just set the field labeled Primary Font.
  1893.  
  1894. Unless you are absolutely certain about the types of files that you will be
  1895. editing with NEdit, you should choose a fixed-spacing font.  Many, if not most,
  1896. plain-text files are written expecting to be viewed with fixed character
  1897. spacing, and will look wrong with proportional spacing.  NEdit's filling,
  1898. wrapping, and rectangular operations will also work strangely if you choose a
  1899. proportional font.
  1900.  
  1901. Note that in the font browser (the dialog brought up by the Browse... button),
  1902. the subset of fonts which are shown is narrowed depending on the
  1903. characteristics already selected.  It is therefore important to know that you
  1904. can unselect characteristics from the lists by clicking on the selected items a
  1905. second time.
  1906.  
  1907. Fonts for syntax highlighting should ideally match the primary font in both
  1908. height and spacing.  A mismatch in spacing will result in similar distortions
  1909. as choosing a proportional font: column alignment will sometimes look wrong,
  1910. and rectangular operations, wrapping, and filling will behave strangely.  A
  1911. mismatch in height will cause windows to re-size themselves slightly when
  1912. syntax highlighting is turned on or off, and increase the inter- line spacing
  1913. of the text.  Unfortunately, on some systems it is hard to find sets of fonts
  1914. which match exactly in height.
  1915.  
  1916. Customizing Menus
  1917.  
  1918. You can add or change items in the Shell, Macro, and window background menus
  1919. under Preferences -> Default Settings -> Customize Menus.  When you choose one
  1920. of these, you will see a dialog with a list of the current user-configurable
  1921. items from the menu on the left.  To change an existing item, select it from
  1922. the list, and its properties will appear in the remaining fields of the dialog,
  1923. where you may change them.  Selecting the item "New" from the list allows you
  1924. to enter new items in the menu.
  1925.  
  1926. Hopefully most of the characteristics are self explanatory, but here are a few
  1927. things to note:
  1928.  
  1929. Accelerator keys are keyboard shortcuts which appear on the right hand side of
  1930. the menus, and allow you avoid pulling down the menu and activate the command
  1931. with a single keystroke.  Enter accelerators by typing the keys exactly as you
  1932. would to activate the command.
  1933.  
  1934. Mnemonics are a single letter which should be part of the menu item name, which
  1935. allow users to traverse and activate menu items by typing keys when the menu is
  1936. pulled down.
  1937.  
  1938. In the Shell Command field of the Shell Commands dialog, the % character
  1939. expands to the name (including directory path) of the file in the window.  To
  1940. include a % character in the command, use %%.
  1941.  
  1942. The Menu Entry field can contain special characters for constructing
  1943. hierarchical sub-menus, and for making items which appear only in certain
  1944. language modes.  The right angle bracket character ">" creates a sub-menu.  The
  1945. name of the item itself should be the last element of the path formed from
  1946. successive sub-menu names joined with ">".  Menu panes are called in to
  1947. existence simply by naming them as part of a Menu Entry name.  To put several
  1948. items in the same sub-menu, repeat the same hierarchical sequence for each. 
  1949. For example, in the Macro Commands dialog, two items with menu entries: a>b>c
  1950. and a>b>d would create a single sub menu under the macro menu called "a", which
  1951. would contain a single sub-menu, b, holding the actual items, c and d:
  1952.  
  1953.     +---++---++---+
  1954.     |a >||b >||c  |
  1955.     +---++---+|d  |
  1956.               +---+
  1957.  
  1958. To qualify a menu entry with a language mode, simply add an at-sign "@" at the
  1959. end of the menu command, followed (no space) by a language mode name.  To make
  1960. a menu item which appears in several language modes, append additional @s and
  1961. language mode names.  For example, an item with the menu entry:
  1962.  
  1963.   Make C Prototypes@C@C++
  1964.  
  1965. would appear only in C and C++ language modes, and:
  1966.  
  1967.   Make Class Template@C++
  1968.  
  1969. would appear only in C++ mode.
  1970.  
  1971. Menu items with no qualification appear in all language modes.
  1972.  
  1973.  
  1974. X RESOURCES
  1975.         
  1976. NEdit has additional options to those provided in the Preferences menu which
  1977. are set using X resources.  Like most other X programs, NEdit can be customized
  1978. to vastly unnecessary proportions, from initial window positions down to the
  1979. font and shadow colors of each individual button (A complete discussion of how
  1980. to do this is left to books on the X Windows System).  Key binding (see KEY
  1981. BINDING) is one of the most useful of these resource settable options.
  1982.  
  1983. X resources are usually specified in a file called .Xdefaults or .Xresources in
  1984. your home directory (on VMS this is sys$login:decw$xdefaults.dat).  On some
  1985. systems, this file is read and its information attached to the X server (your
  1986. screen) when you start X.  On other systems, the .Xdefaults file is read each
  1987. time you run an X program.  When X resource values are attached to the X
  1988. server, changes to the resource file are not available to application programs
  1989. until you either run the xrdb program with the appropriate file as input, or
  1990. re-start the X server.
  1991.  
  1992. The .nedit File
  1993.  
  1994. The .nedit (saved preferences) file is in the same format as an X resource
  1995. file, and its contents can be moved into your X resource file.  One reason for
  1996. doing so would be to attach server specific preferences, such as a default font
  1997. to a particular X server.  Another reason for moving preferences into the X
  1998. resource file would be to keep preferences menu options and resource settable
  1999. options together in one place. Though the files are the same format, additional
  2000. resources should not be added to the .nedit file, they will not be read, and
  2001. NEdit modifies this file by overwriting it completely.  Note also that the
  2002. contents of the .nedit file take precedence over the values of X resources. 
  2003. Using Save Defaults after moving the contents of your .nedit file to your
  2004. .Xdefaults file will re-create the .nedit file, interfering with the options
  2005. that you have moved.
  2006.  
  2007. Selected X Resource Names
  2008.  
  2009. The following are selected NEdit resource names and default values for NEdit
  2010. options not settable via the Preferences menu (for preference resource names,
  2011. see your .nedit file):
  2012.  
  2013.     nedit.tagFile: (not defined) -- The name of a file of the type produced
  2014.         by the Unix ctags command which NEdit will load at startup time
  2015.         (see FINDING SUBROUTINE AND DATA DECLARATIONS above).  The tag file
  2016.     provides a database from which NEdit can automatically open files
  2017.     containing the definition of a particular subroutine or data type.
  2018.  
  2019.     nedit.shell: /bin/csh -- (Unix systems only) The Unix shell (command
  2020.         interpreter) to use for executing commands from the Shell menu
  2021.  
  2022.     nedit.wordDelimiters: .,/\\`'!@#%^&*()-=+{}[]":;<>? -- The characters,
  2023.         in addition to blanks and tabs, which mark the boundaries between
  2024.         words for the move-by-word (Ctrl+Arrow) and select-word (double
  2025.         click) commands.
  2026.  
  2027.     nedit.remapDeleteKey: True -- Setting this resource to False restores
  2028.         the original Motif binding of the delete key to forward-delete.
  2029.         This binding causes problems when X servers with one delete/
  2030.         backspace configuration are connected with X clients of the other.
  2031.         Users with a backspace key in the backspace/delete position and who
  2032.         use only machines with that style of keyboard can set this resource
  2033.         to False to get back the forward-delete function of the delete key.
  2034.  
  2035.     nedit.bgMenuButton: ~Shift~Ctrl~Meta~Alt<Btn3Down> -- Specification for
  2036.     mouse button / key combination to post the background menu (in the
  2037.     form of an X translation table event specification).  The event
  2038.     specification should be as specific as possible, since it will
  2039.     override less specific translation table entries.
  2040.  
  2041.     nedit.maxPrevOpenFiles: 30 -- Number of files listed in the Open
  2042.     Previous sub-menu of the File menu. Setting this to zero disables
  2043.     the Open Previous menu item and maintenance of the .neditdb file.
  2044.  
  2045.     nedit.stdOpenDialog: False -- Setting this resource to True restores the
  2046.         standard Motif style of Open dialog.  NEdit file open dialogs are
  2047.         missing a text field at the bottom of the dialog, where the file
  2048.         name can be entered as a string.  The field is removed in NEdit to
  2049.         encourage users to type file names in the list, a non-standard, but
  2050.         much faster method for finding files.
  2051.  
  2052.     nedit.printCommand: (system specific) -- Command used by the print dialog
  2053.         to print a file, i.e. lp, lpr, etc..
  2054.  
  2055.     nedit.printCopiesOption: (system specific) -- Option name used to
  2056.         specify multiple copies to the print command.  If the option should
  2057.         be separated from its argument by a space, leave a trailing space.
  2058.         If blank, no "Number of Copies" item will appear in the print dialog.
  2059.  
  2060.     nedit.printQueueOption: (system specific) -- Option name used to specify
  2061.         a print queue to the print command.  If the option should be
  2062.         separated from its argument by a space, leave a trailing space. If
  2063.         blank, no "Queue" item will appear in the print dialog.
  2064.  
  2065.     nedit.printNameOption: (system specific) -- Option name used to specify a
  2066.         job name to the print command.  If the option should be separated
  2067.         from its argument by a space, leave a trailing space. If blank, no
  2068.         job or file name will be attached to the print job or banner page.
  2069.  
  2070.     nedit.printHostOption: (system specific) -- Option name used to specify a
  2071.         host name to the print command.  If the option should be separated
  2072.         from its argument by a space, leave a trailing space. If blank, no
  2073.         "Host" item will appear in the print dialog.
  2074.  
  2075.     nedit.printDefaultQueue: (system specific) -- The name of the default
  2076.         print queue.  Used only to display in the print dialog, and has no
  2077.         effect on printing.
  2078.  
  2079.     nedit.printDefaultHost: (system specific) -- The node name of the
  2080.         default print host.  Used only to display in the print dialog, and
  2081.         has no effect on printing.
  2082.  
  2083.     nedit.multiClickTime: (system specific) -- Maximum time in milliseconds
  2084.         allowed between mouse clicks within double and triple click actions.
  2085.  
  2086.     nedit*scrollBarPlacement: BOTTOM_LEFT -- How scroll bars are placed in
  2087.         NEdit windows, as well as various lists and text fields in the
  2088.         program.  Other choices are: BOTTOM_RIGHT, TOP_LEFT, or TOP_RIGHT.
  2089.  
  2090.     nedit*text.autoWrapPastedText: False -- When Auto- Newline Wrap is turned
  2091.     on, apply automatic wrapping (which normally only applies to typed
  2092.     text) to pasted text as well.
  2093.  
  2094.     nedit*text.heavyCursor: False -- For monitors with poor resolution or
  2095.         users who have difficulty seeing the cursor, makes the cursor in the
  2096.         text editing area of the window heavier and darker.
  2097.  
  2098.     nedit*text.foreground: black -- Foreground color of the text editing area
  2099.         of the NEdit window.
  2100.  
  2101.     nedit*text.background: white -- Background color of the text editing area
  2102.         of the NEdit window.
  2103.  
  2104.     nedit*text.selectForeground: black -- Foreground (text) color for
  2105.         selections in the text editing area of the NEdit window. 
  2106.  
  2107.     nedit*text.selectBackground: gray80 -- Color for selections in the text
  2108.         editing area of the NEdit window.
  2109.  
  2110.     nedit*text.highlightForeground: white -- Foreground (text) color for
  2111.         highlights (parenthesis flashing) in the text editing area of the
  2112.         NEdit window.
  2113.  
  2114.     nedit*text.highlightBackground: red -- Color for highlights (parenthesis
  2115.         flashing) in the text editing area of the NEdit window.
  2116.  
  2117.     nedit*text.cursorForeground: black -- Color for text cursor in the text
  2118.         editing area of the NEdit window.
  2119.  
  2120.     nedit*text.blinkRate: 600 -- Blink rate of the text insertion cursor in
  2121.         milliseconds.  Set to zero to stop blinking.
  2122.  
  2123.     nedit*text.Translations: -- Modifies key bindings (see below).
  2124.  
  2125.     nedit*statsLine.foreground: black -- Foreground color of the statistics
  2126.         line area of the NEdit window.
  2127.  
  2128.     nedit*statsLine.background: gray70 -- Background color of the statistics
  2129.         line area of the NEdit window.
  2130.  
  2131.     nc.autoStart: False -- Whether the nc program should automatically start
  2132.         an NEdit server (without prompting the user) if an appropriate server
  2133.         is not found.
  2134.  
  2135.     nc.serverCommand: nedit -server -- Command used by the nc program to
  2136.         start an NEdit server.
  2137.  
  2138. KEY BINDING
  2139.  
  2140. There are several ways to change key bindings in NEdit.  The easiest way to add
  2141. a new key binding in NEdit is to define a macro in Preferences -> Default
  2142. Settings -> Customize Menus -> Macro Menu.  However, if you want to change
  2143. existing bindings or add a significant number of new key bindings you will need
  2144. to do so via X resources.
  2145.  
  2146. Before reading this section, you must understand how to set X resources (see
  2147. the section titled "X RESOURCES" above).  Since setting X resources is tricky,
  2148. it is also helpful when working on key-binding, to set some easier-to-verify
  2149. resource at the same time, as a simple check that the NEdit program is actually
  2150. seeing your changes.  The appres program is also very helpful in checking that
  2151. the resource settings that you make, actually reach the program for which they
  2152. are intended in the correct form.
  2153.  
  2154. Key Binding in General
  2155.  
  2156. Keyboard commands are associated with editor action routines through two
  2157. separate mechanisms in NEdit.  Commands which appear in pull-down menus have
  2158. individual resources designating a keyboard equivalent to the menu command,
  2159. called an accelerator key.  Commands which do not have an associated menu item
  2160. are bound to keys via the X toolkit translation mechanism.  The methods for
  2161. changing these two kinds of bindings are quite different.
  2162.  
  2163. Key Binding Via Translations
  2164.  
  2165. The most general way to bind actions to keys in NEdit is to use the translation
  2166. table associated with the text widget.  To add a binding to Alt+Y to insert the
  2167. string "Hi!", for example, add lines similar to the following to your X
  2168. resource file:
  2169.  
  2170.   NEdit*text.Translations: #override \n\
  2171.     Alt<Key>y: insert_string("Hi!") \n
  2172.  
  2173. The section "ACTION ROUTINES" above lists the actions available to be bound.
  2174.  
  2175. Translation tables map key and mouse presses, window operations, and other
  2176. kinds of events to actions.   The syntax for translation tables is simplified
  2177. here, and you.  may need to refer to a book on the X window system for more
  2178. detailed information.
  2179.  
  2180. A resource for changing a translation table consists of a keyword; #override,
  2181. #augment, or #replace; followed by lines (separated by newline characters)
  2182. pairing events with actions.  Events begin with modifiers, like Ctrl, Shift, or
  2183. Alt, followed by the event type in <>.  BtnDown, Btn1Down, Btn2Down, Btn1Up,
  2184. Key, KeyUp are valid event types.  For key presses, the event type is followed
  2185. by the name of the key.  You can specify a combination of events, such as a
  2186. sequence of key presses, by separating them with commas.  The other half of the
  2187. event/action pair is a set of actions.  These are separated from the event
  2188. specification by a colon and from each other by spaces.  Actions are names
  2189. followed by parentheses, optionally containing one or more parameters separated
  2190. by comas.
  2191.  
  2192. Changing Menu Accelerator Keys
  2193.  
  2194. The menu shortcut keys shown at the right of NEdit menu items can also be
  2195. changed via X resources.  Each menu item has two resources associated with it,
  2196. accelerator, the event to trigger the menu item; and acceleratorText, the
  2197. string shown in the menu.  The form of the accelerator resource is the same as
  2198. events for translation table entries discussed above, though multiple keys and
  2199. other subtleties are not allowed.  The resource name for a menu is the title in
  2200. lower case, followed by "Menu", the resource name of menu item is the name in
  2201. lower case, run together, with words separated by caps, and all punctuation
  2202. removed.  For example, to change Cut to Ctrl+X, you would add the following to
  2203. your .Xdefaults file:
  2204.  
  2205.     nedit*editMenu.cut.accelerator: Ctrl<Key>x
  2206.     nedit*editMenu.cut.acceleratorText: Ctrl+X
  2207.  
  2208. Accelerator keys with optional shift key modifiers, like Find..., have an
  2209. additional accelerator resource with Shift appended to the name.  For example:
  2210.  
  2211.     nedit*searchMenu.find.acceleratorText: [Shift]Alt+F
  2212.     nedit*searchMenu.find.accelerator: Alt<Key>f
  2213.     nedit*searchMenu.findShift.accelerator: Shift Alt<Key>f
  2214.  
  2215.  
  2216. WRITING SYNTAX HIGHLIGHTING PATTERNS
  2217.  
  2218. Patterns are the mechanism by which syntax highlighting (see SYNTAX
  2219. HIGHLIGHTING above) is programmed in NEdit, that is, how it decides what to
  2220. highlight in a given language.  To create syntax highlighting patterns for a
  2221. new language, or to modify existing patterns, select "Patterns for
  2222. Highlighting" from "Syntax Highlighting" sub-section of the "Default Settings"
  2223. sub-menu of the "Preferences" menu.
  2224.  
  2225. First, a word of caution.  As with regular expression matching in general, it
  2226. is quite possible to write patterns which are so inefficient that they
  2227. essentially lock up the editor as they recursively re-examine the entire
  2228. contents of the file thousands of times.  With the multiplicity of patterns,
  2229. the possibility of a lock-up is significantly increased in syntax
  2230. highlighting.  When working on highlighting patterns, be sure to save your work
  2231. frequently.
  2232.  
  2233. NEdit's syntax highlighting is unusual in that it works in real-time (as you
  2234. type), and yet is completely programmable using standard regular expression
  2235. notation.  Other syntax highlighting editors usually fall either into the
  2236. category of fully programmable but unable to keep up in real-time, or real-time
  2237. but limited programmability.  The additional burden that NEdit places on
  2238. pattern writers in order to achieve this speed/flexibility mix, is to force
  2239. them to state self-imposed limitations on the amount of context that patterns
  2240. may examine when re-parsing after a change.  While the "Pattern Context
  2241. Requirements" heading is near the end of this section, it is not optional, and
  2242. must be understood before making any any serious effort at pattern writing.
  2243.  
  2244. In its simplest form, a highlight pattern consists of a regular expression to
  2245. match, along with a style representing the font an color for displaying any
  2246. text which matches that expression.  To bold the word, "highlight", wherever it
  2247. appears the text, the regular expression simply would be the word "highlight". 
  2248. The style (selected from the menu under the heading of "Highlight Style")
  2249. determines how the text will be drawn.  To bold the text, either select an
  2250. existing style, such as "Keyword", which bolds text, or create a new style and
  2251. select it under Highlight Style.
  2252.  
  2253. The full range of regular expression capabilities can be applied in such a
  2254. pattern, with the single caveat that the expression must conclusively match or
  2255. not match, within the pre-defined context distance (as discussed below under
  2256. Pattern Context Requirements).
  2257.  
  2258. To match longer ranges of text, particularly any constructs which exceed the
  2259. requested context, you must use a pattern which highlights text between a
  2260. starting and ending regular expression match.  To do so, select "Highlight text
  2261. between starting and ending REs" under "Matching", and enter both a starting
  2262. and ending regular expression.  For example, to highlight everything between
  2263. double quotes, you would enter a double quote character in both the starting
  2264. and ending regular expression fields.  Patterns with both a beginning and
  2265. ending expression span all characters between the two expressions, including
  2266. newlines.
  2267.  
  2268. Again, the limitation for automatic parsing to operate properly is that both
  2269. expressions must match within the context distance stated for the pattern set.
  2270.  
  2271. With the ability to span large distances, comes the responsibility to recover
  2272. when things go wrong.  Remember that syntax highlighting is called upon to
  2273. parse incorrect or incomplete syntax as often as correct syntax.  To stop a
  2274. pattern short of matching its end expression, you can specify an error
  2275. expression, which stops the pattern from gobbling up more than it should.  For
  2276. example, if the text between double quotes shouldn't contain newlines, the
  2277. error expression might be "$".  As with both starting and ending expressions,
  2278. error expressions must also match within the requested context distance.
  2279.  
  2280. Coloring Sub-Expressions
  2281.  
  2282. It is also possible to color areas of text within a regular expression match. 
  2283. A pattern of this type associates a style with sub-expressions references of
  2284. the parent pattern (as used in regular expression substitution patterns, see
  2285. the section titled: REGULAR EXPRESSIONS).  Sub-expressions of both the starting
  2286. and ending patterns may be colored.  For example, if the parent pattern has a
  2287. starting expression "\<", and end expression "\>", (for highlighting all of the
  2288. text contained within angle brackets), a sub-pattern using "\0" in both the
  2289. starting and ending expression fields could color the brackets differently from
  2290. the intervening text.  A quick shortcut to typing in pattern names in the
  2291. Parent Pattern field is to use the middle mouse button to drag them from the
  2292. Patterns list.
  2293.  
  2294. Hierarchical Patterns
  2295.  
  2296. A hierarchical sub-pattern, is identical to a top level pattern, but is invoked
  2297. only between the beginning and ending expression matches of its parent
  2298. pattern.  Like the sub-expression coloring patterns discussed above, it is
  2299. associated with a parent pattern using the Parent Pattern field in the pattern
  2300. specification.  Pattern names can be dragged from the pattern list with the
  2301. middle mouse button to the Parent Pattern field.
  2302.  
  2303. After the start expression of the parent pattern matches, the syntax
  2304. highlighting parser searches for either the parent's end pattern or a matching
  2305. sub-pattern.  When a sub-pattern matches, control is not returned to the parent
  2306. pattern until the entire sub-pattern has been parsed, regardless of whether the
  2307. parent's end pattern appears in the text matched by the sub-pattern.
  2308.  
  2309. The most common use for this capability is for coloring sub-structure of
  2310. language constructs (smaller patterns embedded in larger patterns). 
  2311. Hierarchical patterns can also simplify parsing by having sub-patterns "hide"
  2312. special syntax from parent patterns, such as special escape sequences or
  2313. internal comments.
  2314.  
  2315. There is no depth limit in nesting hierarchical sub-patterns, but beyond the
  2316. third level of nesting, automatic re-parsing will sometimes have to re-parse
  2317. more than the requested context distance to guaranty a correct parse (which can
  2318. slow down the maximum rate at which the user can type if large sections of text
  2319. are matched only by deeply nested patterns).
  2320.  
  2321. While this is obviously not a complete hierarchical language parser it is still
  2322. useful in many text coloring situations.  As a pattern writer, your goal is not
  2323. to completely cover the language syntax, but to generate colorings that are
  2324. useful to the programmer.  Simpler patterns are usually more efficient and also
  2325. more robust when applied to incorrect code.
  2326.  
  2327. Deferred (Pass-2) Parsing
  2328.  
  2329. NEdit does pattern matching for syntax highlighting in two passes.  The first
  2330. pass is applied to the entire file when syntax highlighting is first turned on,
  2331. and to new ranges of text when they are initially read or pasted in.  The
  2332. second pass is applied only as needed when text is exposed (scrolled in to
  2333. view).
  2334.  
  2335. If you have a particularly complex set of patterns, and parsing is beginning to
  2336. add a noticeable delay to opening files or operations which change large
  2337. regions of text, you can defer some of that parsing from startup time, to when
  2338. it is actually needed for viewing the text.  Deferred parsing can only be used
  2339. with single expression patterns, or begin/end patterns which match entirely
  2340. within the requested context distance.  To defer the parsing of a pattern to
  2341. when the text is exposed, click on the Pass-2 pattern type button in the
  2342. highlight patterns dialog.
  2343.  
  2344. Sometimes a pattern can't be deferred, not because of context requirements, but
  2345. because it must run concurrently with pass-1 (non-deferred) patterns.  If they
  2346. didn't run concurrently, a pass-1 pattern might incorrectly match some of the
  2347. characters which would normally be hidden inside of a sequence matched by the
  2348. deferred pattern.  For example, C has character constants enclosed in single
  2349. quotes.  These typically do not cross line boundaries, meaning they can be
  2350. parsed entirely within the context distance of the C pattern set and should be
  2351. good candidates for deferred parsing.  However, they can't be deferred because
  2352. they can contain sequences of characters which can trigger pass-one patterns.
  2353. Specifically, the sequence, '\"', contains a double quote character, which
  2354. would be matched by the string pattern and interpreted as introducing a string.
  2355.  
  2356. Pattern Context Requirements
  2357.  
  2358. The context requirements of a pattern set state how much additional text around
  2359. any change must be examined to guaranty that the patterns will match what they
  2360. are intended to match.  Context requirements are a promise by NEdit to the
  2361. pattern writer, that the regular expressions in his/her patterns will be
  2362. matched against at least <line context> lines and <character context>
  2363. characters, around any modified text.  Combining line and character
  2364. requirements guaranty that both will be met.
  2365.  
  2366. Automatic re-parsing happens on EVERY KEYSTROKE, so the amount of context which
  2367. must be examined is very critical to typing efficiency.  The more complicated
  2368. your patterns, the more critical the context becomes.  To cover all of the
  2369. keywords in a typical language, without affecting the maximum rate at which
  2370. users can enter text, you may be limited to just a few lines and/or a few
  2371. hundred characters of context.
  2372.  
  2373. The default context distance is 1 line, with no minimum character requirement. 
  2374. There are several benefits to sticking with this default.  One is simply that
  2375. it is easy to understand and to comply with.  Regular expression notation is
  2376. designed around single line matching.  To span lines in a regular expression,
  2377. you must explicitly mention the newline character "\n", and matches which are
  2378. restricted to a single line are virtually immune to lock-ups.  Also, if you can
  2379. code your patterns to work within a single line of context, without an
  2380. additional character-range context requirement, the parser can take advantage
  2381. the fact that patterns don't cross line boundaries, and nearly double its
  2382. efficiency over a one-line and 1-character context requirement.  (In a single
  2383. line context, you are allowed to match newlines, but only as the first and/or
  2384. last character.)
  2385.  
  2386.  
  2387. THE NEDIT COMMAND LINE
  2388.  
  2389. nedit [-read] [-create] [-line n | +n] [-server] [-do command] [-tags file]
  2390.     [-tabs n] [-wrap] [-nowrap] [-autowrap] [-autoindent] [-noautoindent]
  2391.     [-autosave] [-noautosave] [-rows n] [-columns n] [-font font]
  2392.     [-geometry geometry] [-display [host]:server[.screen]
  2393.     [-xrm resourcestring] [-svrname name] [file...]
  2394.  
  2395.     -read -- Open the file Read Only regardless of the actual file
  2396.         protection.
  2397.  
  2398.     -create -- Don't warn about file creation when a file doesn't exist.
  2399.  
  2400.     -line n (or +n) -- Go to line number n
  2401.  
  2402.     -server -- Designate this session as an NEdit server, for processing
  2403.         commands from the nc program.  nc can be used to interface NEdit
  2404.         to code development environments, mailers, etc., or just as a
  2405.         quick way to open files from the shell command line without
  2406.         starting a new NEdit session.
  2407.  
  2408.     -do command -- Execute an NEdit macro or action on each file following
  2409.         the -do argument on the command line.  -do is particularly useful
  2410.         from the nc program, where nc -do can remotely execute commands in
  2411.         an nedit -server session.
  2412.  
  2413.     -tags file -- Load a file of directions for finding definitions of
  2414.         program subroutines and data objects.  The file must be of the
  2415.         format generated by the Unix ctags command.
  2416.  
  2417.     -tabs n -- Set tab stops every n characters.
  2418.  
  2419.     -wrap, -nowrap -- Wrap long lines at the right edge of the window
  2420.     rather than continuing them past it.  (Continuous Wrap mode)
  2421.     
  2422.     -autowrap, -noautowrap -- Wrap long lines when the cursor reaches
  2423.     the right edge of the window by inserting newlines at word
  2424.     boundaries.  (Auto Newline Wrap mode)
  2425.  
  2426.     -autoindent, noautoindent -- Maintain a running indent.
  2427.  
  2428.     -autosave, -noautosave -- Maintain a backup copy of the file being
  2429.         edited under the name ~filename  (on Unix) or _filename (on VMS).
  2430.  
  2431.     -rows n -- Default height in characters for an editing window.
  2432.  
  2433.     -columns n -- Default width in characters for an editing window.
  2434.  
  2435.     -font font (or -fn font) -- Font for text being edited (Font for
  2436.         menus and dialogs can be set with -xrm "*fontList:font").
  2437.  
  2438.     -display [host]:server[.screen] -- The name of the X server to use.
  2439.         host specifies the machine, server specifies the display server
  2440.         number, and screen specifies the screen number.  host or screen
  2441.         can be omitted and default to the local machine, and screen 0.
  2442.  
  2443.     -geometry geometry (or -g geometry) -- The initial size and/or
  2444.         location of editor windows.  The argument has the form:
  2445.  
  2446.            [<width>x<height>][+|-][<xoffset>[+|-]<yoffset>]
  2447.  
  2448.         where <width> and <height> are the desired width and height of
  2449.         the window, and <xoffset> and <yoffset> are the distance from
  2450.         the edge of the screen to the window, + for top or left, - for
  2451.         bottom or right.
  2452.  
  2453.     -background color (or -bg color) -- Background color. (background
  2454.         color for text can be set separately with:
  2455.         -xrm "nedit*text.background: color").
  2456.  
  2457.     -foreground color (or -fg color) -- Foreground color. (foreground
  2458.         color for text can be set separately with:
  2459.          -xrm "nedit*text.foreground: color").
  2460.  
  2461.     -xrm resourcestring -- Set the value of an X resource to override a
  2462.         default value (see CUSTOMIZIATION).
  2463.  
  2464.     -svrname name -- When starting nedit in server mode, name the
  2465.     server, such that it responds to requests only when nc is given
  2466.     a correspoding -svrname argument.  By naming servers, you can
  2467.     run several simultaneously, and direct files and commands
  2468.     specifically to any one.
  2469.  
  2470.  
  2471. SERVER MODE AND NC
  2472.  
  2473. NEdit can be operated on its own, or as a two-part client/server application. 
  2474. Client/server mode is useful for integrating NEdit with software development
  2475. environments, mailers, and other programs; or just as a quick way to open files
  2476. from the shell command line without starting a new NEdit session.
  2477.  
  2478. To run NEdit in server mode, type:
  2479.  
  2480. nedit -server
  2481.  
  2482. NEdit can also be started in server mode via the nc program when no servers are
  2483. available.
  2484.  
  2485. The nc (for NEdit Client) program, which is distributed along with nedit, sends
  2486. commands to an nedit server to open files, select lines, or execute editor
  2487. actions.  It accepts a limited set of the nedit command line options: -read,
  2488. -create, -line (or +n), -do, and a list of file names.  Listing a file on the
  2489. nc command line means, open it if it is not already open and bring the window
  2490. to the front.  -read and -create affect only newly opened files, but -line and
  2491. -do can also be used on files which are already open (See  NEDIT COMMAND LINE
  2492. for more information).
  2493.  
  2494. In typical Unix style, arguments affect the files which follow them on the
  2495. command line, for example:
  2496.  
  2497.     incorrect:   nc file.c -line 25
  2498.     correct:     nc -line 25 file.c
  2499.  
  2500. -read, -create, and -line affect all of the files which follow them on the
  2501. command line.  The -do macro is executed only once, on the next file on the
  2502. line.  -do without a file following it on the command line, executes the macro
  2503. on the first available window (presumably when you give a -do command without a
  2504. corresponding file or window, you intend it to do something independent of the
  2505. window in which it happens execute).
  2506.  
  2507. nc also accepts one command line option of its own, -noask (or -ask), which
  2508. instructs it whether to automatically start a server if one is not available. 
  2509. This is also settable via the X resource, nc.autoStart (See X RESOURCES above).
  2510.  
  2511. Sometimes it is useful to have more than one NEdit server running, for example
  2512. to keep mail and programming work separate, or more importantly for working
  2513. with tools like ClearCase which provide different views of the file system from
  2514. different shells.  The option, -svrname, to both nedit and nc, allow you to
  2515. start, and communicate with, separate named servers.  A named server responds
  2516. only to requests with the corresponding -svrname argument.
  2517.  
  2518. Communication between nc and nedit is through the X display.  So as long as X
  2519. windows is set up and working properly, nc will will work properly as well.  nc
  2520. uses the DISPLAY environment variable, the machine name and your user name to
  2521. find the appropriate server, meaning, if you have several machines sharing a
  2522. common file system, nc will not be able to find a server that is running on a
  2523. machine with a different host name, even though it may be perfectly appropriate
  2524. for editing a given file.
  2525.  
  2526. The command which nc uses to start an nedit server is settable via the X
  2527. resource nc.serverCommand, by default, "nedit -server".
  2528.  
  2529.  
  2530. CRASH RECOVERY
  2531.  
  2532. If a system crash, network failure, X server crash, or program error should
  2533. happen while you are editing a file, you can easily recover most of your work.
  2534. NEdit maintains a backup file which it updates periodically (every 8 editing
  2535. operations or 30 characters typed under Unix, or 80 characters under VMS).
  2536. This file is has the same name as the file that you are editing, but with the
  2537. character "~" (tilde) on Unix or "_" (underscore) on VMS prefixed to the name.
  2538. To recover a file after a crash, simply rename the file to remove the tilde 
  2539. or underscore character, replacing the older version of the file.  Because 
  2540. several of the Unix shells consider the tilde to be a special character, you 
  2541. may have to prefix the character with a "\" (backslash) when you move or 
  2542. delete an NEdit backup file.
  2543.  
  2544. Example, to recover the file called "help.c" type the command:
  2545.  
  2546.     mv \~help.c help.c
  2547.     
  2548. On VMS, type:
  2549.     
  2550.     RENAME _HELP.C HELP.C
  2551.  
  2552.  
  2553. SOLUTIONS TO COMMON PROBLEMS
  2554.  
  2555. P: No files are shown in the "Files" list in the Open... dialog.
  2556. S: When you use the "Filter" field, include the file specification or a
  2557.    complete directory specification, including the trailing "/" on Unix.  (See
  2558.    Help in the Open... dialog).
  2559.  
  2560. P: Keyboard shortcuts for menu items don't work.
  2561. S: Be sure the Caps Lock and Num Lock keys are both unlocked.  In Motif
  2562.    programs, these keys prevent the menu accelerators from working.
  2563.  
  2564. P: Find Again and Replace Again don't continue in the same direction as the
  2565.    original Find or Replace.
  2566. S: Find Again and Replace Again don't use the direction of the original search. 
  2567.    The Shift key controls the direction: Ctrl+G means forward, Shift+Ctrl+G
  2568.    means backward.
  2569.  
  2570. P: Preferences specified in the Preferences menu don't seem to get saved when I
  2571.    select Save Defaults.
  2572. S: NEdit has two kinds of preferences: 1) per-window preferences, in the
  2573.    Preferences menu, and 2) default settings for preferences in newly created
  2574.    windows, in the Default Settings sub-menu of the Preferences menu.  Per-
  2575.    window preferences are not saved by Save Defaults, only Default Settings.
  2576.  
  2577. P: Columns and indentation don't line up.
  2578. S: NEdit is using a proportional width font.  Set the font to a fixed style
  2579.    (see PREFERENCES).
  2580.  
  2581. P: NEdit performs poorly on very large files.
  2582. S: Turn off Incremental Backup.  With Incremental Backup on, NEdit periodically
  2583.    writes a full copy of the file to disk.
  2584.  
  2585. P: Commands added to the Shell Commands menu (Unix only) don't output anything
  2586.    until they are finished executing.
  2587. S: If the command output is directed to a dialog, or the input is from a
  2588.    selection, output is collected together and held until the command
  2589.    completes.  De-select both of the options and the output will be shown
  2590.    incrementally as the command executes.
  2591.  
  2592. P: Dialogs don't automatically get keyboard focus when they pop up.
  2593. S: Most X Window managers allow you to choose between two categories of
  2594.    keyboard focus models: pointer focus, and explicit focus.  Pointer focus
  2595.    means that as you move the mouse around the screen, the window under the
  2596.    mouse automatically gets the keyboard focus.  NEdit users who use this focus
  2597.    model should set "Popups Under Pointer" in the Default Settings sub menu of
  2598.    the preferences menu in NEdit.  Users with the explicit focus model, in some
  2599.    cases, may have problems with certain dialogs, such as Find and Replace.  In
  2600.    MWM this is caused by the mwm resource startupKeyFocus being set to False
  2601.    (generally a bad choice for explicit focus users).  NCDwm users should use
  2602.    the focus model "click" instead of "explicit", again, unless you have set it
  2603.    that way to correct specific problems, this is the appropriate setting for
  2604.    most explicit focus users.
  2605.  
  2606. P: The Delete key doesn't forward-delete.
  2607. S: See the X Resources section on nedit.remapDeleteKey.
  2608.  
  2609. P: NEdit crashes when I try to paste text in to a text field in a dialog (like
  2610.    Find or Replace) on my SunOS system.
  2611. S: On many SunOS systems, you have to set up an nls directory before various
  2612.    inter-client communication features of Motif will function properly.  There
  2613.    are instructions in README.sun in /pub/nedit/v4_0_1 on ftp.fnal.gov, as well
  2614.    as a tar file containg a complete nls directory: ftp://ftp.fnal.gov/pub/
  2615.    nedit/v4_0_2/individual/README.sun.  This contains directions for setting up
  2616.    an nls directory, which is required by Motif for handling copy and paste to
  2617.    Motif text fields. 
  2618.  
  2619.  
  2620. KNOWN BUGS
  2621.  
  2622. Below is the list of known bugs which affect NEdit.  The bugs your copy of
  2623. NEdit will exhibit depend on which system you are running and with which Motif
  2624. libraries it was built.  Note that there are now Motif 1.2 and/or 2.0 libraries
  2625. available on ALL supported platforms, and as you can see below there are far
  2626. fewer bugs in Motif 1.2, so it is in your best interest to upgrade your system.
  2627.  
  2628. All Versions
  2629.  
  2630. BUG: Operations between rectangular selections on overlapping lines do nothing.
  2631. WORKAROUND: None.  These operations are very complicated and you probably
  2632.      wouldn't get what you expected anyhow.
  2633.  
  2634. BUG: Cut and Paste menu items fail, or possibly crash, for very large
  2635.      (multi-megabyte) selections.
  2636. WORKAROUND: Use selection copy (middle mouse button click) for transferring
  2637.      larger quantities of data.  Cut and Paste save the copied text in server
  2638.      memory, which is usually limited.
  2639.  
  2640. Motif 1.1 Versions
  2641.  
  2642. BUG: The shortcut method for entering control characters (Alt+Ctrl+char) is not
  2643.      available.
  2644. WORKAROUND: Use the Ins. Control Char command.
  2645.  
  2646. BUG: Pop-up dialogs "jump" (appear briefly in a different location) when they
  2647.      are first invoked.
  2648. WORKAROUND: Turn off "Popups Under Pointer" if this gives you a headache.
  2649.  
  2650. VMS Versions
  2651.  
  2652. BUGS: 1. Abbreviation of command line qualifiers is not allowed.
  2653.       2. Error messages for mistakes on the command line don't make sense.
  2654. WORKAROUND: NEdit does not parse its command line with the standard DCL command
  2655.       parser, instead, it superficially converts the command line to a
  2656.       Unix-style command line before processing it.  Because information is
  2657.       lost, NEdit may not always be able to distinguish between items that are
  2658.       supposed to be qualifiers and those which are supposed to be files and
  2659.       arguments to the qualifiers.  However, correct VMS command lines are
  2660.       always processed correctly, and only certain types of errors will appear
  2661.       to give strange results.
  2662.  
  2663. BUG: Protection settings for new versions of files produced by NEdit over
  2664.      DECNET connections may revert to defaults.
  2665. WORKAROUND: Check and reset protections when accessing files via DECNET.
  2666.  
  2667. IBM Versions built with Motif 1.1
  2668.  
  2669. BUG: The Command to set the font for the current window is not available.
  2670. WORKAROUND: Use the Default Settings sub-menu to set the default font and then
  2671.      create a new window.
  2672.  
  2673. BUG: NEdit can occasionally crash on window closing.
  2674. WORKAROUND: Save files frequently, see Crash Recovery.
  2675.  
  2676.  
  2677. MAILING LIST
  2678.  
  2679. There are now two separate mailing lists for NEdit users.  nedit_discuss, as
  2680. the name implies, is for open discussion among NEdit users.  nedit_announces
  2681. intended to be a very low volume mailing list for announcement of new versions,
  2682. new executables, and significant contributed software.
  2683.  
  2684. To subscribe to nedit_discuss, send a message containing the following line in
  2685. the body of the message (not the subject) to mailserv@fnal.gov:
  2686.  
  2687.     subscribe nedit_discuss
  2688.  
  2689. To subscribe to nedit_announce, send a separate message to mailserv@fnal.gov
  2690. containing the line:
  2691.  
  2692.     subscribe nedit_announce
  2693.  
  2694. To unsubscribe, send:
  2695.  
  2696.     unsubscribe nedit_discuss (or nedit_announce)
  2697.  
  2698. After subscribing, you will receive copies of all of the email submitted to the
  2699. list.  You may submit mail to the discussion list by sending it to:
  2700.  
  2701.     nedit_discuss@fnal.gov
  2702.  
  2703. Users are allowed to post to nedit_announce as well (just make sure that the
  2704. content is appropriate).
  2705.  
  2706.  
  2707. DISTRIBUTION POLICY
  2708.  
  2709. FermiTools Software Legal Information - November 1, 1996
  2710.  
  2711. COPYRIGHT STATUS:  Fermi National Accelerator Laboratory (FNAL) documents are
  2712. sponsored by the U.S. Department of Energy under Contract No.
  2713. DE-AC02-76CH03000.  Therefore, the U.S. Government retains a non-exclusive,
  2714. royalty-free license to publish or reproduce these documents or software for
  2715. U.S. Government purposes.  All documents and software available from this
  2716. server are protected under the U.S. and Foreign Copyright Laws, and FNAL
  2717. reserves all rights.
  2718.  
  2719. Terms and Conditions
  2720.  
  2721. When a User distributes or otherwise obtains a software package included in
  2722. the Fermilab Software Tools Program, the user agrees to abide by the Terms and
  2723. Conditions of the Program below:
  2724.  
  2725.    o Any redistribution of the software shall be accompanied by this
  2726.      INFORMATION/LICENSE AGREEMENT and the product's ORIGIN STATEMENT (below).
  2727.  
  2728.    o The User shall acknowledge the origin of the software as set forth 
  2729.      below:
  2730.  
  2731.         "This work was performed at Fermi National Accelerator Laboratory, 
  2732.          operated by Universities Research Association, Inc., under contract 
  2733.          DE-AC02-76CH03000 with the U.S. Department of Energy."
  2734.  
  2735.    o The user is asked to feed back problems, benefits, and/or suggestions 
  2736.      about the software to the Fermilab Software Providers and/or FermiTools 
  2737.      management.
  2738.  
  2739.    o Any distribution of the software available from this server shall be  at
  2740.      no charge.  To obtain a license to commercialize any of the software
  2741.      programs available from Fermilab including this software, contact FNAL's
  2742.      Office of Research and Technology Applications, P.O. Box 500, MS-200,
  2743.      Batavia, IL 60510-0500.
  2744.  
  2745. Indemnification by User of Third Party Claims and Disclosure of Liability
  2746.  
  2747. The User, his/her directors, officers, employees, and agents hereby release
  2748. and waive all claims against Universities Research Association, Inc. (URA)
  2749. operator of Fermi National Accelerator Laboratory, its trustees, overseers,
  2750. directors, officers, employees, agents, subcontractors, successors and
  2751. assigns, for any and all liability and damages arising from the reproduction,
  2752. use or other disposition of the software.  The User shall indemnify URA and
  2753. the U.S. Government for all damages, costs or expenses, including attorney's
  2754. fees, arising from the utilization of the software, including, but not limited
  2755. to, the making, using, selling or exporting of products, processes or services
  2756. derived from the Software.  The User agrees to indemnify, hold harmless and
  2757. defend URA, its trustees, overseers, directors, officers, employees, agents,
  2758. subcontractors, successors and assigns, against any and all liability, damage,
  2759. loss, cost, charge, claim, demand, fee or expense of every nature and kind
  2760. which may at any time hereafter, be sustained by URA by reason of claims of
  2761. third parties arising out of alleged acts or omissions of the User in the
  2762. reproduction, use or other disposition of the Software.  
  2763.  
  2764. The User agrees that URA, its trustees, overseers, directors, officers,
  2765. employees, agents, subcontractors, successors and assigns shall not be liable
  2766. under any claim, charge, or demand, whether in contract, tort, criminal law,
  2767. or otherwise, for any and all loss, cost, charge, claim, demand, fee, expense,
  2768. or damage of every nature and kind arising out of, connected with, resulting
  2769. from or sustained as a result of the use of the software programs available
  2770. from this server.  In no event shall URA be liable for special, direct,
  2771. indirect or consequential damages, losses, costs, charges, claims, demands,
  2772. fees or expenses of any nature or kind.
  2773.  
  2774. Disclaimer of Warranties
  2775.  
  2776. The software is provided on an "as is" basis only.  URA makes no
  2777. representations, express or implied.  URA makes no representations or
  2778. warranties of merchantability or fitness for any particular purpose, or
  2779. assumes any legal liability or responsibility for the accuracy, completeness,
  2780. or usefulness of any information, apparatus, product or process disclosed, or
  2781. represents that the Software will not infringe any privately held patent,
  2782. copyright, or trademark.  The entire risk as to the results and the
  2783. performance of this software is assumed by the User.
  2784.  
  2785. Disclaimer of Endorsement
  2786.  
  2787. Reference herein to any specific commercial products, process, or service by
  2788. tradename, trademark, manufacturer or otherwise, does not constitute or imply
  2789. its endorsement, recommendation, or favoring by the United States Government,
  2790. U.S. Department of Energy or URA.  The views and opinions of individuals
  2791. expressed herein do not necessarily state or reflect those of the United
  2792. States Government, U.S. Department of Energy or URA and shall not be used for
  2793. advertising or product endorsement purposes.
  2794.  
  2795. Liabilities of the Government
  2796.  
  2797. This software is provided by URA, independent from its Prime Contract with the
  2798. U.S. Department of Energy.  URA is acting independently from the Government
  2799. and in its own private capacity and is not acting on behalf of the U.S.
  2800. Government, nor as its contractor nor its agent.  Correspondingly, it is
  2801. understood and agreed that the U.S. Government has no connection to this
  2802. software and in no manner whatsoever shall be liable for nor assume any
  2803. responsibility or obligation for any claim, cost, or damages arising out of or
  2804. resulting from the use of the software available from this server.
  2805.  
  2806. ORIGIN STATEMENT
  2807.  
  2808. Authors
  2809.  
  2810. Mark Edel, Joy Kyriakopulos, Arnulfo Zepeda-Navratil, Suresh Ravoor, Donna Reid,
  2811. Jeff Kallenbach
  2812.  
  2813. Fermi National Accelerator Laboratory
  2814. MS 234
  2815. P.O.Box 500
  2816. Batavia, IL 60510
  2817.  
  2818. EMAIL: edel@fnal.gov
  2819.  
  2820. Acknowledgements:
  2821.  
  2822. Syntax highlighting patterns were contributed by: Simon T. MacDonald,  Maurice
  2823. Leysens, Matt Majka, Alfred Smeenk, Alain Fargues, Christopher Conrad, Scott
  2824. Markinson, Konrad Bernloehr, Ivan Herman, Patrice Venant, Christian Denat, and
  2825. Philippe Couton.
  2826.  
  2827. Regular expression code by Henry Spencer
  2828.  
  2829. Nedit incorporates an altered version of Henry Spencer's regcomp and regexec
  2830. code adapted for NEdit. Original copyright notice:
  2831.  
  2832. Copyright (c) 1986 by University of Toronto. Written by Henry Spencer.  Not
  2833. derived from licensed software.
  2834.  
  2835. Permission is granted to anyone to use this software for any purpose on any
  2836. computer system, and to redistribute it freely, subject to the following
  2837. restrictions:
  2838.  
  2839. 1. The author is not responsible for the consequences of use of this software,
  2840. no matter how awful, even if they arise from defects in it.
  2841.  
  2842. 2. The origin of this software must not be misrepresented, either by explicit
  2843. claim or by omission.
  2844.  
  2845. 3. Altered versions must be plainly marked as such, and must not be
  2846. misrepresented as being the original software.
  2847.  
  2848. End of INFORMATION/LICENSE AGREEMENT FOR NEDIT.
  2849.  
  2850. Send questions and comments to: nedit_support@fnal.gov.
  2851.