help.c: switch to "January, 2001"
[nedit.git] / source / help.c
blob338b73f00afa9cb815da4aa6843c6f23886f746e
1 /*******************************************************************************
2 * *
3 * help.c -- Nirvana Editor help display *
4 * *
5 * Copyright (C) 1999 Mark Edel *
6 * *
7 * This is free software; you can redistribute it and/or modify it under the *
8 * terms of the GNU General Public License as published by the Free Software *
9 * Foundation; either version 2 of the License, or (at your option) any later *
10 * version. *
11 * *
12 * This software is distributed in the hope that it will be useful, but WITHOUT *
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
15 * for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License along with *
18 * software; if not, write to the Free Software Foundation, Inc., 59 Temple *
19 * Place, Suite 330, Boston, MA 02111-1307 USA *
20 * *
21 * Nirvana Text Editor *
22 * September 10, 1991 *
23 * *
24 * Written by Mark Edel *
25 * *
26 *******************************************************************************/
27 #ifdef VMS
28 #include "../util/VMSparam.h"
29 #else
30 #ifndef __MVS__
31 #include <sys/param.h>
32 #endif
33 #endif /*VMS*/
34 #include <Xm/Xm.h>
35 #include <Xm/Form.h>
36 #include <Xm/ScrolledW.h>
37 #include <Xm/ScrollBar.h>
38 #include <Xm/PushB.h>
39 #include "../util/misc.h"
40 #include "../util/DialogF.h"
41 #include "textBuf.h"
42 #include "text.h"
43 #include "textSel.h"
44 #include "nedit.h"
45 #include "search.h"
46 #include "window.h"
47 #include "preferences.h"
48 #include "help.h"
49 #include "file.h"
51 static char *HelpTitles[NUM_TOPICS] = {
52 "Version",
53 "Getting Started",
54 "Finding and Replacing Text",
55 "Selecting Text",
56 "Cut and Paste",
57 "Auto / Smart Indent",
58 "Tabs / Emulated Tabs",
59 "Programming with NEdit",
60 "Finding Declarations (ctags)",
61 "Using the Mouse",
62 "Keyboard Shortcuts",
63 "Shifting and Filling",
64 "File Format",
65 "Syntax Highlighting",
66 "Crash Recovery",
67 "Preferences",
68 "Shell Commands/Filters",
69 "Regular Expressions: Basic Syntax",
70 "Regular Expressions: Escape Sequences",
71 "Regular Expressions: Parenthetical Constructs",
72 "Regular Expressions: Advanced Topics",
73 "Regular Expressions: Examples",
74 "NEdit Command Line",
75 "Server Mode and nc",
76 "Customizing NEdit",
77 "X Resources",
78 "Key Binding",
79 "Learn/Replay",
80 "Macro Language",
81 "Macro Subroutines",
82 "Action Routines",
83 "Highlighting Patterns",
84 "Smart Indent Macros",
85 "Problems/Bugs",
86 "Mailing Lists",
87 "Distribution Policy",
88 "Tabs Dialog"};
90 static char *HelpText[NUM_TOPICS] = {
91 "NEdit Version 5.2 DEVELOPMENT version\n\
92 January, 2001\n\
93 \n\
94 NEdit was written by Mark Edel, Joy Kyriakopulos, Christopher Conrad, \
95 Jim Clark, Arnulfo Zepeda-Navratil, \
96 Suresh Ravoor, Tony Balinski, Max Vohlken, Yunliang Yu, and Donna Reid.\n\
97 \n\
98 The regular expression matching routines used in NEdit are adapted (with \
99 permission) from original code written by Henry Spencer at the \
100 University of Toronto.\n\
102 Syntax highlighting patterns and smart indent macros were contributed by: \
103 Simon T. MacDonald, Maurice Leysens, Matt Majka, Alfred Smeenk, \
104 Alain Fargues, Christopher Conrad, Scott Markinson, Konrad Bernloehr, \
105 Ivan Herman, Patrice Venant, Christian Denat, Philippe Couton, \
106 Max Vohlken, Markus Schwarzenberg, Himanshu Gohel, Steven C. Kapp, \
107 Michael Turomsha, John Fieber, Chris Ross, Nathaniel Gray, Joachim Lous, \
108 Mike Duigou, and Seak, Teng-Fong.\n\
110 NEdit sources, executables, additional documentation, and contributed \
111 software are available from the nedit web site at http://nedit.org.\n\
113 This program is free software; you can redistribute it and/or \
114 modify it under the terms of the GNU General Public License \
115 as published by the Free Software Foundation; either version 2 \
116 of the License, or (at your option) any later version.\n\
118 This program is distributed in the hope that it will be useful, \
119 but WITHOUT ANY WARRANTY; without even the implied warranty of \
120 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \
121 GNU General Public License in the Help section \"Distribution \
122 Policy\" for more details.",
124 "Welcome to NEdit!\n\
126 NEdit is a standard GUI (Graphical User Interface) style text editor for \
127 programs and plain-text files. Users of Macintosh and MS Windows based \
128 text editors should find NEdit a familiar and comfortable environment. \
129 NEdit provides all of the standard menu, dialog, editing, and mouse \
130 support, as well as all of the standard shortcuts to which the users \
131 of modern GUI based environments are accustomed. For users of older \
132 style Unix editors, welcome to the world of mouse-based editing!\n\
134 Help sections of interest to new users are listed under the \"Basic \
135 Operation\" heading in the top-level Help menu:\n\
137 Selecting Text\n\
138 Finding and Replacing Text\n\
139 Cut and Paste\n\
140 Using the Mouse\n\
141 Keyboard Shortcuts\n\
142 Shifting and Filling\n\
144 Programmers should also read the introductory section under the \
145 \"Features for Programming\" section:\n\
147 Programming with NEdit\n\
149 If you get into trouble, the Undo command in the Edit menu can reverse \
150 any modifications that you make. NEdit does not change the file you are \
151 editing until you tell it to Save.\n\
153 Editing an Existing File\n\
155 To open an existing file, choose Open... from the file menu. Select the \
156 file that you want to open in the pop-up dialog that appears and click on \
157 OK. You may open any number of files at the same time. Each file will \
158 appear in its own editor window. Using Open... rather than re-typing the \
159 NEdit command and running additional copies of NEdit, will give you quick \
160 access to all of the files you have open via the Windows menu, and ensure \
161 that you don't accidentally open the same file twice. NEdit has no \
162 \"main\" window. It remains running as long as at least one editor window \
163 is open.\n\
165 Creating a New File\n\
167 If you already have an empty (Untitled) window displayed, just begin \
168 typing in the window. To create a new Untitled window, choose New from \
169 the File menu. To give the file a name and save its contents to the \
170 disk, choose Save or Save As... from the File menu.\n\
172 Backup Files\n\
174 NEdit maintains periodic backups of the file you are editing so that you \
175 can recover the file in the event of a problem such as a system crash, \
176 network failure, or X server crash. These files are saved under the name \
177 ~filename (on Unix) or _filename (on VMS), where filename is the name of \
178 the file you were editing. If an NEdit process is killed, some of these \
179 backup files may remain in your directory. (To remove one of these files \
180 on Unix, you may have to prefix the ~ (tilde) character with a \
181 (backslash) to prevent the shell from interpreting it as a special \
182 character.)\n\
184 Shortcuts\n\
186 As you become more familiar with NEdit, substitute the control and \
187 function keys shown on the right side of the menus for pulling down menus \
188 with the mouse.\n\
190 Dialogs are also streamlined so you can enter information quickly and \
191 without using the mouse*. To move the keyboard focus around a dialog, \
192 use the tab and arrow keys. One of the buttons in a dialog is usually \
193 drawn with a thick, indented, outline. This button can be activated by \
194 pressing Return or Enter. The Cancel or Dismiss button can be activated \
195 by pressing escape. For example, to replace the string \"thing\" with \
196 \"things\" type:\n\
198 <ctrl-r>thing<tab>things<return>\n\
200 To open a file named \"whole_earth.c\", type:\n\
202 <ctrl-o>who<return>\n\
204 (how much of the filename you need to type depends on the other files in \
205 the directory). See the section called Keyboard Shortcuts for more \
206 details.\n\
208 * Users who have set their keyboard focus mode to \"pointer\" should set \
209 \"Popups Under Pointer\" in the Default Settings menu to avoid the \
210 additional step of moving the mouse into the dialog.",
212 "The Search menu contains a number of commands for finding and replacing text.\n\
214 The Find... and Replace... commands present dialogs for entering text for \
215 searching and replacing. These dialogs also allow you to choose whether you \
216 want the search to be sensitive to upper and lower case, or whether to use the \
217 standard Unix pattern matching characters (regular expressions). Searches \
218 begin at the current text insertion position.\n\
220 Find Again and Replace Again repeat the last find or replace command without \
221 prompting for search strings. To selectively replace text, use the two \
222 commands in combination: Find Again, then Replace Again if \
223 the highlighted string should be replaced, or Find Again again to go to the \
224 next string.\n\
226 Find Selection searches for the text contained in the current primary \
227 selection (see Selecting Text). The selected text does not have to \
228 be in the current editor window, it may even be in another program. For \
229 example, if the word dog appears somewhere in a window on your screen, and \
230 you want to find it in the file you are editing, select the \
231 word dog by dragging the mouse across it, switch to your NEdit window and \
232 choose Find Selection from the Search menu.\n\
234 Find Incremental is yet another variation on searching, where every \
235 character typed triggers a new search. Incremental searching is \
236 generally the quickest way to find something in a file, because it \
237 gives you the immediate feedback of seeing how your search is \
238 progressing, so you never need to type more than the minimally \
239 sufficient search string to reach your target.\n\
241 Searching Backwards\n\
243 Holding down the shift key while choosing any of the search or replace \
244 commands from the menu (or using the keyboard shortcut), will search in \
245 the reverse direction. Users who have set the search direction using \
246 the buttons in the search dialog, may find it a bit confusing that Find \
247 Again and Replace Again don't continue in the same direction as the \
248 original search (for experienced users, consistency \
249 of the direction implied by the shift key is more important).\n\
251 Selective Replacement\n\
253 To replace only some occurrences of a string within a file, choose Replace... \
254 from the Search menu, enter the string to search for and the string to \
255 substitute, and finish by pressing the Find button. When the first \
256 occurrence is highlighted, use either Replace Again (^T) to replace it, or \
257 Find Again (^G) to move to the next occurrence without replacing it, and \
258 continue in such a manner through all occurrences of interest.\n\
260 To replace all occurrences of a string within some range of text, \
261 select the range (see Selecting Text), choose Replace... from the \
262 Search menu, type the string to search for and the string to substitute, and \
263 press the \"R. in Selection\" button in the dialog. Note that selecting text \
264 in the Replace... dialog will unselect the text in the window.",
266 "NEdit \
267 has two general types of selections, primary (highlighted text), and \
268 secondary (underlined text). Selections can cover either \
269 a simple range of text between two points in the file, or they can \
270 cover a rectangular area of the file. Rectangular selections \
271 are only useful with non-proportional (fixed spacing) fonts.\n\
273 To select text for copying, deleting, or replacing, press the left \
274 mouse button with the pointer at one end of the text you want to select, \
275 and drag it to the other end. The text will become highlighted. To \
276 select a whole word, double click (click twice quickly in succession). \
277 Double clicking and then dragging the mouse will select a number of words. \
278 Similarly, you can select \
279 a whole line or a number of lines by triple clicking or triple clicking and \
280 dragging. Quadruple clicking selects the whole file. \
281 After releasing the mouse button, you can still adjust a selection \
282 by holding down the shift key and dragging on either end of the selection. \
283 To delete the selected text, press delete or backspace. To replace it, \
284 begin typing.\n\
286 To select a rectangle or column of text, hold the Ctrl key while dragging \
287 the mouse. Rectangular selections can be used in any context that \
288 normal selections can be used, including cutting and pasting, filling, \
289 shifting, dragging, and searching. Operations on rectangular selections \
290 automatically fill in tabs and spaces to maintain alignment of text \
291 within and to the right of the selection. Note that the interpretation \
292 of rectangular selections by Fill Paragraph is slightly different from that \
293 of other commands, the section titled \"Shifting and Filling\" has details.\n\
295 The middle mouse button can be used to make an \
296 additional selection (called the secondary selection). As soon as the \
297 button is released, the contents of this selection will be \
298 copied to the insert position of the window where the mouse was last \
299 clicked (the destination window). This position is marked by a caret \
300 shaped cursor when the \
301 mouse is outside of the destination window. \
302 If there is a (primary) selection, adjacent to the cursor \
303 in the window, \
304 the new text will replace the selected text. Holding the shift key \
305 while making the secondary selection will move the text, deleting it \
306 at the site of the secondary selection, rather than \
307 copying it.\n\
309 Selected text can also be dragged to a new location in the file using the \
310 middle mouse button. Holding the shift key while \
311 dragging the text will copy the selected text, leaving the original \
312 text in place. Holding the control key will drag the text in overlay \
313 mode.\n\
315 Normally, dragging moves text by removing it from the \
316 selected position at the start of the drag, and inserting it at a \
317 new position relative to to the mouse. Dragging a block of text \
318 over existing characters, displaces the characters to \
319 the end of the selection. In overlay mode, characters which are \
320 occluded by blocks of text being dragged are simply removed. When \
321 dragging non-rectangular selections, overlay mode also converts the \
322 selection to rectangular form, allowing it to be dragged outside of \
323 the bounds of the existing text.\n\
325 The section \"Using the Mouse\" sumarizes the mouse commands for making \
326 primary and secondary selections. Primary selections can also be made \
327 via keyboard commands, see \"Keyboard Shortcuts\".",
329 "The easiest way to copy and move text around in your file or between \
330 windows, is to use the clipboard, an imaginary area that temporarily stores \
331 text and data. The Cut command removes the \
332 selected text (see Selecting Text) from your file and places it in the \
333 clipboard. Once text is in \
334 the clipboard, the Paste command will copy it to the insert position in the \
335 current window. For example, to move some text from one place to another, \
336 select it by \
337 dragging the mouse over it, choose Cut to remove it, \
338 click the pointer to move the insert point where you want the text inserted, \
339 then choose Paste to insert it. Copy copies text to the clipboard without \
340 deleting it from your file. You can also use the clipboard to transfer text \
341 to and from other Motif programs and X programs which make proper use of \
342 the clipboard.\n\
344 There are many other methods for copying and moving text within \
345 NEdit windows and between NEdit and other programs. The most common \
346 such method is clicking the middle mouse button to copy the primary \
347 selection (to the clicked position). Copying the selection by clicking \
348 the middle mouse button in many cases is the only way to transfer data \
349 to and from many X programs. Holding the Shift key while clicking the \
350 middle mouse button moves the text, deleting it from its original \
351 position, rather than copying it. Other methods for transferring text \
352 include secondary selections, primary selection dragging, keyboard-based \
353 selection copying, and drag and drop. These are described in detail in \
354 the sections: Selecting Text, Using the Mouse, and Keyboard Shortcuts.",
357 "Programmers who use structured languages usually require some form of \
358 automatic indent, so that they don't have to continually re-type the \
359 sequences of tabs and/or spaces needed to maintain lengthy running indents. \
360 Version 5.0 of NEdit is the first release of NEdit to offer \"smart\" \
361 indent, at least experimentally, in addition to the traditional automatic \
362 indent which simply lines up the cursor position with the previous line.\n\
364 Smart Indent\n\
366 Smart Indent in this release must still be considered somewhat \
367 experimental. Smart indent macros are only available by default for C \
368 and C++, and while these can easily be configured for different default \
369 indentation distances, they may not conform to everyone's exact C \
370 programming style. Smart indent is programmed in terms of macros in the \
371 NEdit macro language which can be entered in: Preferences -> Default \
372 Settings -> Indent -> Program Smart Indent. Hooks are provided for \
373 intervening at the point that a newline is entered, either via the user \
374 pressing the Enter key, or through auto-wrapping; and for arbitrary \
375 type-in to act on specific characters typed.\n\
377 To type a newline character without invoking smart-indent when operating \
378 in smart-indent mode, hold the Ctrl key while pressing the Return or \
379 Enter key.\n\
381 Auto-Indent\n\
383 With Indent set to Auto (the default), NEdit keeps a running indent. \
384 When you press the Return or Enter key, \
385 spaces and tabs are inserted to line up the insert point under the start of \
386 the previous line. Ctrl+Return in auto-indent mode acts like a normal \
387 Return, With auto-indent turned off, Ctrl+Return does indentation.\n\
389 Block Indentation Adjustment\n\
391 The Shift Left and Shift Right commands as well as rectangular dragging \
392 can be used to adjust the \
393 indentation for several lines at once. To shift a block of text one \
394 character \
395 to the right, select the text, then choose Shift Right from the Edit menu. \
396 Note that the accelerator keys for these menu items are Ctrl+9 and Ctrl+0, \
397 which correspond to the right and left parenthesis on most keyboards. \
398 Remember them as adjusting the text in the direction pointed to by the \
399 parenthesis character. Holding the Shift key while selecting either \
400 Shift Left or Shift Right will shift the text by one tab stop (or by one \
401 emulated tab stop if tab emulation is turned on). The help section \
402 \"Shifting and Filling\" under \"Basic Operation\" has details.",
405 "Changing the Tab Distance\n\
407 Tabs are important for programming in languages which use indentation \
408 to show nesting, as short-hand for producing white-space for leading \
409 indents. As a programmer, you have to decide how to use indentation, \
410 and how or whether tab characters map to your indentation scheme.\n\
412 Ideally, tab characters map directly to the amount of indent that you \
413 use to distinguish nesting levels in your code. Unfortunately, the \
414 Unix standard for interpretation of tab characters is eight characters \
415 (probably dating back to mechanical capabilities of the original \
416 teletype), which is usually too coarse for a single indent.\n\
418 Most text editors, NEdit included, allow you to change the \
419 interpretation of the tab character, and many programmers take \
420 advantage of this, and set their tabs to 3 or 4 characters to match \
421 their programming style. In NEdit you set the hardware tab distance in \
422 Preferences -> Tabs... for the current window, or Preferences -> \
423 Default Settings -> Tabs... (general), or Preferences -> Default \
424 Settings -> Language Modes... (language-specific) to change the \
425 defaults for future windows.\n\
427 Changing the meaning of the tab character makes programming much easier \
428 while you're in the editor, but can cause you headaches outside of the \
429 editor, because there is no way to pass along the tab setting as part \
430 of a plain-text file. All of the other tools which display, print, and \
431 otherwise process your source code have to be made aware of how the \
432 tabs are set, and must be able to handle the change. Non-standard tabs \
433 can also confuse other programmers, or make editing your code difficult \
434 for them if their text editors don't support changes in tab distance.\n\
436 Emulated Tabs\n\
438 An alternative to changing the interpretation of the tab character is \
439 tab emulation. In the Tabs... dialog(s), turning on Emulated Tabs \
440 causes the Tab key to insert the correct number of spaces and/or tabs \
441 to bring the cursor the next emulated tab stop, as if tabs were set at \
442 the emulated tab distance rather than the hardware tab distance. \
443 Backspacing immediately after entering an emulated tab will delete the \
444 fictitious tab as a unit, but as soon as you move the cursor away from \
445 the spot, NEdit will forget that the collection of spaces and tabs is a \
446 tab, and will treat it as separate characters. To enter a real tab \
447 character with \"Emulate Tabs\" turned on, use Ctrl+Tab.\n\
449 It is also possible to tell NEdit not to insert ANY tab characters at \
450 all in the course of processing emulated tabs, and in shifting and \
451 rectangular insertion/deletion operations, for programmers who worry \
452 about the misinterpretation of tab characters on other systems.",
454 "Though general in appearance, NEdit has many \
455 features intended specifically for programmers. Major \
456 programming-related topics are listed in separate sections under the heading: \
457 \"Features for Programming\": Syntax Highlighting, \
458 Tabs and Tab Emulation, ctags support, and Automatic Indent. Minor topics \
459 related to programming are discussed below:\n\
461 Language Modes\n\
463 When nedit initially reads a file, it attempts to determine whether the \
464 file is in one of the computer languages that it knows about. Knowing \
465 what language a file is written in allows NEdit to assign highlight \
466 patterns and smart indent macros, and to set language specific \
467 preferences like word delimiters, tab emulation, and auto-indent. \
468 Language mode can be recognized from both the file name and from the \
469 first 200 characters of content. Language mode recognition and \
470 language-specific preferences are configured \
471 in: Preferences -> Default Settings -> Language Modes....\n\
473 You can set the language mode manually for a window, by selecting \
474 it from the menu: Preferences -> Language Modes.\n\
476 Line Numbers\n\
478 To find a particular line in a source file by line number, choose Goto \
479 Line #... from the Search menu. You can also directly select the line \
480 number text in the compiler message in the terminal emulator window \
481 (xterm, decterm, winterm, etc.) where you ran the compiler, and choose \
482 Goto Selected from the Search menu.\n\
484 To find out the line number of a particular line in your file, turn on \
485 Statistics Line in the Preferences menu and position the insertion point \
486 anywhere on the line. The statistics line continuously updates the line \
487 number of the line containing the cursor.\n\
489 Matching Parentheses\n\
491 To help you inspect nested parentheses, brackets, braces, quotes, and other \
492 characters, NEdit has both an automatic parenthesis matching mode, and a \
493 Goto Matching command. Automatic parenthesis matching is activated when \
494 you type, or move the insertion cursor after a parenthesis, bracket, or \
495 brace. It momentarily highlights the matching character if that character \
496 is visible in the window. To find a matching character anywhere in \
497 the file, select it or position the cursor after it, and choose Goto \
498 Matching from the Search menu. If \
499 the character matches itself, such as a quote or slash, select the first \
500 character of the pair. NEdit will match {, (, [, <, \", \', `, /, and \\. \
501 Holding the Shift key while typing the accelerator key (Shift+Ctrl+M, by \
502 default),will select all of the text between the matching characters.\n\
504 Opening Included Files\n\
506 The Open Selected command in the File menu understands the C \
507 preprocessor's #include \
508 syntax, so selecting an #include line and invoking Open Selected will \
509 generally find the file referred to, unless doing so depends on the \
510 settings of compiler switches or other information not available to NEdit.\n\
512 Interface to Programming Tools\n\
514 Integrated software development environments such as SGI's CaseVision and \
515 Centerline Software's Code Center, can be interfaced \
516 directly with NEdit via the client server interface. These \
517 tools allow you to click directly on compiler and runtime error messages \
518 and request NEdit to open files, and select lines of interest. \
519 The easiest method is usually to use \
520 the tool's interface for character-based editors like vi, to invoke nc, \
521 but programmatic interfaces can also be derived using the source code \
522 for nc.\n\
524 There are also some simple compile/review, grep, ctree, and ctags browsers \
525 available in the NEdit contrib directory on ftp.nedit.org.",
527 "NEdit can process tags files generated using the Unix ctags command or \
528 the Exuberant Ctags program. \
529 Ctags creates index files correlating names of functions and declarations \
530 with their locations in C, Fortran, or Pascal source code files. (See the \
531 ctags manual page for more information). Ctags produces a file called \
532 \"tags\" which can be loaded by NEdit. NEdit can manage any number of \
533 tags files simultaneously. Tag collisions are handled with a popup menu \
534 to let the user decide which tag to use. In 'Smart' mode NEdit will \
535 automatically choose the desired tag based on the scope of the file or \
536 module. Once loaded, the information in \
537 the tags file enables NEdit to go directly to the declaration of a \
538 highlighted function or data structure name with a single command. To \
539 load a tags file, select \"Load Tags File\" from the File menu and choose \
540 a tags file to load, or specify the name of the tags file on the NEdit \
541 command line:\n\
543 nedit -tags tags\n\
545 NEdit can also be set to load a tags file automatically when it starts up. \
546 Setting the X resource nedit.tagFile to the name of a tag file tells NEdit \
547 to look for that file at startup time (see Customizing NEdit). The file name \
548 can be either a complete path name, in which case NEdit will always load \
549 the same tags file, or a file name without a path or with a relative path, \
550 in which case NEdit will load it starting from the current directory. The \
551 second option allows you to have different tags files for different \
552 projects, each automatically loaded depending on the directory you're in \
553 when you start NEdit. Setting the name to \"tags\" is an obvious choice \
554 since this is the name that ctags uses.\n\
556 To unload a tags file, select \"Un-load Tags File\" from the File menu \
557 and choose from the list of tags files. NEdit will keep track of tags \
558 file updates by checking the timestamp on the files, and automatically \
559 update the tags cache. \n\
561 To find the definition of a function or data structure once a tags file is \
562 loaded, select the name anywhere it appears in your program (see Selecting \
563 Text) and choose \"Find Definition\" from the Search menu.",
565 "Mouse-based \
566 editing is what NEdit is all about, and learning to use the more advanced \
567 features like secondary selections and primary selection \
568 dragging will be well worth your while.\n\
570 If you don't have time to learn everything, you can get by adequately with \
571 just the left mouse button: Clicking the left button \
572 moves the cursor. \
573 Dragging with the left button makes a selection. Holding the shift \
574 key while clicking extends the existing selection, or begins a selection \
575 between the cursor and the mouse. Double or triple clicking selects a \
576 whole word or a whole line.\n\
578 This section will make more sense if you also read the section called, \
579 \"Selecting Text\", which explains the terminology of selections, i.e. \
580 what is meant by primary, secondary, rectangular, etc.\n\
583 GENERAL\n\
585 General meaning of mouse buttons and modifier keys:\n\
587 Buttons\n\
589 Button 1 (left) Cursor position and primary selection\n\
591 Button 2 (middle) Secondary selections, and dragging and\n\
592 copying the primary selection\n\
594 Button 3 (right) Quick-access programmable menu and pan\n\
595 scrolling\n\
597 Modifier keys\n\
599 Shift On primary selections, (left mouse button):\n\
600 Extends selection to the mouse pointer\n\
601 On secondary and copy operations, (middle):\n\
602 Toggles between move and copy\n\
604 Ctrl Makes selection rectangular or insertion\n\
605 columnar\n\
607 Alt* (on release) Exchange primary and secondary\n\
608 selections.\n\
611 Left Mouse Button\n\
613 The left mouse button is used to position the cursor and to make primary \
614 selections\n\
616 Click Moves the cursor\n\
618 Double Click Selects a whole word\n\
620 Triple Click Selects a whole line\n\
622 Quad Click Selects the whole file\n\
624 Shift Click Adjusts (extends or shrinks) the\n\
625 selection, or if there is no existing\n\
626 selection, begins a new selection\n\
627 between the cursor and the mouse.\n\
629 Ctrl+Shift+ Adjusts (extends or shrinks) the\n\
630 Click selection rectangularly.\n\
632 Drag Selects text between where the mouse\n\
633 was pressed and where it was released.\n\
635 Ctrl+Drag Selects rectangle between where the\n\
636 mouse was pressed and where it was\n\
637 released.\n\
640 Right Mouse Button\n\
642 The right mouse button posts a programmable menu for frequently used \
643 commands.\n\
645 Click/Drag Pops up the background menu (programmed\n\
646 from Preferences -> Default Settings ->\n\
647 Customize Menus -> Window Background).\n\
649 Ctrl+Drag Pan scrolling. Scrolls the window\n\
650 both vertically and horizontally, as if\n\
651 you had grabbed it with your mouse.\n\
654 Middle Mouse Button\n\
656 The middle mouse button is for making secondary selections, and copying and \
657 dragging the primary selection\n\
659 Click Copies the primary selection to the\n\
660 clicked position.\n\
662 Shift+Click Moves the primary selection to the\n\
663 clicked position, deleting it from its\n\
664 original position.\n\
666 Drag 1) Outside of the primary selection:\n\
667 Begins a secondary selection.\n\
668 2) Inside of the primary selection:\n\
669 Moves the selection by dragging.\n\
671 Ctrl+Drag 1) Outside of the primary selection:\n\
672 Begins a rectangular secondary\n\
673 selection.\n\
674 2) Inside of the primary selection:\n\
675 Drags the selection in overlay\n\
676 mode (see below).\n\
678 When the mouse button is released after creating a secondary selection:\n\
680 No Modifiers If there is a primary selection,\n\
681 replaces it with the secondary\n\
682 selection. Otherwise, inserts the\n\
683 secondary selection at the cursor\n\
684 position.\n\
686 Shift Move the secondary selection, deleting\n\
687 it from its original position. If\n\
688 there is a primary selection, the move\n\
689 will replace the primary selection\n\
690 with the secondary selection.\n\
691 Otherwise, moves the secondary\n\
692 selection to to the cursor position.\n\
694 Alt* Exchange the primary and secondary\n\
695 selections.\n\
698 While moving the primary selection by dragging with the middle mouse button:\n\
700 Shift Leaves a copy of the original\n\
701 selection in place rather than\n\
702 removing it or blanking the area.\n\
704 Ctrl Changes from insert mode to overlay\n\
705 mode (see below).\n\
707 Escape Cancels drag in progress.\n\
709 Overlay Mode: Normally, dragging moves text by removing it from the \
710 selected position at the start of the drag, and inserting it at a \
711 new position relative to to the mouse. When you drag a block of text \
712 over existing characters, the existing characters are displaced to \
713 the end of the selection. In overlay mode, characters which are \
714 occluded by blocks of text being dragged are simply removed. When \
715 dragging non-rectangular selections, overlay mode also converts the \
716 selection to rectangular form, allowing it to be dragged outside of \
717 the bounds of the existing text.\n\
720 * The Alt key may be labeled Meta or Compose-Character on some \
721 keyboards. Some window managers, including default configurations \
722 of mwm, bind combinations of the Alt key and mouse buttons to window \
723 manager operations. In NEdit, Alt is only used on button release, \
724 so regardless of the window manager bindings for Alt-modified mouse \
725 buttons, you can still do the corresponding NEdit operation by using \
726 the Alt key AFTER the initial mouse press, so that Alt is held while \
727 you release the mouse button. If you find this difficult or \
728 annoying, you can re-configure most window managers to skip this \
729 binding, or you can re-configure NEdit to use a different key \
730 combination.",
732 "Most of the keyboard shortcuts in NEdit are shown on the right hand sides \
733 of the pull-down menus. However, there are more which are not as obvious. \
734 These include; dialog button shortcuts; menu and \
735 dialog mnemonics; labeled keyboard keys, such as the arrows, page-up, \
736 page-down, and home; and optional Shift modifiers on accelerator keys, like \
737 [Shift]Ctrl+F.\n\
740 Menu Accelerators\n\
742 Pressing the key combinations shown on the right of the menu items is a \
743 shortcut for selecting the menu item with the mouse. Some items have the \
744 shift key enclosed in brackets, such as [Shift]Ctrl+F. This indicates \
745 that the shift key is optional. In search commands, including the shift \
746 key reverses the direction of the search. In Shift commands, it makes the \
747 command shift the selected text by a whole tab stop rather than by \
748 single characters.\n\
751 Menu Mnemonics\n\
753 Pressing the Alt key in combination with one of the underlined characters \
754 in the menu bar pulls down that menu. Once the menu is pulled down, \
755 typing the underlined characters in a menu item (without the Alt key) \
756 activates that item. With a menu pulled down, you can also use the arrow \
757 keys to select menu items, and the Space or Enter keys to activate them.\n\
760 Keyboard Shortcuts within Dialogs\n\
762 One button in a dialog is usually marked with a thick indented outline. \
763 Pressing the Return or Enter key activates this button.\n\
765 All dialogs have either a Cancel or Dismiss button. This button can \
766 be activated by pressing the Escape (or Esc) key.\n\
768 Pressing the tab key moves the keyboard focus to the next item in a \
769 dialog. Within an associated group of buttons, the arrow keys move \
770 the focus among the buttons. Shift+Tab moves backward through the items.\n\
772 Most items in dialogs have an underline under one character in their name. \
773 Pressing the Alt key along with this character, activates a button as if you \
774 had pressed it with the mouse, or moves the keyboard focus to the associated \
775 text field or list.\n\
777 You can select items from a list by using the arrow keys to move the \
778 selection and space to select.\n\
780 In file selection dialogs, you can type the beginning characters of the \
781 file name or directory in the list to select files\n\
784 Labeled Function Keys \n\
786 The labeled function keys on standard workstation and PC keyboards, like \
787 the arrows, and page-up and page-down, are active in NEdit, though not \
788 shown in the pull-down menus.\n\
790 Holding down the control key while pressing a named key extends the \
791 scope of the action that it performs. For example, Home normally moves \
792 the insert cursor the beginning of a line. Ctrl+Home moves it to the \
793 beginning of the file. Backspace deletes one character, Ctrl+Backspace \
794 deletes one word.\n\
796 Holding down the shift key while pressing a named key begins or extends \
797 a selection. Combining the shift and control keys combines their \
798 actions. For example, to select a word without using the mouse, \
799 position the cursor at the beginning of the word and press \
800 Ctrl+Shift+RightArrow. The Alt key modifies selection commands to make \
801 the selection rectangular.\n\
803 Under X and Motif, there are several levels of translation between \
804 keyboard keys and the actions they perform in a program. The \
805 \"Customizing NEdit\", and \"X Resources\" sections of the Help \
806 menu have more information on this subject. Because of all of this \
807 configurability, and since keyboards and standards for the meaning of \
808 some keys vary from machine to machine, the mappings may be changed from \
809 the defaults listed below.\n\
811 Modifier Keys (in general)\n\
813 Ctrl Extends the scope of the action that the key\n\
814 would otherwise perform. For example, Home\n\
815 normally moves the insert cursor to the beginning\n\
816 of a line. Ctrl+Home moves it to the beginning of\n\
817 the file. Backspace deletes one character, Ctrl+\n\
818 Backspace deletes one word.\n\
820 Shift Extends the selection to the cursor position. If\n\
821 there's no selection, begins one between the old\n\
822 and new cursor positions.\n\
824 Alt When modifying a selection, makes the selection\n\
825 rectangular.\n\
827 (For the effects of modifier keys on mouse button presses, see \
828 the section titled \"Using the Mouse\")\n\
830 All Keyboards\n\
832 Escape Cancels operation in progress: menu\n\
833 selection, drag, selection, etc. Also\n\
834 equivalent to cancel button in dialogs.\n\
836 Backspace Delete the character before the cursor\n\
838 Ctrl+BS Delete the word before the cursor\n\
840 Arrows\n\
842 Left Move the cursor to the left one character\n\
844 Ctrl+Left Move the cursor backward one word\n\
845 (Word delimiters are settable, see\n\
846 Customizing NEdit, and X Resources)\n\
848 Right Move the cursor to the right one character\n\
850 Ctrl+Right Move the cursor forward one word\n\
852 Up Move the cursor up one line\n\
854 Ctrl+Up Move the cursor up one paragraph.\n\
855 (Paragraphs are delimited by blank lines)\n\
857 Down Move the cursor down one line.\n\
859 Ctrl+Down Move the cursor down one paragraph.\n\
861 Ctrl+Return Return with automatic indent, regardless\n\
862 of the setting of Auto Indent.\n\
864 Shift+Return Return without automatic indent,\n\
865 regardless of the setting of Auto Indent.\n\
867 Ctrl+Tab Insert an ascii tab character, without\n\
868 processing emulated tabs.\n\
870 Alt+Ctrl+<c> Insert the control-code equivalent of\n\
871 a key <c>\n\
873 Ctrl+/ Select everything (same as Select\n\
874 All menu item or ^A)\n\
876 Ctrl+\\ Unselect\n\
878 Ctrl+U Delete to start of line\n\
880 PC Standard Keyboard\n\
882 Ctrl+Insert Copy the primary selection to the\n\
883 clipboard (same as Copy menu item or ^C)\n\
884 for compatibility with Motif standard key\n\
885 binding\n\
886 Shift+Ctrl+\n\
887 Insert Copy the primary selection to the cursor\n\
888 location.\n\
890 Delete Delete the character before the cursor.\n\
891 (Can be configured to delete the character\n\
892 after the cursor, see Customizing NEdit,\n\
893 and X Resources)\n\
895 Ctrl+Delete Delete to end of line.\n\
897 Shift+Delete Cut, remove the currently selected text\n\
898 and place it in the clipboard. (same as\n\
899 Cut menu item or ^X) for compatibility\n\
900 with Motif standard key binding\n\
901 Shift+Ctrl+\n\
902 Delete Cut the primary selection to the cursor\n\
903 location.\n\
905 Home Move the cursor to the beginning of the\n\
906 line\n\
908 Ctrl+Home Move the cursor to the beginning of the\n\
909 file\n\
911 End Move the cursor to the end of the line\n\
913 Ctrl+End Move the cursor to the end of the file\n\
915 PageUp Scroll and move the cursor up by one page.\n\
917 Ctrl+PageUp Scroll and move the cursor left by one\n\
918 page.\n\
919 PageDown Scroll and move the cursor down by one\n\
920 page.\n\
922 Ctrl+PageDown Scroll and move the cursor right by one\n\
923 page.\n\
925 F10 Make the menu bar active for keyboard\n\
926 input (Arrow Keys, Return, Escape,\n\
927 and the Space Bar)\n\
929 Specialty Keyboards \n\
931 On machines with different styles of keyboards, generally, text \
932 editing actions are properly matched to the labeled keys, such as \
933 Remove, Next-screen, etc.. If you prefer different key bindings, see \
934 the section titled \"Key Binding\" under the Customizing \
935 heading in the Help menu.",
937 "Shifting and Filling\n\
940 Shift Left, Shift Right \n\
942 While shifting blocks of text is most important for programmers (See \
943 Features for Programming), it is also useful for other tasks, such as \
944 creating indented paragraphs.\n\
946 To shift a block of text one tab stop to the right, select the text, \
947 then choose Shift Right from the Edit menu. Note that the accelerator \
948 keys for these menu items are Ctrl+9 and Ctrl+0, which correspond to \
949 the right and left parenthesis on most keyboards. Remember them as \
950 adjusting the text in the direction pointed to by the parenthesis \
951 character. Holding the Shift key while selecting either Shift Left or \
952 Shift Right will shift the text by one character.\n\
954 It is also possible to shift blocks of text by selecting the text \
955 rectangularly, and dragging it left or right (and up or down as well). \
956 Using a rectangular selection also causes tabs within the selection to \
957 be recalculated and substituted, such that the non-whitespace characters \
958 remain stationary with respect to the selection.\n\
961 Filling \n\
963 Text filling using the Fill Paragraph command in the Edit menu is one \
964 of the most important concepts in NEdit. And it will be well worth \
965 your while to understand how to use it properly.\n\
967 In plain text files, unlike word-processor files, there is no way to \
968 tell which lines are continuations of other lines, and which lines are \
969 meant to be separate, because there is no distinction in meaning \
970 between newline characters which separate lines in a paragraph, and \
971 ones which separate paragraphs from other text. This makes it \
972 impossible for a text editor like NEdit to tell parts of the text \
973 which belong together as a paragraph from carefully arranged \
974 individual lines.\n\
976 In continuous wrap mode (Preferences -> Wrap -> Continuous), lines \
977 automatically wrap and unwrap themselves to line up properly at the \
978 right margin. In this mode, you simply omit the newlines within \
979 paragraphs and let NEdit make the line breaks as needed. Unfortunately, \
980 continuous wrap mode is not appropriate in the majority of situations, \
981 because files with extremely long lines are not common under Unix and \
982 may not be compatible with all tools, and because you can't achieve \
983 effects like indented sections, columns, or program comments, and still \
984 take advantage of the automatic wrapping.\n\
986 Without continuous wrapping, paragraph filling is not entirely \
987 automatic. Auto-Newline wrapping keeps paragraphs lined up as you \
988 type, but once entered, NEdit can no longer distinguish newlines which \
989 join wrapped text, and newlines which must be preserved. Therefore, \
990 editing in the middle of a paragraph will often leave the right margin \
991 messy and uneven.\n\
993 Since NEdit can't act automatically to keep your text lined up, you \
994 need to tell it explicitly where to operate, and that is what Fill \
995 Paragraph is for. It arranges lines to fill the space between two \
996 margins, wrapping the lines neatly at word boundaries. Normally, the \
997 left margin for filling is inferred from the text being filled. The \
998 first line of each paragraph is considered special, and its left \
999 indentation is maintained separately from the remaining lines (for \
1000 leading indents, bullet points, numbered paragraphs, etc.). Otherwise, \
1001 the left margin is determined by the furthest left non-whitespace \
1002 character. The right margin is either the Wrap Margin, set in the \
1003 preferences menu (by default, the right edge of the window), or can \
1004 also be chosen on the fly by using a rectangular selection (see below).\n\
1006 There are three ways to use Fill Paragraph. The simplest is, while you \
1007 are typing text, and there is no selection, simply select Fill Paragraph \
1008 (or type Ctrl+J), and NEdit will arrange the text in the paragraph \
1009 adjacent to the cursor. A paragraph, in this case, means an area of \
1010 text delimited by blank lines.\n\
1012 The second way to use Fill Paragraph is with a selection. If you select \
1013 a range of text and then chose Fill Paragraph, all of the text in the \
1014 selection will be filled. Again, continuous text between blank lines is \
1015 interpreted as paragraphs and filled individually, respecting leading \
1016 indents and blank lines.\n\
1018 The third, and most versitile, way to use Fill Paragraph is with a \
1019 rectangular selection. Fill Paragraph treats rectangular selections \
1020 differently from other commands. Instead of simply filling the text \
1021 inside the rectangular selection, NEdit interprets the right edge of \
1022 the selection as the requested wrap margin. Text to the left of the \
1023 selection is not disturbed (the usual interpretation of a rectangular \
1024 selection), but text to the right of the selection is included in the \
1025 operation and is pulled in to the selected region. This method enables you \
1026 to fill text to an arbitrary right margin, without going back and forth \
1027 to the wrap-margin dialog, as well as to exclude text to the left of \
1028 the selection such as comment bars or other text columns.",
1030 "While plain-text is probably the simplest and most interchangeable \
1031 file format in the computer world, there is still variation in what \
1032 plain-text means from system to system. Plain-text files can differ \
1033 in character set, line termination, and wrapping.\n\
1035 While character set differences are the most obvious and pose the \
1036 most challenge to portability, they affect nedit only indirectly via \
1037 the same font and localization mechanisms common to all X \
1038 applications. If your system is set up properly, you will probably \
1039 never see character-set related problems in nedit. NEdit can not \
1040 display Unicode text files, or any multi-byte character set.\n\
1042 The primary difference between an MS DOS format file and a Unix \
1043 format file, is how the lines are terminated. Unix uses a single \
1044 newline character. MS DOS uses a carriage-return and a newline. \
1045 NEdit can read and write both file formats, but internally, it uses \
1046 the single character Unix standard. NEdit auto-detects MS DOS format \
1047 files based on the line termination at the start of the file. Files \
1048 are judged to be DOS format if all of the first five line terminators, \
1049 within a maximum range, are DOS-style. To change the format in which \
1050 nedit writes a file from DOS to Unix or visa versa, use the Save \
1051 As... command and check or un-check the MS DOS Format button.\n\
1053 Wrapping within text files can vary among individual users, as \
1054 well as from system to system. Both Windows and MacOS make \
1055 frequent use of plain \
1056 text files with no implicit right margin. In these files, wrapping \
1057 is determined by the tool which displays them. Files of this style \
1058 also exist on Unix systems, despite the fact that they are not \
1059 supported by all Unix utilities. To display this kind of file \
1060 properly in NEdit, you have to select the wrap style called \
1061 Continuous. Wrapping modes are discussed in the sections: \
1062 Customizing -> Preferences, and Basic Operation -> Shifting and \
1063 Filling.\n\
1065 The last and most minute of format differences is the terminating \
1066 newline. NEdit, like vi and approximately half of Unix editors, \
1067 enforces a final terminating newline on all of the files that it \
1068 writes. NEdit does this because some Unix compilers and utilities \
1069 require it, and fail in various ways on files which do not have it. \
1070 Emacs does not enforce this rule. Users are divided on which \
1071 is best.",
1073 "Syntax Highlighting means using colors and fonts to help distinguish \
1074 language elements in programming languages and other types of \
1075 structured files. Programmers use syntax highlighting to understand \
1076 code faster and better, and to spot many kinds of syntax errors more \
1077 quickly.\n\
1079 To use syntax highlighting in NEdit, select Highlight Syntax in the \
1080 Preferences menu. If NEdit recognizes the computer language that you \
1081 are using, and highlighting rules (patterns) are available for that \
1082 language, it will highlight your text, and maintain the highlighting, \
1083 automatically, as you type.\n\
1085 If NEdit doesn't correctly recognize the type of the file you are \
1086 editing, you can manually select a language mode from Language Modes in \
1087 the Preferences menu. You can also program the method that NEdit uses \
1088 to recognize language modes in Preferences -> Default Settings -> \
1089 Language Modes....\n\
1091 If no highlighting patterns are available for the language that you \
1092 want to use, you can create new patterns relatively quickly. The \
1093 Help section \"Highlighting Patterns\" under \"Customizing\", has details.\n\
1095 If you are satisfied with what NEdit is highlighting, but would like it \
1096 to use different colors or fonts, you can change these by selecting \
1097 Preferences -> Default Settings -> Syntax Highlighting -> Text Drawing \
1098 Styles. Highlighting patterns are \
1099 connected with font and color information through a common set of \
1100 styles so that colorings defined for one language will be similar \
1101 across others, and patterns within the same language which are meant to \
1102 appear identical can be changed in the same place. To understand which \
1103 styles are used to highlight the language you are interested in, you \
1104 may need to look at \"Highlighting Patterns\" section, as well.\n\
1106 Syntax highlighting is CPU intensive, and under some circumstances can \
1107 affect NEdit's responsiveness. If you have a particularly slow system, \
1108 or work with very large files, you may not want to use it all of the \
1109 time. Syntax highlighting introduces two kinds of delays. The first is \
1110 an initial parsing delay, proportional to the size of the file. This \
1111 delay is also incurred when pasting large sections of text, filtering \
1112 text through shell commands, and other circumstances involving changes \
1113 to large amounts of text. The second kind of delay happens when text which \
1114 has not previously been visible is scrolled in to view. Depending on \
1115 your system, and the highlight patterns you are using, this may or may \
1116 not be noticeable. A typing delay is also possible, but unlikely if \
1117 you are only using the built-in patterns.",
1119 "If a system crash, network failure, X server crash, or program error should \
1120 happen while you are editing a file, you can still recover most of your work. \
1121 NEdit maintains a backup file which it updates periodically (every 8 editing \
1122 operations or 80 characters typed). This file is has the same name as the \
1123 file that you are editing, but with the character \"~\" (tilde) on Unix or \
1124 \"_\" (underscore) on VMS prefixed \
1125 to the name. To recover a file after a crash, simply rename the file to \
1126 remove the tilde or underscore character, replacing the older version of the \
1127 file. \
1128 (Because several of the Unix shells consider the tilde to be a special \
1129 character, you may have to prefix the character with a \"\\\" (backslash) \
1130 when you move or delete an NEdit backup file.)\n\
1132 Example, to recover the file called \"help.c\" on Unix type the command:\n\
1134 mv \\~help.c help.c\n\
1136 A minor caveat, is that if the file you were editing was in MS DOS \
1137 format, the backup file will be in Unix format, and you will need to \
1138 open the backup file in NEdit and change the file format back \
1139 to MS DOS via the Save As... dialog (or use the Unix \
1140 unix2dos command outside of NEdit).",
1142 "The Preferences menu allows you to set options for both the current \
1143 editing window, and default values for newly created windows and future \
1144 NEdit sessions. Options in the Preferences menu itself (not in the \
1145 Default Settings sub-menu) \
1146 take effect immediately and refer to the current window only. Options \
1147 in the Default Settings sub-menu have no effect on the current window, \
1148 but instead provide initial settings for future windows created using \
1149 the New or Open commands. Preferences set in the Default Settings \
1150 sub-menu can also be saved in a file \
1151 that is automatically read by NEdit at startup time, by selecting \
1152 Save Defaults.\n\
1154 Preferences Menu\n\
1156 Default Settings -- Menu of initial settings for\n\
1157 future windows. Generally the same as the\n\
1158 options in the main part of the menu, but apply\n\
1159 as defaults for future windows created during\n\
1160 this NEdit session. These settings can be saved\n\
1161 using the Save Defaults command below, to be\n\
1162 loaded automatically each time NEdit is started.\n\
1164 Save Defaults -- Save the default options as set\n\
1165 under Default Settings for future NEdit sessions.\n\
1167 Statistics Line -- Show the full file name, line\n\
1168 number, and length of the file being edited.\n\
1170 Incremental Search Line -- Keep the incremental search\n\
1171 bar (Search -> Find Incremental) permanently\n\
1172 displayed at the top of the window.\n\
1174 Show Line Numbers -- Display line numbers to the right\n\
1175 of the text.\n\
1177 Language Mode -- Tells NEdit what language (if any) to\n\
1178 assume, for selecting language-specific features\n\
1179 such as highlight patterns and smart indent macros,\n\
1180 and setting language specific preferences like word\n\
1181 delimiters, tab emulation, and auto-indent. See\n\
1182 Features for Programming -> Programming With NEdit\n\
1183 for more information.\n\
1185 Auto Indent -- Setting Auto Indent \"on\" maintains a\n\
1186 running indent (pressing the Return key will line\n\
1187 up the cursor with the indent level of the previous\n\
1188 line). If smart indent macros are available for\n\
1189 the current language mode, smart indent can be\n\
1190 selected and NEdit will attempt to guess proper\n\
1191 language indentation for each new line. See\n\
1192 Help -> Features for Programming -> Automatic\n\
1193 Indent for more information.\n\
1195 Wrap -- Choose between two styles of automatic wrapping\n\
1196 or none. Auto Newline wrap, wraps text at word\n\
1197 boundaries when the cursor reaches the right margin,\n\
1198 by replacing the space or tab at the last word\n\
1199 boundary with a newline character. Continuous Wrap\n\
1200 wraps long lines which extend past the right margin.\n\
1201 Continuous Wrap mode is typically used to produce\n\
1202 files where newlines are ommitted within paragraphs,\n\
1203 to make text filling automatic (a kind of poor-man's\n\
1204 word processor). Text of this style is common on\n\
1205 Macs and PCs but is not necessarily supported very\n\
1206 well under Unix (except in programs which deal with\n\
1207 e-mail, for which it is often the format of choice).\n\
1209 Wrap Margin -- Set margin for Auto Newline Wrap,\n\
1210 Continuous Wrap, and Fill Paragraph. Lines may,\n\
1211 be wrapped at the right margin of the window, or\n\
1212 the margin can be set at a specific column.\n\
1214 Tabs -- Set the tab distance (number of characters\n\
1215 between tab stops) for tab characters, and\n\
1216 control tab emulation and use of tab characters\n\
1217 in padding and emulated tabs.\n\
1219 Text Font... -- Change the font(s) used to display\n\
1220 text (fonts for menus and dialogs must be set\n\
1221 using X resources for the text area of the window).\n\
1222 See below for more information.\n\
1224 Highlight Syntax -- If NEdit recognizes the language\n\
1225 being edited, and highlighting patterns are\n\
1226 available for that language, use fonts and colors\n\
1227 to enhance viewing of the file. (See Help ->\n\
1228 Features for Programming -> Syntax Highlighting\n\
1229 for more information.\n\
1231 Make Backup Copy -- On Save, write a backup copy of\n\
1232 the file as it existed before the Save command\n\
1233 with the extension .bck (Unix only).\n\
1235 Incremental Backup -- Periodically make a backup copy\n\
1236 of the file being edited under the name ~filename\n\
1237 on Unix or _filename on VMS (see Crash Recovery).\n\
1239 Show Matching (..) -- Momentarily highlight matching\n\
1240 parenthesis, brackets, and braces when one of\n\
1241 these characters is typed, or when the insertion\n\
1242 cursor is positioned after it.\n\
1244 Overtype -- In overtype mode, new characters entered\n\
1245 replace the characters in front of the insertion\n\
1246 cursor, rather than being inserted before them.\n\
1248 Read Only -- Lock the file against accidental\n\
1249 modification. This temporarily prevents the\n\
1250 file from being modified in this NEdit session.\n\
1251 Note that this is diferent from setting the file\n\
1252 protection.\n\
1254 Preferences -> Default Settings Menu\n\
1256 Options in the Preferences -> Default Settings menu have the same \
1257 meaning as those in the top-level Preferences menu, except that they \
1258 apply to future NEdit windows and future NEdit sessions if saved \
1259 with the Save Defaults command. Additional options which appear in \
1260 this menu are:\n\
1262 Language Modes -- Define language recognition\n\
1263 information (for determining language mode from\n\
1264 file name or content) and set language specific\n\
1265 preferences.\n\
1267 Tag Collisions -- How to react to multiple tags for\n\
1268 the same name. Tags are described in the section:\n\
1269 Features for Programmers -> Finding Declarations\n\
1270 (ctags). In Show All mode, all matching tags are\n\
1271 displayed in a dialog. In Smart mode, if one of\n\
1272 the matching tags is in the current window, that\n\
1273 tag is chosen, without displaying the dialog.\n\
1275 Customize Menus -- Add/remove items from the Shell,\n\
1276 Macro, and window background menus (see below).\n\
1278 Searching -- Options for controlling the behavior of\n\
1279 Find and Replace commands:\n\
1281 Verbose - Presents search results in dialog\n\
1282 form, asks before wrapping a search back\n\
1283 around the beginning (or end) of the file.\n\
1285 Keep Dialogs Up - Don't pop down Replace and\n\
1286 Find boxes after searching.\n\
1288 Default Search Style - Initial setting for\n\
1289 search type in Find and Replace dialogs.\n\
1291 Syntax Highlighting -- Program and configure enhanced\n\
1292 text display for new or supported languages (See\n\
1293 Features for Programming -> Syntax Highlighting).\n\
1295 Sort Open Prev. Menu -- Option to order the File ->\n\
1296 Open Previous menu alphabetically, versus in order\n\
1297 of last access.\n\
1299 Popups Under Pointer -- Display pop-up dialogs\n\
1300 centered on the current mouse position, as opposed\n\
1301 to centered on the parent window. This generally\n\
1302 speeds interaction, and is essential for users who\n\
1303 users who set their window managers so keyboard\n\
1304 focus follows the mouse.\n\
1306 Modification Warnings -- Pop up a warning dialog when\n\
1307 files get changed external to nedit.\n\
1309 Exit Warnings -- Ask before exiting when two or more\n\
1310 files are open in an nedit session.\n\
1312 Initial Window Size -- Default size for new windows.\n\
1314 Changing Font(s)\n\
1316 The font used to display text in NEdit is set under Preferences -> \
1317 Text Font (for the current window), or Preferences -> Default Settings \
1318 Text Font (for future windows). These dialogs also allow you to set \
1319 fonts for syntax highlighting. If you don't intend to use syntax \
1320 highlighting, you can ignore most of the dialog, and just set the \
1321 field labeled Primary Font.\n\
1323 Unless you are absolutely certain about the types of files that you \
1324 will be editing with NEdit, you should choose a fixed-spacing font. \
1325 Many, if not most, plain-text files are written expecting to be viewed \
1326 with fixed character spacing, and will look wrong with proportional spacing. \
1327 NEdit's filling, wrapping, and rectangular operations will also work strangely \
1328 if you choose a proportional font.\n\
1330 Note that in the font browser (the dialog \
1331 brought up by the Browse... button), the subset of fonts which are shown is \
1332 narrowed depending on the characteristics already selected. It is \
1333 therefore important to know that you can unselect characteristics \
1334 from the lists by clicking on the selected items a second time.\n\
1336 Fonts for syntax highlighting should ideally match the primary font \
1337 in both height and spacing. A mismatch in spacing will result in similar \
1338 distortions as choosing a proportional font: column alignment will \
1339 sometimes look wrong, and rectangular operations, wrapping, and filling \
1340 will behave strangely. A mismatch in height will cause windows to re-size \
1341 themselves slightly when syntax highlighting is turned on or off, and \
1342 increase the \
1343 inter- line spacing of the text. Unfortunately, on some systems it is \
1344 hard to find sets of fonts which match exactly in height.\n\
1346 Customizing Menus\n\
1348 You can add or change items in the Shell, Macro, and window background \
1349 menus under Preferences -> Default Settings -> Customize Menus. When \
1350 you choose one of these, you will see a dialog with a list of the \
1351 current user-configurable items from the menu on the left. \
1352 To change an existing item, select it from the list, and its properties \
1353 will appear in the remaining fields of the dialog, where you may change \
1354 them. Selecting the item \"New\" from the list allows you to enter new \
1355 items in the menu.\n\
1357 Hopefully most of the characteristics are self explanatory, but here are \
1358 a few things to note:\n\
1360 Accelerator keys are keyboard shortcuts which appear on the right hand \
1361 side of the menus, and allow you avoid pulling down the menu and activate \
1362 the command with a single keystroke. Enter accelerators by typing the keys \
1363 exactly as you would to activate the command.\n\
1365 Mnemonics are a single letter which should be part of the menu item name, \
1366 which allow users to traverse and activate menu items by typing keys when \
1367 the menu is pulled down.\n\
1369 In the Shell Command field of the Shell Commands dialog, the % character \
1370 expands to the name (including directory path) of the file in the window. \
1371 To include a % character in the command, use %%.\n\
1373 The Menu Entry field can contain special \
1374 characters for constructing hierarchical sub-menus, and for making items \
1375 which appear only in certain language modes. The right angle bracket \
1376 character \">\" creates a sub-menu. The name of the item itself should \
1377 be the last element of the path formed from successive sub-menu names \
1378 joined with \">\". Menu panes are called in to existence simply by \
1379 naming them as part of a Menu Entry name. To put several items in the same \
1380 sub-menu, repeat the same hierarchical sequence for each. For \
1381 example, in the Macro Commands dialog, two items with menu entries: a>b>c and \
1382 a>b>d would create a single sub menu under the macro menu called \"a\", \
1383 which would contain a single sub-menu, b, holding the actual items, c and d:\n\
1385 +---++---++---+\n\
1386 |a >||b >||c |\n\
1387 +---++---+|d |\n\
1388 +---+\n\
1390 To qualify a menu entry with a language mode, simply add an at-sign \"@\" \
1391 at the end of the menu command, followed (no space) by a language mode \
1392 name. To make a menu item which appears in several language \
1393 modes, append additional @s and language mode names. For example, \
1394 an item with the menu entry:\n\
1396 Make C Prototypes@C@C++\n\
1398 would appear only in C and C++ language modes, and:\n\
1400 Make Class Template@C++\n\
1402 would appear only in C++ mode.\n\
1404 Menu items with no qualification appear in all language modes.\n\
1406 If a menu item is followed by the single language qualification \"@*\", \
1407 that item will appear only if there are no applicable language-specific items \
1408 of the same name in the same submenu. For example, if you have the following \
1409 three entries in the same menu:\n\
1411 Make Prototypes@C@C++\n\
1412 Make Prototypes@Java\n\
1413 Make Prototypes@*\n\
1415 The first will be available when the language mode is C or C++, the second \
1416 when the language mode is Java, and for all other language modes (including \
1417 the \"Plain\" non-language mode). If the entry:\n\
1419 Make Prototypes\n\
1421 also exists, this will always appear, meaning that the menu will always \
1422 have two \"Make Prototypes\" entries, whatever the language mode.\n\
1424 Sharing Customizations with Other NEdit Users\n\
1426 If you have written macro or shell menu commands, highlight patterns, \
1427 or smart-indent macros that you want to share with other NEdit users, you \
1428 can make a file which they can load into their nedit environment.\n\
1430 To load such a file, start nedit with the command:\n\
1432 nedit -import <file>\n\
1434 In the new nedit session, verify that the imported patterns or macros do \
1435 what you want, then select Preferences -> Save Defaults. \
1436 Saving incorporates the changes into your own .nedit file, so the next \
1437 time you run nedit, you will not have to import the distribution file.\n\
1439 Loading a customization file is automated, but creating one is not. \
1440 To produce a file to be imported by other users, you must make a copy of \
1441 your own .nedit file, and edit it, by hand, to remove everything but the \
1442 few items of interest to the recipient. Leave only the individual \
1443 resource(s), and within those resources, only the particular macro, \
1444 pattern, style, etc, that you wish to exchange. For example, to share a \
1445 highlighting pattern set, you would include the patterns, any new styles \
1446 you added, and language mode information only if the patterns are \
1447 intended to support a new language rather than updating an existing one. \
1448 For example:\n\
1450 nedit.highlightPatterns:\\\n\
1451 My Language:1:0{\\n\\\n\
1452 Comment:\"#\":\"$\"::Comment::\\n\\\n\
1453 Loop Header:\"^[ \\\\t]*loop:\":::Loop::\\n\\\n\
1454 }\n\
1455 nedit.languageModes: My Language:.my::::::\n\
1456 nedit.styles: Loop:blue:Bold\n\
1458 Resources are in the format of X resource files, but the format of text \
1459 within multiple-item resources like highlight patterns, language modes, \
1460 macros, styles, etc., are private to NEdit. Each resource is a string \
1461 which ends at the first newline character not escaped with \\, so you must \
1462 be careful about how you treat ends of lines. While you can generally \
1463 just cut and paste indented sections, if something which was originally \
1464 in the middle of a resource string is now at the end, you must remove the \
1465 \\ line continuation character(s) so it will not join the next line into \
1466 the resource. Conversely, if something which was originally at the end \
1467 of a resource is now in the middle, you'll have to add continuation \
1468 character(s) to make sure that the resource string is properly continued \
1469 from beginning to end, and possibly newline character(s) (\\n) to make \
1470 sure that it is properly separated from the next item.",
1472 "The Shell menu (Unix versions only) allows you to execute Unix shell commands \
1473 from within NEdit. You can add items to the menu to extend NEdit's command \
1474 set or to incorporate custom automatic editing features using shell commands \
1475 or editing languages like awk and \
1476 sed. To add items to the menu, select Preferences -> Default Settings \
1477 Customize Menus -> Shell Menu. NEdit comes pre-configured with \
1478 a few useful Unix commands like spell and sort, but we encourage you to \
1479 add your own custom extensions.\n\
1481 Filter Selection... prompts you for a Unix command to \
1482 use to process the currently selected text. The output from this \
1483 command replaces the contents of the selection.\n\
1485 Execute Command... prompts you for a Unix command and replaces the \
1486 current selection with the output of the command. If there is no \
1487 selection, it deposits the output at the current insertion point.\n\
1489 Execute Command Line uses the position of the cursor in the window \
1490 to indicate a line to execute as a shell command line. The cursor may \
1491 be positioned anywhere on the line. This command allows you to use \
1492 an NEdit window as an editable command window for saving output \
1493 and saving commands for re-execution.\n\
1495 The X resource called nedit.shell (See Customizing NEdit) determines \
1496 which Unix shell is used to execute commands. The default value for \
1497 this resource is /bin/csh.",
1499 "REGEX BASICS\n\
1501 Regular expressions (regex's) are useful as a way to match inexact \
1502 sequences of characters. They can be used in the `Find...' and \
1503 `Replace...' search dialogs and are at the core of Color Syntax \
1504 Highlighting patterns. To specify a regular expression in a search \
1505 dialog, simply click on the `Regular Expression' radio button in the \
1506 dialog.\n\
1508 A regex is a specification of a pattern to be matched in the searched \
1509 text. This pattern consists of a sequence of tokens, each being able \
1510 to match a single character or a sequence of characters in the text, \
1511 or assert that a specific position within the text has been reached \
1512 (the latter is called an anchor.) Tokens (also called atoms) can be \
1513 modified by adding one of a number of special quantifier tokens \
1514 immediately after the token. A quantifier token specifies how many \
1515 times the previous token must be matched (see below.)\n\
1517 Tokens can be grouped together using one of a number of grouping \
1518 constructs, the most common being plain parentheses. Tokens that are \
1519 grouped in this way are also collectively considered to be a regex \
1520 atom, since this new larger atom may also be modified by a quantifier.\n\
1522 A regex can also be organized into a list of alternatives by \
1523 separating each alternative with pipe characters, `|'. This is called \
1524 alternation. A match will be attempted for each alternative listed, \
1525 in the order specified, until a match results or the list of \
1526 alternatives is exhausted (see \"Alternation\" below.)\n\
1528 The Dot Meta Character\n\
1530 If an un-escaped dot (`.') appears in a regex, it means to match any \
1531 character exactly once. By default dot will not match a newline \
1532 character, but this behavior can be changed (see help topic \
1533 \"Grouping\", item \"Matching Newlines\".)\n\
1535 Character Classes\n\
1537 A character class, or range, matches exactly one character of text, \
1538 but the candidates for matching are limited to those specified by the \
1539 class. Classes come in two flavors as described below:\n\
1541 [...] Regular class, match only characters listed.\n\
1542 [^...] Negated class, match only characters NOT listed.\n\
1544 As with the dot token, by default negated character classes do not \
1545 match newline, but can be made to do so.\n\
1547 The characters that are considered special within a class \
1548 specification are different than the rest of regex syntax as follows. \
1549 If the first character in a class is the `]' character (second \
1550 character if the first character is `^') it is a literal character and \
1551 part of the class character set. This also applies if the first or \
1552 last character is `-'. Outside of these rules, two characters \
1553 separated by `-' form a character range which includes all the \
1554 characters between the two characters as well. For example, `[^f-j]' \
1555 is the same as `[^fghij]' and means to match any character that is not \
1556 `f', `g', `h', `i', or `j'.\n\
1558 Anchors\n\
1560 Anchors are assertions that you are at a very specific position within \
1561 the search text. NEdit regular expressions support the following \
1562 anchor tokens:\n\
1564 ^ Beginning of line\n\
1565 $ End of line\n\
1566 < Left word boundary\n\
1567 > Right word boundary\n\
1568 \\B Not a word boundary\n\
1570 Note that the \\B token ensures that the left and right characters are \
1571 both delimiter characters, or that both left and right characters are \
1572 non-delimiter characters. Currently word anchors check only one \
1573 character, e.g. the left word anchor `<' only asserts that the left \
1574 character is a word delimiter character. Similarly the right word \
1575 anchor checks the right character.\n\
1577 Quantifiers\n\
1579 Quantifiers specify how many times the previous regular expression atom \
1580 may be matched in the search text. Some quantifiers can produce a \
1581 large performance penalty, and can in some instances completely lock up \
1582 NEdit. To prevent this, avoid nested quantifiers, especially those of \
1583 the maximal matching type (see below.)\n\
1585 The following quantifiers are maximal matching, or \"greedy\", in that \
1586 they match as much text as possible.\n\
1588 * Match zero or more\n\
1589 + Match one or more\n\
1590 ? Match zero or one\n\
1592 The following quantifiers are minimal matching, or \"lazy\", in that they \
1593 match as little text as possible.\n\
1595 *? Match zero or more\n\
1596 +? Match one or more\n\
1597 ?? Match zero or one\n\
1599 One final quantifier is the counting quantifier, or brace quantifier. \
1600 It takes the following basic form:\n\
1602 {min,max} Match from `min' to `max' times the\n\
1603 previous regular expression atom.\n\
1605 If `min' is omitted, it is assumed to be zero. If `max' is omitted, \
1606 it is assumed to be infinity. Whether specified or assumed, `min' \
1607 must be less than or equal to `max'. Note that both `min' and `max' \
1608 are limited to 65535. If both are omitted, then the construct is the \
1609 same as `*'. Note that `{,}' and `{}' are both valid brace \
1610 constructs. A single number appearing without a comma, e.g. `{3}' is \
1611 short for the `{min,min}' construct, or to match exactly `min' number \
1612 of times.\n\
1614 The quantifiers `{1}' and `{1,1}' are accepted by the syntax, but are \
1615 optimized away since they mean to match exactly once, which is \
1616 redundant information. Also, for efficiency, certain combinations of \
1617 `min' and `max' are converted to either `*', `+', or `?' as follows:\n\
1619 {} {,} {0,} *\n\
1620 {1,} +\n\
1621 {,1} {0,1} ?\n\
1623 Note that {0} and {0,0} are meaningless and will generate an error \
1624 message at regular expression compile time.\n\
1626 Brace quantifiers can also be \"lazy\". For example {2,5}? would try to \
1627 match 2 times if possible, and will only match 3, 4, or 5 times if that \
1628 is what is necessary to achieve an overall match.\n\
1630 Alternation\n\
1632 A series of alternative patterns to match can be specified by \
1633 separating them with vertical pipes, `|'. An example of alternation \
1634 would be `a|be|sea'. This will match `a', or `be', or `sea'. Each \
1635 alternative can be an arbitrarily complex regular expression. The \
1636 alternatives are attempted in the order specified. An empty \
1637 alternative can be specified if desired, e.g. `a|b|'. Since an empty \
1638 alternative can match nothingness (the empty string), this guarantees \
1639 that the expression will match.\n\
1641 Comments\n\
1643 Comments are of the form `(?#<comment text>)' and can be inserted \
1644 anywhere and have no effect on the execution of the regular \
1645 expression. They can be handy for documenting very complex regular \
1646 expressions. Note that a comment begins with `(?#' and ends at the \
1647 first occurrence of an ending parenthesis, or the end of the regular \
1648 expression... period. Comments do not recognize any escape sequences.",
1650 "ESCAPE SEQUENCES\n\
1652 Special Control Characters\n\
1654 In a regex, most ordinary characters match themselves. For example, `ab%' \
1655 would match anywhere `a' followed by `b' followed by `%' appeared in the \
1656 text. However, there are some special characters that are difficult or \
1657 impossible to type. Many of these characters have escape sequences \
1658 (simple characters preceded by `\\') assigned to represent them. NEdit \
1659 recognizes the following special character escape sequences:\n\
1661 \\a alert (bell)\n\
1662 \\b backspace\n\
1663 \\e ASCII escape character (***)\n\
1664 \\f form feed (new page)\n\
1665 \\n newline\n\
1666 \\r carriage return\n\
1667 \\t horizontal tab\n\
1668 \\v vertical tab\n\
1670 *** For environments that use the EBCDIC character set,\n\
1671 when compiling NEdit set the EBCDIC_CHARSET compiler\n\
1672 symbol to get the EBCDIC equivalent escape\n\
1673 character.)\n\
1675 Escaped Meta Characters\n\
1677 Characters that have special meaning to the regex syntax are called meta \
1678 characters. NEdit provides the following escape sequences so that \
1679 characters that are used by the regex syntax can be specified as ordinary \
1680 characters and not interpreted as meta characters.\n\
1682 \\( \\) \\- \\[ \\] \\< \\> \\{ \\}\n\
1683 \\. \\| \\^ \\$ \\* \\+ \\? \\& \\\\\n\
1685 Octal and Hex Escape Sequences\n\
1687 Any ASCII (or EBCDIC) character, except null, can be specified by using \
1688 either an octal escape or a hexadecimal escape, each beginning with \\0 or \
1689 \\x (or \\X) respectively. For example, \\052 and \\X2A both specify the `*' \
1690 character. Escapes for null (\\00 or \\x0) are not valid and will generate \
1691 an error message. Also, any escape that exceeds \\0377 or \\xFF will either \
1692 cause an error or have any additional character(s) interpreted literally. \
1693 For example, \\0777 will be interpreted as \\077 (a `?' character) followed \
1694 by `7' since \\0777 is greater than \\0377.\n\
1696 An invalid digit will also end an octal or hexadecimal escape. For \
1697 example, \\091 will cause an error since `9' is not within an octal \
1698 escape's range of allowable digits (0-7) and truncation before the `9' \
1699 yields \\0 which is invalid.\n\
1701 Shortcut Escapes\n\
1703 NEdit defines some escape sequences that are handy shortcuts for commonly \
1704 used character classes.\n\
1706 \\d digits 0-9\n\
1707 \\l letters a-z and A-Z\n\
1708 \\s whitespace \\t, \\r, \\v, \\f, and space\n\
1709 \\w word characters a-z, A-Z, 0-9, and underscore, `_'\n\
1711 \\D, \\L, \\S, and \\W are the same as the lowercase versions except that the \
1712 resulting character class is negated. For example, \\d is equivalent to \
1713 `[0-9]', while \\D is equivalent to `[^0-9]'.\n\
1715 These escape sequences can also be used within a character class. For \
1716 example, `[\\l_]' is the same as `[a-zA-Z_]'. The escape sequences for \
1717 special characters, and octal and hexadecimal escapes are also valid \
1718 within a class.\n\
1720 Word Delimiter Tokens\n\
1722 Although not strictly a character class, the following escape sequences \
1723 behave similarly to character classes:\n\
1725 \\y Word delimiter character\n\
1726 \\Y Not a word delimiter character\n\
1728 The `\\y' token matches any single character that is one of the characters \
1729 that NEdit recognizes as a word delimiter character, while the `\\Y' token \
1730 matches any character that is NOT a word delimiter character. Word \
1731 delimiter characters are dynamic in nature, meaning that the user can \
1732 change them through preference settings. For this reason, they must be \
1733 handled differently by the regular expression engine. As a consequence of \
1734 this, `\\y' and `\\Y' can not be used within a character class \
1735 specification.",
1737 "PARENTHETICAL CONSTRUCTS\n\
1739 Capturing Parentheses\n\
1741 Capturing Parentheses are of the form `(<regex>)' and can be used to group \
1742 arbitrarily complex regular expressions. Parentheses can be nested, but \
1743 the total number of parentheses, nested or otherwise, is limited to 50 \
1744 pairs. The text that is matched by the regular expression between a \
1745 matched set of parentheses is captured and available for text \
1746 substitutions and backreferences (see below.) Capturing parentheses carry \
1747 a fairly high overhead both in terms of memory used and execution speed, \
1748 especially if quantified by `*' or `+'.\n\
1750 Non-Capturing Parentheses\n\
1752 Non-Capturing Parentheses are of the form `(?:<regex>)' and facilitate \
1753 grouping only and do not incur the overhead of normal capturing \
1754 parentheses. They should not be counted when determining numbers for \
1755 capturing parentheses which are used with backreferences and \
1756 substitutions. Because of the limit on the number of capturing \
1757 parentheses allowed in a regex, it is advisable to use non-capturing \
1758 parentheses when possible.\n\
1760 Positive Look-Ahead\n\
1762 Positive look-ahead constructs are of the form `(?=<regex>)' and implement \
1763 a zero width assertion of the enclosed regular expression. In other \
1764 words, a match of the regular expression contained in the positive \
1765 look-ahead construct is attempted. If it succeeds, control is passed to \
1766 the next regular expression atom, but the text that was consumed by the \
1767 positive look-ahead is first unmatched (backtracked) to the place in the \
1768 text where the positive look-ahead was first encountered.\n\
1770 One application of positive look-ahead is the manual implementation of a \
1771 first character discrimination optimization. You can include a positive \
1772 look-ahead that contains a character class which lists every character \
1773 that the following (potentially complex) regular expression could possibly \
1774 start with. This will quickly filter out match attempts that can not \
1775 possibly succeed.\n\
1777 Negative Look-Ahead\n\
1779 Negative look-ahead takes the form `(?!<regex>)' and is exactly the same \
1780 as positive look-ahead except that the enclosed regular expression must \
1781 NOT match. This can be particularly useful when you have an expression \
1782 that is general, and you want to exclude some special cases. Simply \
1783 precede the general expression with a negative look-ahead that covers the \
1784 special cases that need to be filtered out.\n\
1786 Case Sensitivity\n\
1788 There are two parenthetical constructs that control case sensitivity:\n\
1790 (?i<regex>) Case insensitive; `AbcD' and `aBCd' are\n\
1791 equivalent.\n\
1793 (?I<regex>) Case sensitive; `AbcD' and `aBCd' are\n\
1794 different.\n\
1796 Regular expressions are case sensitive by default, i.e `(?I<regex>)' is \
1797 assumed. All regular expression token types respond appropriately to case \
1798 insensitivity including character classes and backreferences. There is \
1799 some extra overhead involved when case insensitivity is in effect, but \
1800 only to the extent of converting each character compared to lower case.\n\
1802 Matching Newlines\n\
1804 NEdit regular expressions by default handle the matching of newlines in a \
1805 way that should seem natural for most editing tasks. There are \
1806 situations, however, that require finer control over how newlines are \
1807 matched by some regular expression tokens.\n\
1809 By default, NEdit regular expressions will NOT match a newline character \
1810 for the following regex tokens: dot (`.'); a negated character class \
1811 (`[^...]'); and the following shortcuts for character classes:\n\
1813 `\\d', `\\D', `\\l', `\\L', `\\s', `\\S', `\\w', `\\W', `\\Y'\n\
1815 The matching of newlines can be controlled for the `.' token, negated \
1816 character classes, and the `\\s' and `\\S' shortcuts by using one of the \
1817 following parenthetical constructs:\n\
1819 (?n<regex>) `.', `[^...]', `\\s', `\\S' match newlines\n\
1821 (?N<regex>) `.', `[^...]', `\\s', `\\S' don't match\n\
1822 newlines\n\
1824 `(?N<regex>)' is the default behavior.\n\
1826 Notes on New Parenthetical Constructs\n\
1828 Except for plain parentheses, none of the parenthetical constructs capture \
1829 text. If that is desired, the construct must be wrapped with capturing \
1830 parentheses, e.g. `((?i<regex))'.\n\
1832 All parenthetical constructs can be nested as deeply as desired, except \
1833 for capturing parentheses which have a limit of 50 sets of parentheses, \
1834 regardless of nesting level.\n\
1836 Back References\n\
1838 Backreferences allow you to match text captured by a set of capturing \
1839 parenthesis at some later position in your regular expression. A \
1840 backreference is specified using a single backslash followed by a single \
1841 digit from 1 to 9 (example: \\3). Backreferences have similar syntax to \
1842 substitutions (see below), but are different from substitutions in that \
1843 they appear within the regular expression, not the substitution string. \
1844 The number specified with a backreference identifies which set of text \
1845 capturing parentheses the backreference is associated with. The text that \
1846 was most recently captured by these parentheses is used by the \
1847 backreference to attempt a match. As with substitutions, open parentheses \
1848 are counted from left to right beginning with 1. So the backreference \
1849 `\\3' will try to match another occurrence of the text most recently \
1850 matched by the third set of capturing parentheses. As an example, the \
1851 regular expression `(\\d)\\1' could match `22', `33', or `00', but wouldn't \
1852 match `19' or `01'.\n\
1854 A backreference must be associated with a parenthetical expression that is \
1855 complete. The expression `(\\w(\\1))' contains an invalid backreference \
1856 since the first set of parentheses are not complete at the point where the \
1857 backreference appears.\n\
1859 Substitution\n\
1861 Substitution strings are used to replace text matched by a set of \
1862 capturing parentheses. The substitution string is mostly interpreted as \
1863 ordinary text except as follows.\n\
1865 The escape sequences described above for special characters, and octal and \
1866 hexadecimal escapes are treated the same way by a substitution string. \
1867 When the substitution string contains the `&' character, NEdit will \
1868 substitute the entire string that was matched by the `Find...' operation. \
1869 Any of the first nine sub-expressions of the match string can also be \
1870 inserted into the replacement string. This is done by inserting a `\\' \
1871 followed by a digit from 1 to 9 that represents the string matched by a \
1872 parenthesized expression within the regular expression. These expressions \
1873 are numbered left-to-right in order of their opening parentheses.\n\
1875 The capitalization of text inserted by `&' or `\\1', `\\2', ... `\\9' can be \
1876 altered by preceding them with `\\U', `\\u', `\\L', or `\\l'. `\\u' and `\\l' \
1877 change only the first character of the inserted entity, while `\\U' and \
1878 `\\L' change the entire entity to upper or lower case, respectively.",
1880 "ADVANCED REGEX TOPICS\n\
1882 Substitutions\n\
1884 Regular expression substitution can be used to program automatic editing \
1885 operations. For example, the following are search and replace strings to \
1886 find occurrences of the `C' language subroutine `get_x', reverse the first \
1887 and second parameters, add a third parameter of NULL, and change the name \
1888 to `new_get_x':\n\
1890 Search string: `get_x *\\( *([^ ,]*), *([^\\)]*)\\)'\n\
1891 Replace string: `new_get_x(\\2, \\1, NULL)'\n\
1893 Ambiguity\n\
1895 If a regular expression could match two different parts of the text, it \
1896 will match the one which begins earliest. If both begin in the same place \
1897 but match different lengths, or match the same length in different ways, \
1898 life gets messier, as follows.\n\
1900 In general, the possibilities in a list of alternatives are considered in \
1901 left-to-right order. The possibilities for `*', `+', and `?' are \
1902 considered longest-first, nested constructs are considered from the \
1903 outermost in, and concatenated constructs are considered leftmost-first. \
1904 The match that will be chosen is the one that uses the earliest \
1905 possibility in the first choice that has to be made. If there is more \
1906 than one choice, the next will be made in the same manner (earliest \
1907 possibility) subject to the decision on the first choice. And so forth.\n\
1909 For example, `(ab|a)b*c' could match `abc' in one of two ways. The first \
1910 choice is between `ab' and `a'; since `ab' is earlier, and does lead to a \
1911 successful overall match, it is chosen. Since the `b' is already spoken \
1912 for, the `b*' must match its last possibility, the empty string, since it \
1913 must respect the earlier choice.\n\
1915 In the particular case where no `|'s are present and there is only one \
1916 `*', `+', or `?', the net effect is that the longest possible match will \
1917 be chosen. So `ab*', presented with `xabbbby', will match `abbbb'. Note \
1918 that if `ab*' is tried against `xabyabbbz', it will match `ab' just after \
1919 `x', due to the begins-earliest rule. (In effect, the decision on where \
1920 to start the match is the first choice to be made, hence subsequent \
1921 choices must respect it even if this leads them to less-preferred \
1922 alternatives.)\n\
1924 References\n\
1926 An excellent book on the care and feeding of regular expressions is\n\
1928 \"Mastering Regular Expressions\"\n\
1929 Jeffrey E. F. Friedl\n\
1930 (c) 1997, O'Reilly & Associates\n\
1931 ISBN 1-56592-257-3",
1933 "EXAMPLES\n\
1935 o Entire line.\n\
1937 ^.*$\n\
1939 o Blank lines.\n\
1941 ^$\n\
1943 o Whitespace on a line.\n\
1945 \\s+\n\
1947 o Whitespace across lines.\n\
1949 (?n\\s+)\n\
1951 o Whitespace that spans at least two lines. Note minimal\n\
1952 matching `*?' quantifier.\n\
1954 (?n\\s*?\\n\\s*)\n\
1956 o IP address (not robust.)\n\
1958 (?:\\d{1,3}(?:\\.\\d{1,3}){3})\n\
1960 o Two character US Postal state abbreviations (includes\n\
1961 territories.)\n\
1963 [ACDF-IK-PR-W][A-Z]\n\
1965 o Web addresses\n\
1967 (?:http://)?www\\.\\S+\n\
1969 o Case insensitive double words across line breaks.\n\
1971 (?i(?n<(\\S+)\\s+\\1>))\n\
1973 o Upper case words with possible punctuation.\n\
1975 <[A-Z][^a-z\\s]*>",
1977 #ifndef VMS
1978 "nedit [-read] [-create] [-line n | +n] [-server]\n\
1979 [-do command] [-tags file] [-tabs n] [-wrap]\n\
1980 [-nowrap] [-autowrap] [-autoindent] [-noautoindent]\n\
1981 [-autosave] [-noautosave] [-rows n] [-columns n]\n\
1982 [-font font] [-lm languagemode] [-geometry geometry]\n\
1983 [-iconic] [-noiconic] [-display [host]:server[.screen]\n\
1984 [-xrm resourcestring] [-svrname name] [-import file]\n\
1985 [-background color] [-foreground color] [file...]\n\
1987 -read -- Open the file Read Only regardless of\n\
1988 the actual file protection.\n\
1990 -create -- Don't warn about file creation when\n\
1991 a file doesn't exist.\n\
1993 -line n (or +n) -- Go to line number n\n\
1995 -server -- Designate this session as an NEdit\n\
1996 server, for processing commands from the nc\n\
1997 program. nc can be used to interface NEdit to\n\
1998 code development environments, mailers, etc.,\n\
1999 or just as a quick way to open files from the\n\
2000 shell command line without starting a new NEdit\n\
2001 session.\n\
2003 -do command -- Execute an NEdit macro or action.\n\
2004 On each file following the -do argument on the\n\
2005 command line. -do is particularly useful from\n\
2006 the nc program, where nc -do can remotely\n\
2007 execute commands in an nedit -server session.\n\
2009 -tags file -- Load a file of directions for finding\n\
2010 definitions of program subroutines and data\n\
2011 objects. The file must be of the format gen-\n\
2012 erated by Exuberant Ctags, or the standard Unix\n\
2013 ctags command.\n\
2015 -tabs n -- Set tab stops every n characters.\n\
2017 -wrap, -nowrap -- Wrap long lines at the right edge\n\
2018 of the window rather than continuing them past\n\
2019 it. (Continuous Wrap mode)\n\
2021 -autowrap, -noautowrap -- Wrap long lines when the\n\
2022 cursor reaches the right edge of the window by\n\
2023 inserting newlines at word boundaries. (Auto\n\
2024 Newline Wrap mode)\n\
2026 -autoindent, -noautoindent -- Maintain a running\n\
2027 indent.\n\
2029 -autosave, -noautosave -- Maintain a backup copy of\n\
2030 the file being edited under the name ~filename \n\
2031 (on Unix) or _filename (on VMS).\n\
2033 -lm languagemode -- Initial language mode used for\n\
2034 editing succeeding files.\n\
2036 -rows n -- Default height in characters for an editing\n\
2037 window.\n\
2039 -columns n -- Default width in characters for an\n\
2040 editing window.\n\
2042 -font font (or -fn font) -- Font for text being\n\
2043 edited (Font for menus and dialogs can be set\n\
2044 with -xrm \"*fontList:font\").\n\
2046 -geometry geometry (or -g geometry) -- The initial\n\
2047 size and/or location of editor windows. The\n\
2048 argument geometry has the form:\n\
2050 [<width>x<height>][+|-][<xoffset>[+|-]<yoffset>]\n\
2052 where <width> and <height> are the desired width\n\
2053 and height of the window, and <xoffset> and\n\
2054 <yoffset> are the distance from the edge of the\n\
2055 screen to the window, + for top or left, - for\n\
2056 bottom or right. -geometry can be specified\n\
2057 for individual files on the command line.\n\
2059 -iconic, -noiconic -- Initial window state for\n\
2060 succeeding files.\n\
2062 -display [host]:server[.screen] -- The name of the\n\
2063 X server to use. host specifies the machine,\n\
2064 server specifies the display server number, and\n\
2065 screen specifies the screen number. host or\n\
2066 screen can be omitted and default to the local\n\
2067 machine, and screen 0.\n\
2069 -background color (or -bg color) -- Background color.\n\
2070 (background color for text can be set separately\n\
2071 with -xrm \"nedit*text.background: color\").\n\
2073 -foreground color (or -fg color) -- Foreground color.\n\
2074 (foreground color for text can be set separately\n\
2075 with -xrm \"nedit*text.foreground: color\").\n\
2077 -xrm resourcestring -- Set the value of an X resource\n\
2078 to override a default value (see Customizing NEdit).\n\
2080 -svrname name -- When starting nedit in server mode,\n\
2081 name the server, such that it responds to requests\n\
2082 only when nc is given a corresponding -svrname\n\
2083 argument. By naming servers, you can run several\n\
2084 simultaneously, and direct files and commands\n\
2085 specifically to any one.\n\
2087 -import file -- loads an additional preferences file\n\
2088 on top of the existing defaults saved in your\n\
2089 .nedit file. To incorporate macros, language\n\
2090 modes, and highlight patterns and styles written\n\
2091 by other users, run nedit with -import <file>, then\n\
2092 re-save your .nedit file with Preferences -> Save\n\
2093 Defaults.",
2094 #else
2095 "Command Format:\n\
2097 NEDIT [filespec[,...]]\n\
2099 The following qualifiers are accepted:\n\
2101 /read -- Open the file Read Only regardless of\n\
2102 the actual file protection.\n\
2104 /create -- Don't warn about file creation when\n\
2105 a file doesn't exist.\n\
2107 /line=n -- Go to line #n\n\
2109 /server -- Designate this session as an NEdit\n\
2110 server for processing commands from the nc\n\
2111 program. nc can be used to interface NEdit to\n\
2112 code development environments, mailers, etc.,\n\
2113 or just as a quick way to open files from the\n\
2114 shell command line without starting a new NEdit\n\
2115 session.\n\
2117 /do=command -- Execute an NEdit action routine.\n\
2118 on each file following the /do argument on the\n\
2119 command line. /do is particularly useful from\n\
2120 the nc program, where nc /do can remotely\n\
2121 execute commands in an nedit /server session.\n\
2122 /tags=file -- Load a file of directions for finding\n\
2123 definitions of program subroutines and data\n\
2124 objects. The file must be of the format gen-\n\
2125 erated by the Unix ctags command.\n\
2127 /wrap, /nowrap -- Wrap long lines at the right edge\n\
2128 of the window rather than continuing them past\n\
2129 it. (Continuous Wrap mode)\n\
2131 /autowrap, /noautowrap -- Wrap long lines when the\n\
2132 cursor reaches the right edge of the window by\n\
2133 inserting newlines at word boundaries. (Auto\n\
2134 Newline Wrap mode)\n\
2136 /autoindent, /noautoindent -- Maintain a running\n\
2137 indent.\n\
2139 /autosave, /noautosave -- Maintain a backup copy of\n\
2140 the file being edited under the name ~filename \n\
2141 (on Unix) or _filename (on VMS).\n\
2143 /rows=n -- Default width in characters for an editing\n\
2144 window.\n\
2146 /columns=n -- Default height in characters for an\n\
2147 editing window.\n\
2149 /font=font (or /fn=font) -- Font for text being\n\
2150 edited (Font for menus and dialogs can be set\n\
2151 with -xrm \"*fontList:font\").\n\
2153 /display [host]:server[.screen] -- The name of the\n\
2154 X server to use. host specifies the machine,\n\
2155 server specifies the display server number, and\n\
2156 screen specifies the screen number. host or\n\
2157 screen can be omitted and default to the local\n\
2158 machine, and screen 0.\n\
2160 /geometry=geometry (or /g=geometry) -- The initial\n\
2161 size and/or location of editor windows. The\n\
2162 argument geometry has the form:\n\
2164 [<width>x<height>][+|-][<xoffset>[+|-]<yoffset>]\n\
2166 where <width> and <height> are the desired width\n\
2167 and height of the window, and <xoffset> and\n\
2168 <yoffset> are the distance from the edge of the\n\
2169 screen to the window, + for top or left, - for\n\
2170 bottom or right.\n\
2172 /background=color (or /bg=color) -- Background color.\n\
2173 (background color for text can be set separately\n\
2174 with /xrm \"nedit*text:background color\").\n\
2176 /foreground=color (or /fg=color) -- Foreground color.\n\
2177 (foreground color for text can be set separately\n\
2178 with -xrm \"nedit*text:foreground color\").\n\
2180 /xrm=resourcestring -- Set the value of an X resource\n\
2181 to override a default value (see Customizing NEdit).\n\
2183 /svrname=name -- When starting nedit in server mode,\n\
2184 name the server, such that it responds to requests\n\
2185 only when nc is given a correspoding -svrname\n\
2186 argument. By naming servers, you can run several\n\
2187 simultaneously, and direct files and commands\n\
2188 specifically to any one.\n\
2190 /import=filename -- loads an additional preferences\n\
2191 file on top of the existing defaults saved in your\n\
2192 .nedit file. To incorporate macros, language\n\
2193 modes, and highlight patterns and styles written\n\
2194 by other users, run nedit with /import=<file>, then\n\
2195 re-save your .nedit file with Preferences -> Save\n\
2196 Defaults.\n\
2198 Unix-style command lines (but not file names) are also acceptable:\n\
2200 nedit -rows 20 -wrap file1.c file2.c\n\
2202 is equivalent to:\n\
2204 nedit /rows=20/wrap file1.c, file2.c",
2205 #endif /*VMS*/
2207 "NEdit can be operated on its own, or as a two-part client/server \
2208 application. Client/server mode is useful for \
2209 integrating NEdit with software \
2210 development environments, mailers, and other programs; or just as a \
2211 quick way to open files from the shell command line without starting \
2212 a new NEdit session.\n\
2214 To run NEdit in server mode, type:\n\
2216 nedit -server\n\
2218 NEdit can also be started in server mode via the nc program when \
2219 no servers are available.\n\
2221 The nc (for NEdit Client) program, which is distributed along with nedit, sends \
2222 commands to an nedit server to open files, select lines, or execute editor \
2223 actions. It accepts a limited set of the nedit command line options: -read, \
2224 -create, -line (or +n), -do, and a list of file names. Listing a file on the \
2225 nc command line means, open it if it is not already open and bring the window \
2226 to the front. -read and -create affect only newly opened files, but -line and \
2227 -do can also be used on files which are already open (See \
2228 \"NEdit Command Line\" for more information).\n\
2230 In typical Unix style, arguments affect the files which follow them on the \
2231 command line, for example:\n\
2233 incorrect: nc file.c -line 25\n\
2234 correct: nc -line 25 file.c\n\
2236 -read, -create, and -line affect all of the files which follow them on \
2237 the command line. The -do macro is executed only once, on the next file on \
2238 the line. -do without a file following it on the command line, executes \
2239 the macro on the first available window (presumably when you give a -do \
2240 command without a corresponding file or window, you intend it to do something \
2241 independent of the window in which it happens execute).\n\
2243 nc also accepts one command line option of its own, -noask (or -ask), \
2244 which instructs it whether to automatically start a server if one is not \
2245 available. This is also settable via the X resource, nc.autoStart \
2246 (See X Resources).\n\
2248 Sometimes it is useful to have more than one NEdit server running, for \
2249 example to keep mail and programming work separate. The option, -svrname, \
2250 to both nedit and nc, allows you to start, and communicate with, separate \
2251 named servers. A named server responds only to requests with the \
2252 corresponding -svrname argument. If you use ClearCase and are within \
2253 a ClearCase view, the server name will default to the name of the view (based \
2254 on the value of the CLEARCASE_ROOT environment variable).\n\
2256 Communication between nc and nedit is through the X display. So as long as X \
2257 windows is set up and working properly, nc will will work \
2258 properly as well. nc uses the DISPLAY environment variable, the machine name \
2259 and your user name to find the appropriate server, meaning, if you have several \
2260 machines sharing a common file system, nc will not be able to find a server \
2261 that is running on a machine with a different host name, even though it may be \
2262 perfectly appropriate for editing a given file.\n\
2264 The command which nc uses to start an nedit server is settable \
2265 via the X resource nc.serverCommand, by default, \
2266 \"nedit -server\".",
2268 "NEdit can be customized many different ways. The most important \
2269 user-settable options are presented in the Preferences menu, including \
2270 all options that users might need to change during an editing session. \
2271 Options set in the Default Settings sub-menu of the Preferences menu \
2272 can be preserved between sessions by selecting Save Defaults, \
2273 which writes a file called .nedit in the user's \
2274 home directory. See the section titled \"Preferences\" for more details.\n\
2276 User defined commands can be added to NEdit's Shell, Macro, and window \
2277 background menus. Dialogs for creating items in these menus can be found \
2278 under Customize Menus in the Default Settings sub menu of the Preferences \
2279 menu.\n\
2281 For users who depend on NEdit every day and want to tune \
2282 every excruciating detail, there are also X resources for tuning a vast number \
2283 of such details, down to the color of each individual button. See \
2284 the section \"X Resources\" for more information, as well as a list of \
2285 selected resources.\n\
2287 The most common reason customizing your X resources for NEdit, however, \
2288 is key binding. While limited key binding can be done through Preferences \
2289 settings (Preferences -> Default Settings -> Customize Menus), you can really \
2290 only add keys this way, and each key must have a corresponding menu item. \
2291 Any significant changes to key binding should be made via the Translations \
2292 resource and menu \
2293 accelerator resources. The sections titled \"Key Binding\" and \
2294 \"X Resources\" have more information.",
2296 "NEdit has additional options to those provided in the Preferences menu \
2297 which are set using X resources. \
2298 Like most other X programs, NEdit can be customized to vastly unnecessary \
2299 proportions, from initial window positions down to the font and shadow \
2300 colors of each individual button (A complete discussion of how to do \
2301 this is left to books on the X Windows System). Key binding (see \
2302 \"Key Binding\" \
2303 is one of the most useful of these resource settable options.\n\
2305 X resources are usually specified in a file called .Xdefaults or \
2306 .Xresources in your \
2307 home directory (on VMS this is sys$login:decw$xdefaults.dat). On some \
2308 systems, this file is read and its information \
2309 attached to the X server (your screen) when you start X. On other \
2310 systems, the .Xdefaults file is read each time you run an X program. \
2311 When X resource values are attached to the X server, changes to the \
2312 resource file are not available to application programs until you either run \
2313 the xrdb program with the appropriate file as input, or re-start \
2314 the X server.\n\
2316 The .nedit File\n\
2318 The .nedit (saved preferences) file is in the same format as an X resource \
2319 file, and its contents can be moved into your X resource file. One reason \
2320 for doing so would be to attach server specific preferences, such as \
2321 a default font to a particular X server. Another reason for moving \
2322 preferences into the X resource file would be to keep preferences menu \
2323 options and resource settable options together in one place. Though \
2324 the files are the same format, additional resources should not be added \
2325 to the .nedit file, they will not be read, and NEdit modifies this file \
2326 by overwriting it completely. Note also that the contents of the .nedit \
2327 file take precedence over the values of X resources. Using \
2328 Save Defaults after moving the contents of your .nedit file to your \
2329 .Xdefaults file will re-create the .nedit file, interfering with \
2330 the options that you have moved.\n\
2332 Selected X Resource Names\n\
2334 The following are selected NEdit resource names and default values \
2335 for NEdit options not settable via the Preferences menu (for preference \
2336 resource names, see your .nedit file):\n\
2338 nedit.tagFile: (not defined) -- The name of a file\n\
2339 of the type produced by Exuberant Ctags or the\n\
2340 Unix ctags command, which NEdit will load at\n\
2341 startup time (see Features for Programmers). The\n\
2342 tag file provides a database from which NEdit can\n\
2343 automatically open files containing the definition\n\
2344 of a particular subroutine or data type.\n\
2346 nedit.shell: /bin/csh -- (Unix systems only) The Unix\n\
2347 shell (command interpreter) to use for executing\n\
2348 commands from the Shell menu\n\
2350 nedit.wordDelimiters: .,/\\\\`'!@#%^&*()-=+{}[]\":;<>?\n\
2351 -- The characters, in addition to blanks and tabs,\n\
2352 which mark the boundaries between words for the\n\
2353 move-by-word (Ctrl+Arrow) and select-word (double\n\
2354 click) commands. Note that this default value may\n\
2355 be overridden by the setting in Preferences ->\n\
2356 Default Settings -> Language Modes....\n\
2358 nedit.remapDeleteKey: False -- Setting this resource\n\
2359 to True forcibly maps the delete key to backspace.\n\
2360 This can be helpful on systems where the bindings\n\
2361 have become tangled, and in environments which mix\n\
2362 systems with PC style keyboards and systems with\n\
2363 DEC and Macintosh keyboards. Theoretically, these\n\
2364 bindings should be made using the standard X/Motif\n\
2365 mechanisms, outside of nedit. In practice, some\n\
2366 environments where users access several different\n\
2367 systems remotely, can be very hard to configure.\n\
2368 If you've given up and are using a backspace key\n\
2369 halfway off the keyboard because you can't figure\n\
2370 out the bindings, set this to True.\n\
2372 nedit.stdOpenDialog: False -- Setting this resource\n\
2373 to True restores the standard Motif style of\n\
2374 Open dialog. NEdit file open dialogs are missing\n\
2375 a text field at the bottom of the dialog, where\n\
2376 the file name can be entered as a string. The\n\
2377 field is removed in NEdit to encourage users to\n\
2378 type file names in the list, a non-standard, but\n\
2379 much faster method for finding files.\n\
2381 nedit.bgMenuButton: ~Shift~Ctrl~Meta~Alt<Btn3Down> --\n\
2382 Specification for mouse button / key combination\n\
2383 to post the background menu (in the form of an X\n\
2384 translation table event specification). The event\n\
2385 specification should be as specific as possible,\n\
2386 since it will override less specific translation\n\
2387 table entries.\n\
2389 nedit.maxPrevOpenFiles: 30 -- Number of files listed\n\
2390 in the Open Previous sub-menu of the File menu.\n\
2391 Setting this to zero disables the Open Previous\n\
2392 menu item and maintenance of the .neditdb file.\n\
2394 nedit.printCommand: (system specific) -- Command used\n\
2395 by the print dialog to print a file, i.e. lp,\n\
2396 lpr, etc.. The command must be capable of\n\
2397 accepting input via stdin (standard input).\n\
2399 nedit.printCopiesOption: (system specific) -- Option\n\
2400 name used to specify multiple copies to the print\n\
2401 command. If the option should be separated from\n\
2402 its argument by a space, leave a trailing space.\n\
2403 If blank, no \"Number of Copies\" item will\n\
2404 appear in the print dialog.\n\
2406 nedit.printQueueOption: (system specific) -- Option\n\
2407 name used to specify a print queue to the print\n\
2408 command. If the option should be separated from\n\
2409 its argument by a space, leave a trailing space.\n\
2410 If blank, no \"Queue\" item will appear in the\n\
2411 print dialog.\n\
2413 nedit.printNameOption: (system specific) -- Option\n\
2414 name used to specify a job name to the print\n\
2415 command. If the option should be separated from\n\
2416 its argument by a space, leave a trailing space.\n\
2417 If blank, no job or file name will be attached\n\
2418 to the print job or banner page.\n\
2420 nedit.printHostOption: (system specific) -- Option\n\
2421 name used to specify a host name to the print\n\
2422 command. If the option should be separated from\n\
2423 its argument by a space, leave a trailing space.\n\
2424 If blank, no \"Host\" item will appear in the\n\
2425 print dialog.\n\
2427 nedit.printDefaultQueue: (system specific) -- The\n\
2428 name of the default print queue. Used only to\n\
2429 display in the print dialog, and has no effect on\n\
2430 printing.\n\
2432 nedit.printDefaultHost: (system specific) -- The\n\
2433 node name of the default print host. Used only\n\
2434 to display in the print dialog, and has no effect\n\
2435 on printing.\n\
2437 nedit.visualID: (Best) -- If your screen supports\n\
2438 multiple visuals (color mapping models), this\n\
2439 resource allows you to manually choose among\n\
2440 them. The default value of \"Best\" chooses\n\
2441 the deepest (most colors) visual available.\n\
2442 Since NEdit does not depend on the specific\n\
2443 characteristics of any given color model, Best\n\
2444 probably IS the best choice for everyone, and\n\
2445 the only reason for setting this resource would\n\
2446 be to patch around some kind of X server problem.\n\
2447 The resource may also be set to \"Default\",\n\
2448 which chooses the screen's default visual (often\n\
2449 a color-mapped, PseudoColor, visual for\n\
2450 compatibility with older X applications). It\n\
2451 may also be set to a numeric visual-id value\n\
2452 (use xdpyinfo to see the list of visuals\n\
2453 supported by your display), or a visual class\n\
2454 name: PseudoColor, DirectColor, TrueColor, etc..\n\
2456 nedit.installColormap (False) -- Force the\n\
2457 installation of a private colormap. If you have\n\
2458 a humble 8-bit color display, and netscape is\n\
2459 hogging all of the color cells, you may want to\n\
2460 try turning this on. On most systems, this will\n\
2461 result in colors flashing wildly when you switch\n\
2462 between NEdit and other applications. But a few\n\
2463 systems (SGI) have hardware support for multiple\n\
2464 simultaneous colormaps, and applications with\n\
2465 installed colormaps are well behaved.\n\
2467 nedit.multiClickTime: (system specific) -- Maximum\n\
2468 time in milliseconds allowed between mouse clicks\n\
2469 within double and triple click actions.\n\
2471 nedit*scrollBarPlacement: BOTTOM_LEFT -- How scroll\n\
2472 bars are placed in NEdit windows, as well as\n\
2473 various lists and text fields in the program.\n\
2474 Other choices are: BOTTOM_RIGHT, TOP_LEFT, or\n\
2475 TOP_RIGHT.\n\
2477 nedit*text.autoWrapPastedText: False -- When Auto-\n\
2478 Newline Wrap is turned on, apply automatic\n\
2479 wrapping (which normally only applies to typed\n\
2480 text) to pasted text as well.\n\
2482 nedit*text.heavyCursor: False -- For monitors with\n\
2483 poor resolution or users who have difficulty\n\
2484 seeing the cursor, makes the cursor in the text\n\
2485 editing area of the window heavier and darker.\n\
2487 nedit*text.foreground: black -- Foreground color of\n\
2488 the text editing area of the NEdit window.\n\
2490 nedit*text.background: white -- Background color of\n\
2491 the text editing area of the NEdit window.\n\
2493 nedit*text.selectForeground: black -- Foreground\n\
2494 (text) color for selections in the text editing\n\
2495 area of the NEdit window.\n\
2497 nedit*text.selectBackground: gray80 -- Color for\n\
2498 selections in the text editing area of the NEdit\n\
2499 window.\n\
2501 nedit*text.highlightForeground: white -- Foreground\n\
2502 (text) color for highlights (parenthesis\n\
2503 flashing) in the text editing area of the NEdit\n\
2504 window.\n\
2506 nedit*text.highlightBackground: red -- Color for\n\
2507 highlights (parenthesis flashing) in the text\n\
2508 editing area of the NEdit window.\n\
2510 nedit*text.cursorForeground: black -- Color for\n\
2511 text cursor in the text editing area of the\n\
2512 NEdit window.\n\
2514 nedit*text.lineNumForeground: gray47 -- Color for\n\
2515 displaying line numbers in the NEdit window.\n\
2517 nedit*text.blinkRate: 600 -- Blink rate of the text\n\
2518 insertion cursor in milliseconds. Set to zero\n\
2519 to stop blinking.\n\
2521 nedit*text.Translations: -- Modifies key bindings\n\
2522 (see below).\n\
2524 nedit*foreground: black -- Default foreground color\n\
2525 for menus, dialogs, scroll bars, etc..\n\
2527 nedit*background: gray70 -- Default background color\n\
2528 for menus, dialogs, scroll bars, etc..\n\
2530 nedit*fontList: helvetica-bold-14 -- Default font\n\
2531 for menus, dialogs, scroll bars, etc..\n\
2533 nc.autoStart: False -- Whether the nc program should\n\
2534 automatically start an NEdit server (without\n\
2535 prompting the user) if an appropriate server is\n\
2536 not found.\n\
2538 nc.serverCommand: nedit -server -- Command used by\n\
2539 the nc program to start an NEdit server.\n\
2541 Selected widget names (to which you may append .background .foreground, \
2542 .fontList, etc., to change colors, fonts and other characteristics):\n\
2544 nedit*statsForm -- Statistics line and incremental\n\
2545 search bar. Use this to set statistics line\n\
2546 background color. To set attributes affecting\n\
2547 both the statistics line and the incremental\n\
2548 search bar, use '*' rather than '.' to separate\n\
2549 the resource name. For example, to set the\n\
2550 foreground color: nedit*statsForm*foreground.\n\
2552 nedit*menuBar -- Top-of-window menu-bar\n\
2554 nedit*textHorScrollBar -- Horizontal scroll bar\n\
2556 nedit*textVertScrollBar -- Vertical scroll bar\n\
2558 nedit*helpText -- Help window text",
2560 "There are several ways to change key bindings in NEdit. The easiest \
2561 way to add a new key binding in NEdit is to define a macro in Preferences -> \
2562 Default Settings -> Customize Menus -> Macro Menu. \
2563 However, if you want to change existing bindings or add a significant \
2564 number of new key bindings you will need to do so via X resources.\n\
2566 Before reading this section, \
2567 you must understand how to set X resources (see the help section \"X \
2568 Resources\"). Since setting X resources is tricky, it is also helpful \
2569 when working on key-binding, to set some easier-to-verify resource at the \
2570 same time, \
2571 as a simple check that the NEdit program is actually seeing your changes. \
2572 The appres program is also very helpful in checking that the resource \
2573 settings that you make, actually reach the program for which they are \
2574 intended in the correct form.\n\
2576 Key Binding in General\n\
2578 Keyboard commands are associated with editor action routines through \
2579 two separate mechanisms in NEdit. Commands which appear in pull-down \
2580 menus have individual resources designating a keyboard equivalent to \
2581 the menu command, called an accelerator key. Commands which do not have \
2582 an associated menu item are bound to keys via the X toolkit translation \
2583 mechanism. The methods for changing these two kinds of bindings are \
2584 quite different.\n\
2586 Key Binding Via Translations\n\
2588 The most general way to bind actions to keys in NEdit is to use the \
2589 translation table associated with the text widget. To add a binding to \
2590 Alt+Y to insert the string \"Hi!\", for example, add lines similar to the \
2591 following to your X resource file:\n\
2593 NEdit*text.Translations: #override \\n\\\n\
2594 Alt<Key>y: insert_string(\"Hi!\") \\n\n\
2596 The Help topic \"Action \
2597 Routines\" lists the actions available to be bound.\n\
2599 Translation tables map key and mouse presses, \
2600 window operations, and other kinds of events, to actions. \
2601 The syntax for translation tables is simplified here, and you. \
2602 may need to refer to a book on the X window system for more detailed \
2603 information.\n\
2605 Note that accelerator resources (discussed below) override \
2606 translations, and that most Ctrl+letter and Alt+letter combinations are \
2607 already bound to an accelerator key. To use one of these combinations from \
2608 a translation table, therefore, you must first un-bind the original menu \
2609 accelerator.\n\
2611 A resource for changing a translation table \
2612 consists of a keyword; #override, #augment, or #replace; \
2613 followed by lines (separated by newline characters) pairing events with \
2614 actions. Events begin with modifiers, like Ctrl, Shift, or Alt, \
2615 followed by the event type in <>. BtnDown, Btn1Down, Btn2Down, Btn1Up, \
2616 Key, KeyUp are valid event types. For key presses, the \
2617 event type is followed by the name of the key. You can specify a \
2618 combination of events, such as a sequence of key presses, by separating \
2619 them with commas. The other half of the event/action pair is a set \
2620 of actions. These are separated from the event specification by a colon \
2621 and from each other by spaces. Actions \
2622 are names followed by parentheses, optionally \
2623 containing one or more parameters separated by comas.\n\
2625 Changing Menu Accelerator Keys\n\
2627 The menu shortcut keys shown at the right of NEdit menu items can also \
2628 be changed via X resources. Each menu item has two \
2629 resources associated with it, accelerator, the \
2630 event to trigger the menu item; and acceleratorText, the string \
2631 shown in the menu. \
2632 The form of the accelerator resource is the same as events for translation \
2633 table entries discussed above, though multiple keys and other subtleties \
2634 are not allowed. \
2635 The resource name for a menu is the title in lower case, followed by \
2636 \"Menu\", the resource name of menu item is the name in lower case, run \
2637 together, with words separated by caps, and all punctuation removed. \
2638 For example, to change Cut to Ctrl+X, \
2639 you would add the following to your .Xdefaults file:\n\
2641 nedit*editMenu.cut.accelerator: Ctrl<Key>x\n\
2642 nedit*editMenu.cut.acceleratorText: Ctrl+X\n\
2644 Accelerator keys with optional shift key modifiers, like Find..., have an \
2645 additional accelerator resource with Shift appended to the name. For \
2646 example:\n\
2648 nedit*searchMenu.find.acceleratorText: [Shift]Alt+F\n\
2649 nedit*searchMenu.find.accelerator: Alt<Key>f\n\
2650 nedit*searchMenu.findShift.accelerator: Shift Alt<Key>f",
2652 "Learn/Replay\n\
2654 Selecting Learn Keystrokes from the Macro menu puts NEdit in learn mode. \
2655 In learn mode, keystrokes and menu commands are recorded, to be played \
2656 back later, using the Replay Keystrokes command, or pasted into a \
2657 macro in the Macro Commands dialog of the Default Settings menu in \
2658 Preferences.\n\
2660 Note that only keyboard and menu commands are recorded, not mouse clicks \
2661 or mouse movements since these have no absolute point of reference, such \
2662 as cursor or selection position. When you do a mouse-based operation in \
2663 learn mode, NEdit will beep (repeatedly) to remind you that the operation \
2664 was not recorded.\n\
2666 Learn mode is also the quickest and easiest method for writing macros. The \
2667 dialog for creating macro commands contains a button labeled \"Paste Learn / \
2668 Replay Macro\", which will deposit the last sequence learned into the body \
2669 of the macro.\n\
2671 Repeating Actions and Learn/Replay Sequences\n\
2673 You can repeat the last (keyboard-based) command, or learn/replay sequence \
2674 with the Repeat... command in the Macro menu. To repeat an action, first \
2675 do the action (i.e. insert a character, do a \
2676 search, move the cursor), then select Repeat..., \
2677 decide how or how many times you want it repeated, and click OK. For \
2678 example, to move down 30 lines through a file, you could type: <Down Arrow> \
2679 Ctrl+, 29 <Return>. To repeat a \
2680 learn/replay sequence, first learn it, then select Repeat..., click on \
2681 Learn/Replay and how you want it repeated, then click OK.\n\
2683 If the commands \
2684 you are repeating advance the cursor through the file, you can also repeat \
2685 them within a range of characters, or \
2686 from the current cursor position to the end of the file. To iterate over \
2687 a range of characters, use the primary \
2688 selection (drag the left mouse button over the text) to mark the range \
2689 you want to operate on, \
2690 and select \"In Selection\" in the Repeat dialog.\n\
2692 When using In \"Selection\" or \"To End\" with a learned sequence, try \
2693 to do cursor movement as the last step in the sequence, since testing of \
2694 the cursor position is only done at the end of the sequence execution. \
2695 If you do cursor movement first, for example searching for a particular \
2696 word then doing a modification, the position of the cursor won't be \
2697 checked until the sequence has potentially gone far beyond the end of \
2698 your desired range.\n\
2700 It's easy for a repeated command to get out of hand, and you can easily \
2701 generate an infinite loop by using range iteration on a command which \
2702 doesn't progress. To cancel a repeating command in progress, type Ctrl+. \
2703 (period), or select Cancel Macro from the Macro menu.",
2705 "Macros can be called from Macro menu commands, window background menu \
2706 commands, within the smart-indent \
2707 framework, and from the .neditmacro file. Macro menu and window \
2708 background menu commands are defined under Preferences -> \
2709 Default Settings -> Customize Menus. Help on creating items in these menus \
2710 can be found in the section, Help -> Customizing -> Preferences. \
2711 The .neditmacro file is a file of macro commands and definitions which you \
2712 can create in your home directory, and \
2713 which NEdit will automatically load when it is first started.\n\
2715 NEdit's macro language is a simple interpreter with integer \
2716 arithmetic, dynamic strings, and C-style looping constructs \
2717 (very similar to the procedural portion of the Unix awk program). \
2718 From the macro language, you can call the same action routines \
2719 which are bound to keyboard keys and menu items, as well \
2720 additional subroutines for accessing and manipulating editor data, \
2721 which are specific to the macro language (these are listed in the \
2722 sections titled Macro Subroutines, and Actions).\n\
2725 SYNTAX\n\
2727 An NEdit macro language program consists of a list of statements, \
2728 each terminated by a newline. Groups of statements which are \
2729 executed together conditionally, such as the body of a loop, are \
2730 surrounded by curly braces \"{}\".\n\
2732 Blank lines and comments are also allowed. Comments begin with a \
2733 \"#\" and end with a newline, and can appear either on a line by \
2734 themselves, or at the end of a statement.\n\
2736 Statements which are too long to fit on a single line may be \
2737 split across several lines, by placing a backslash \"\\\" character \
2738 at the end of each line to be continued.\n\
2741 DATA TYPES\n\
2743 The NEdit macro language recognizes only two data types, dynamic \
2744 character strings, and integer values. In general strings and \
2745 integers can be used interchangeably. If a string represents an \
2746 integer value, it can be used as an integer. Integers can be \
2747 compared and concatenated with strings.\n\
2749 Integer Constants\n\
2751 Integers are non-fractional numbers in the range of -2147483647 to \
2752 2147483647. Integer constants must be in decimal. For example:\n\
2754 a = -1\n\
2755 b = 1000\n\
2757 Character String Constants\n\
2759 Character string constants are enclosed in \
2760 double quotes. For example:\n\
2762 a = \"a string\"\n\
2763 dialog(\"Hi there!\", \"Dismiss\")\n\
2765 Strings may also include C-language style escape sequences:\n\
2767 \\\\ Backslash \\t Tab \\f Form feed\n\
2768 \\\" Double quote \\b Backspace \\a Alert\n\
2769 \\n Newline \\r Carriage return \\v Vertical tab\n\
2771 For example, to send output to the terminal \
2772 from which nedit was started, a newline character is neccessary \
2773 because, like printf, t_print requires explicit newlines, and \
2774 also buffers its output on a per-line basis:\n\
2776 t_print(\"a = \" a \"\\n\")\n\
2779 VARIABLES\n\
2781 Variable names must begin either with a letter (local variables), or \
2782 a $ (global variables). Beyond the first character, variables may \
2783 also contain numbers and underscores `_'. Variables are called in to \
2784 existence just by setting them (no explicit declarations are necessary).\n\
2786 Local variables are limited in scope to \
2787 the subroutine (or menu item definition) in which they appear. \
2788 Global variables are accessible from all routines, and their values \
2789 persist beyond the call which created them, until reset.\n\
2791 Built-in Variables\n\
2793 NEdit has a number of permanently defined variables, which are used \
2794 to access global editor information and information about the the \
2795 window in which the macro is executing. These are listed along with \
2796 the built in functions in the section titled Macro Subroutines.\n\
2799 FUNCTIONS and SUBROUTINES\n\
2801 The syntax of a function or subroutine call is:\n\
2803 function_name(arg1, arg2, ...)\n\
2805 where arg1, arg2, etc. represent up to 9 argument values which are \
2806 passed to the routine being called. A function or subroutine call \
2807 can be on a line by itself, as above, or if it \
2808 returns a value, can be invoked within a character or numeric \
2809 expression:\n\
2811 a = fn1(b, c) + fn2(d)\n\
2812 dialog(\"fn3 says: \" fn3())\n\
2814 Arguments are passed by value. This means that you can not return \
2815 values via the argument list, only through the function value or \
2816 indirectly through agreed-upon global variables.\n\
2818 Built-in Functions\n\
2820 NEdit has a wide range of built in functions which can be called from \
2821 the macro language. These routines are divided into two classes, \
2822 macro-language functions, and editor action routines. Editor action \
2823 routines are more flexible, in that they may be called either from \
2824 the macro language, or bound directly to keys via translation tables. \
2825 They are also limited, however, in that they can not return values. \
2826 Macro language routines can return values, but can not be bound to \
2827 keys in translation tables.\n\
2829 Nearly all of the built-in subroutines operate on an implied window, \
2830 which is initially the window from which the macro was started. To \
2831 manipulate the contents of other windows, use the focus_window \
2832 subroutine to change the focus to the ones you wish to modify. \
2833 focus_window can also be used to iterate over all of the currently open \
2834 windows, using the special keyword names, \"last\" and \"next\".\n\
2836 For backwards compatibility, hyphenated action routine names are \
2837 allowed, and most of the existing action routines names which contain \
2838 underscores have an equivalent version containing hyphens ('-') \
2839 instead of underscores. Use of these names is discouraged. The macro \
2840 parser resolves the ambiguity between '-' as the subtraction/negation \
2841 operator, and - as part of an action routine name by assuming \
2842 subtraction unless the symbol specifically matches an action routine \
2843 name.\n\
2845 User Defined Functions\n\
2847 Users can define their own macro subroutines, using the define \
2848 keyword:\n\
2850 define subroutine_name {\n\
2851 < body of subroutine >\n\
2852 }\n\
2854 Macro definitions can not appear within other definitions, or within macro \
2855 menu item definitions (usually they are found in the .neditmacro file).\n\
2857 The arguments with which a user-defined subroutine or function was \
2858 invoked, are presented as $1, $2, ... , $9. The number of arguments \
2859 can be read from $n_args.\n\
2861 To return a value from a subroutine, and/or to exit from the subroutine \
2862 before the end of the subroutine body, use the return statement:\n\
2864 return <value to return>\n\
2867 OPERATORS AND EXPRESSIONS\n\
2869 Operators have the same meaning and precedence that they do in C, \
2870 except for ^, which raises a number to a power (y^x means y to the x \
2871 power), rather than bitwise exclusive OR. The table below lists \
2872 operators in decreasing order of precedence.\n\
2874 Operators Associativity\n\
2875 ()\n\
2876 ^ right to left\n\
2877 - ! ++ -- (unary)\n\
2878 * / % left to right\n\
2879 + - left to right\n\
2880 > >= < <= == != left to right\n\
2881 & left to right\n\
2882 | left to right\n\
2883 && left to right\n\
2884 || left to right\n\
2885 (concatenation) left to right\n\
2886 = += -= *= /= %=, &= |= right to left\n\
2888 The order in which operands are evaluated in an expression is \
2889 undefined, except for && and ||, which like C, evaluate operands left \
2890 to right, but stop when further evaluation would no longer change the \
2891 result.\n\
2893 Numerical Operators\n\
2895 The numeric operators supported by the NEdit macro language are listed \
2896 below:\n\
2898 + addition\n\
2899 - subtraction or negation\n\
2900 * multiplication\n\
2901 / division\n\
2902 % modulo\n\
2903 ^ power\n\
2904 & bitwise and\n\
2905 | bitwise or\n\
2907 Increment (++) and decrement (--) operators can also be appended or \
2908 prepended to variables within an expression. Prepended increment/decrement \
2909 operators act before the variable is evaulated. Appended increment/decrement \
2910 operators act after the variable is evaluated.\n\
2912 Logical and Comparison Operators\n\
2914 Logical operations produce a result of 0 (for false) or 1 (for true). \
2915 In a logical operation, any non-zero value is recognized to mean true. \
2916 The logical and comparison operators allowed in the NEdit macro \
2917 language are listed below:\n\
2919 && logical and\n\
2920 || logical or\n\
2921 ! not\n\
2922 > greater\n\
2923 < less\n\
2924 >= greater or equal\n\
2925 <= less or equal\n\
2926 == equal (integers and/or strings)\n\
2927 != not equal (integers and/or strings)\n\
2929 Character String Operators\n\
2931 The \"operator\" for concatenating two strings is the absence of an \
2932 operator. Adjoining character strings with no operator in between \
2933 means concatenation:\n\
2935 d = a b \"string\" c\n\
2936 t_print(\"the value of a is: \" a)\n\
2938 Comparison between character strings is done with the == and != \
2939 operators, (as with integers). There are a number of useful \
2940 built-in routines for working with character strings, which are \
2941 listed in the section called Macro Subroutines.\n\
2944 LOOPING AND CONDITIONALS\n\
2946 NEdit supports looping constructs: for and while, and conditional \
2947 statements: if and else, with essentially the same syntax as C:\n\
2949 for (<init>, ...; <condition>; <increment>, ...) <body>\n\
2951 while (<condition>) <body>\n\
2953 if (<condition>) <body>\n\
2955 if (<condition>) <body> else <body>\n\
2957 <body>, as in C, can be a single statement, or a list of statements \
2958 enclosed in curly braces ({}). <condition> is an expression which \
2959 must evaluate to true for the statements in <body> to be executed. \
2960 for loops may also contain initialization statements, <init>, \
2961 executed once at the beginning of the loop, and increment/decrement \
2962 statements (or any arbitrary statement), which are executed at the end \
2963 of the loop, before the condition is evaluated again.\n\
2965 Examples:\n\
2967 for (i=0; i<100; i++)\n\
2968 j = i * 2\n\
2970 for (i=0, j=20; i<20; i++, j--) {\n\
2971 k = i * j\n\
2972 t_print(i, j, k)\n\
2973 }\n\
2975 while (k > 0)\n\
2976 {\n\
2977 k = k - 1\n\
2978 t_print(k)\n\
2979 }\n\
2981 for (;;) {\n\
2982 if (i-- < 1)\n\
2983 break\n\
2984 }\n\
2986 Loops may contain break and continue statements. A break statement \
2987 causes an exit from the innermost loop, a continue statement transfers \
2988 control to the end of the loop.",
2990 "Built in Variables\n\
2992 $cursor -- Position of the cursor in the current window.\n\
2994 $column -- Column number of the cursor position in the current window.\n\
2996 $em_tab_dist -- If tab emulation is turned on in the Tabs... dialog of \
2997 the Preferences menu, value is the distance between emulated tab stops. If \
2998 tab emulation is turned off, value is -1.\n\
3000 $file_name -- Name of the file being edited in the current window, \
3001 stripped of directory component.\n\
3003 $file_path -- Directory component of file being edited in the \
3004 current window.\n\
3006 $language_mode -- Name of language mode set in the current window.\n\
3008 $line -- Line number of the cursor position in the current window.\n\
3010 $modified -- True if the file in the current window has been modified \
3011 and the modifications have not yet been saved.\n\
3013 $selection_start, $selection_end -- Beginning and ending positions of \
3014 the primary selection in the current window, or -1 if there is no \
3015 text selected in the current window.\n\
3017 $selection_left, $selection_right -- Left and right character offsets of \
3018 the rectangular (primary) selection in the current window, or -1 if \
3019 there is no selection or it is not rectangular.\n\
3021 $tab_dist -- The distance between tab stops for a hardware tab \
3022 character, as set in the Tabs... dialog of the Preferences menu.\n\
3024 $text_length -- The length of the text in the current window.\n\
3026 $use_tabs -- Whether the user is allowing the NEdit to insert tab \
3027 characters to maintain spacing in tab emulation and rectangular \
3028 dragging operations. (The setting of the \"Use tab characters in \
3029 padding and emulated tabs\" button in the Tabs... dialog of the \
3030 Preferences menu.)\n\
3032 $wrap_margin -- The right margin in the current window for text \
3033 wrapping and filling.\n\
3036 Built-in Subroutines\n\
3038 append_file(string, filename) -- Appends a string to \
3039 a named file. Returns 1 on successful write, or 0 \
3040 if unsuccessful.\n\
3042 beep() -- Ring the bell\n\
3044 clipboard_to_string() -- Returns the contents of the clipboard \
3045 as a macro string. Returns empty string on error.\n\
3047 dialog(message, btn_1_label, btn_2_label, ...) -- Pop up a dialog \
3048 for querying and presenting information to the user. First \
3049 argument is a string to show in the message area of the dialog. Up \
3050 to eight additional optional arguments represent labels for buttons \
3051 to appear along the bottom of the dialog. Returns the number of \
3052 the button pressed (the first button is number 1), or 0 if the \
3053 user closed the dialog via the window close box.\n\
3055 focus_window(window_name) -- Sets the window on which subsequent \
3056 macro commands operate. window_name can be either a fully qualified \
3057 file name, or one of \"last\" for the last window created, or \"next\" \
3058 for the next window in the chain from the currently focused window (the \
3059 first window being the one returned from calling focus_window(\"last\"). \
3060 Returns the name of the newly-focused window, or an empty string \
3061 if the requested window was not found.\n\
3063 get_character(position) -- Returns the single character at the \
3064 position indicated by the first argument to the routine from the \
3065 current window.\n\
3067 get_range(start, end) -- Returns the text between a starting and \
3068 ending position from the current window.\n\
3070 get_selection() -- Returns a string containing the text currently \
3071 selected by the primary selection either from the current window (no \
3072 keyword), or from anywhere on the screen (keyword \"any\").\n\
3074 getenv(name) -- Gets the value of an environment variable.\n\
3076 length(string) -- Returns the length of a string\n\
3078 list_dialog(message, text, btn_1_label, btn_2_label, ...) -- Pop up a \
3079 dialog for prompting the user to choose a line from the given text \
3080 string. The first argument is a message string to be used as a title \
3081 for the fixed text describing the list. The second string provides \
3082 the list data: this is a text string in which list entries are \
3083 separated by newline characters. Up to seven additional optional \
3084 arguments represent labels for buttons to appear along the bottom of \
3085 the dialog. Returns the line of text selected by the user as the \
3086 function value (without any newline separator) or the empty string if \
3087 none was selected, and number of the button pressed (the first button \
3088 is number 1), in $list_dialog_button. If the user closes the dialog \
3089 via the window close box, the function returns the empty string, and \
3090 $list_dialog_button returns 0.\n\
3092 max(n1, n2, ...) -- Returns the maximum value of all of its \
3093 arguments\n\
3095 min(n1, n2, ...) -- Returns the minimum value of all of its \
3096 arguments\n\
3098 read_file(filename) -- Reads the contents of a text file into a \
3099 string. On success, returns 1 in $read_status, and the contents of \
3100 the file as a string in the subroutine return value. On failure, \
3101 returns the empty string \"\" and an 0 $read_status.\n\
3103 replace_in_string(string, search_for, replace_with, [type]) -- \
3104 Replaces all occurrences of a search string in a string with a \
3105 replacement string. Arguments are 1: string to search in, 2: \
3106 string to search for, 3: replacement string. Argument 4 is an \
3107 optional search type, one of \"literal\", \"case\" or \"regex\". The \
3108 default search type is \"literal\". Returns a new string with all of \
3109 the replacements done, or an empty string (\"\") if no occurrences \
3110 were found.\n\
3112 replace_range(start, end, string) -- Replaces all of the text in the \
3113 current window between two positions\n\
3115 replace_selection(string) -- Replaces the primary-selection \
3116 selected text in the current window.\n\
3118 replace_substring(string, start, end, replace_with) -- Replacing a \
3119 substring between two positions in a string within another string.\n\
3121 search(search_for, start, [search_type, wrap, direction]) -- \
3122 Searches silently in a window without dialogs, beeps, or changes to \
3123 the selection. Arguments are: 1: string to search for, 2: starting \
3124 position. Optional arguments may include the strings: \"wrap\" to \
3125 make the search wrap around the beginning or end of the string, \
3126 \"backward\" or \"forward\" to change the search direction (\"forward\" \
3127 is the default), \"literal\", \"case\" or \"regex\" to change the search \
3128 type (default is \"literal\"). Returns the starting position of the \
3129 match, or -1 if nothing matched. also returns the ending position \
3130 of the match in search_end\n\
3132 search_string(string, search_for, start, [search_type, direction]) \
3133 -- Built-in macro subroutine for searching a string. Arguments are \
3134 1: string to search in, 2: string to search for, 3: starting \
3135 position. Optional arguments may include the strings: \"wrap\" to \
3136 make the search wrap around the beginning or end of the string, \
3137 \"backward\" or \"forward\" to change the search direction (\"forward\" \
3138 is the default), \"literal\", \"case\" or \"regex\" to change the search \
3139 type (default is \"literal\"). Returns the starting position of the \
3140 match, or -1 if nothing matched. Also returns the ending position \
3141 of the match in $search_end\n\
3143 select(start, end) -- Selects (with the primary selection) text in \
3144 the current buffer between a starting and ending position.\n\
3146 select_rectangle(start, end, left, right) -- Selects a rectangular \
3147 area of text between a starting and ending position, and confined \
3148 horizontally to characters displayed between positions \"left\", and \
3149 \"right\".\n\
3151 set_cursor_pos(pos) -- Set the cursor position for the current window.\n\
3153 set_language_mode(mode) -- Change language mode for the current \
3154 window.\n\
3156 shell_command(command, input_string) -- executes a shell command, feeding \
3157 it input from input_string. On completion, output from the command \
3158 is returned as the function value, and the command's exit status is \
3159 returned in the global variable $shell_cmd_status.\n\
3161 string_dialog(message, btn_1_label, btn_2_label, ...) -- Pop up a \
3162 dialog prompting the user to enter information. The first \
3163 argument is a string to show in the message area of the dialog. Up \
3164 to nine additional optional arguments represent labels for buttons \
3165 to appear along the bottom of the dialog. Returns the string \
3166 entered by the user as the function value, and number of the button \
3167 pressed (the first button is number 1), in $string_dialog_button. \
3168 If the user closes the dialog via the window close box, the function \
3169 returns the empty string, and $string_dialog_button returns 0.\n\
3171 string_to_clipboard(string) -- Copy the contents of a macro string \
3172 to the clipboard.\n\
3174 substring(string, start, end) -- Returns the portion of a string \
3175 between a starting and ending position.\n\
3177 t_print(string1, string2, ...) -- Writes strings to the terminal \
3178 (stdout) from which NEdit was started.\n\
3180 tolower(string) -- Return an all lower-case version of string.\n\
3182 toupper(string) -- Return an all upper-case version of string.\n\
3184 write_file(string, filename) -- Writes a string (parameter 1) to a \
3185 file named in parameter 2. Returns 1 on successful write, or 0 if \
3186 unsuccessful.",
3188 "All of the editing capabilities of NEdit are represented as a special type of \
3189 subroutine, called an action routine, which can be invoked from both \
3190 macros and translation table entries (see \"Binding Keys to Actions\" \
3191 in the X Resources section of the Help menu).\n\
3194 Actions Representing Menu Commands:\n\
3196 File Menu Search Menu\n\
3197 --------------------- -----------------------\n\
3198 new() find()\n\
3199 open() find_dialog()\n\
3200 open_dialog() find_again()\n\
3201 open_selected() find_selection()\n\
3202 close() replace()\n\
3203 save() replace_dialog()\n\
3204 save_as() replace_all()\n\
3205 save_as_dialog() replace_in_selection()\n\
3206 revert_to_saved() replace_again()\n\
3207 include_file() goto_line_number()\n\
3208 include_file_dialog() goto_line_number_dialog()\n\
3209 load_tags_file() goto_selected()\n\
3210 load_tags_file_dialog() mark()\n\
3211 load_macro_file() mark_dialog()\n\
3212 load_macro_file_dialog() goto_mark()\n\
3213 print() goto_mark_dialog()\n\
3214 print_selection() goto_matching()\n\
3215 unload_tags_file() select_to_matching()\n\
3216 exit() find_definition()\n\
3217 split_window()\n\
3218 close_pane()\n\
3219 Edit Menu \n\
3220 --------------------- Shell Menu\n\
3221 undo() -----------------------\n\
3222 redo() filter_selection_dialog()\n\
3223 delete() filter_selection()\n\
3224 select_all() execute_command()\n\
3225 shift_left() execute_command_dialog()\n\
3226 shift_left_by_tab() execute_command_line()\n\
3227 shift_right() shell_menu_command()\n\
3228 shift_right_by_tab() \n\
3229 uppercase() Macro Menu\n\
3230 lowercase() -----------------------\n\
3231 fill_paragraph() macro_menu_command()\n\
3232 control_code_dialog() repeat_macro()\n\
3233 repeat_dialog()\n\
3235 The actions representing menu commands are named the same as the menu item \
3236 with punctuation removed, all lower case, and underscores \
3237 replacing spaces. Without the \
3238 _dialog suffix, commands which normally prompt the user for information, \
3239 instead take the information from the routine's arguments (see below). To \
3240 present a dialog and ask the user for input, rather than supplying it in via \
3241 arguments, use the actions with the _dialog suffix.\n\
3243 Menu Action Routine Arguments:\n\
3245 Arguments are text strings enclosed in quotes. Below are the menu action \
3246 routines which take arguments. Optional arguments are enclosed in [].\n\
3248 open(filename)\n\
3250 save_as(filename)\n\
3252 include(filename)\n\
3254 load_tags_file(filename)\n\
3256 unload_tags_file(filename)\n\
3258 find_dialog([search_direction])\n\
3260 find(search_string [, search-direction], [search-type])\n\
3262 find_again([search-direction])\n\
3264 find_selection([search-direction])\n\
3266 replace_dialog([search-direction])\n\
3268 replace(search-string, replace-string,\n\
3269 [, search-direction] [, search-type])\n\
3271 replace_in_selection(search-string, replace-string\n\
3272 [, search-type])\n\
3274 replace_again([search-direction])\n\
3276 goto_line_number([line-number])\n\
3278 mark(mark-letter)\n\
3280 goto_mark(mark-letter)\n\
3282 find_definition([tag-name])\n\
3284 filter_selection(shell-command)\n\
3286 execute_command(shell-command)\n\
3288 shell_menu_command(shell-menu-item-name)\n\
3290 macro_menu_command(macro-menu-item-name)\n\
3292 Some notes on argument types above:\n\
3294 filename Path names are interpreted relative\n\
3295 to the directory from which NEdit was\n\
3296 started, wildcards and ~ are not\n\
3297 expanded.\n\
3299 search-direction Either \"forward\" or \"backward\"\n\
3301 search-type Either \"literal\", \"case\", or \"regex\"\n\
3303 mark-letter The mark command limits users to\n\
3304 single letters. Inside of macros,\n\
3305 numeric marks are allowed, which won't\n\
3306 interfere with marks set by the user.\n\
3308 (macro or shell) Name of the command exactly as\n\
3309 -menu-item-name specified in the Shell Menu or\n\
3310 Macro Menu dialogs\n\
3313 Keyboard-Only Actions\n\
3315 backward_character()\n\
3316 Moves the cursor one character to the left.\n\
3318 backward_paragraph()\n\
3319 Moves the cursor to the beginning of the paragraph, or if the \
3320 cursor is already at the beginning of a paragraph, moves the cursor \
3321 to the beginning of the previous paragraph. Paragraphs are \
3322 defined as regions of text delimited by one or more blank lines.\n\
3324 backward_word()\n\
3325 Moves the cursor to the beginning of a word, or, if the \
3326 cursor is already at the beginning of a word, moves the \
3327 cursor to the beginning of the previous word. Word delimiters \
3328 are user-settable, and defined by the X resource wordDelimiters.\n\
3330 beginning_of_file()\n\
3331 Moves the cursor to the beginning of the file.\n\
3333 beginning_of_line()\n\
3334 Moves the cursor to the beginning of the line.\n\
3336 beginning_of_selection()\n\
3337 Moves the cursor to the beginning of the selection \
3338 without disturbing the selection.\n\
3340 copy_clipboard()\n\
3341 Copies the current selection to the clipboard.\n\
3343 copy_primary()\n\
3344 Copies the primary selection to the cursor.\n\
3346 copy_to()\n\
3347 If a secondary selection exists, copies the secondary selection to the \
3348 cursor. If no secondary selection exists, copies the primary \
3349 selection to the \
3350 pointer location.\n\
3352 copy_to_or_end_drag()\n\
3353 Completes either a secondary selection operation, or a primary \
3354 drag. If the user is dragging the mouse to adjust a secondary selection, \
3355 the selection is copied and either inserted at the cursor location, \
3356 or, if pending-delete is on and a primary selection exists in the window, \
3357 replaces the primary selection. If the user is dragging a block of \
3358 text (primary selection), completes the drag operation and leaves the \
3359 text at it's current location.\n\
3361 cut_clipboard()\n\
3362 Deletes the text in the primary selection and places it in the clipboard.\n\
3364 cut_primary()\n\
3365 Copies the primary selection to the cursor and deletes it \
3366 at its original location.\n\
3368 delete_selection()\n\
3369 Deletes the contents of the primary selection.\n\
3371 delete_next_character()\n\
3372 If a primary selection exists, deletes its contents. Otherwise, \
3373 deletes the character following the cursor.\n\
3375 delete_previous_character()\n\
3376 If a primary selection exists, deletes its contents. Otherwise, \
3377 deletes the character before the cursor.\n\
3379 delete_next_word()\n\
3380 If a primary selection exists, deletes its contents. Otherwise, \
3381 deletes the word following the cursor.\n\
3383 delete_previous_word()\n\
3384 If a primary selection exists, deletes its contents. Otherwise, \
3385 deletes the word before the cursor.\n\
3387 delete_to_start_of_line()\n\
3388 If a primary selection exists, deletes its contents. Otherwise, \
3389 deletes the characters between the cursor \
3390 and the start of the line.\n\
3392 delete_to_end_of_line()\n\
3393 If a primary selection exists, deletes its contents. Otherwise, \
3394 deletes the characters between the cursor \
3395 and the end of the line.\n\
3397 deselect_all()\n\
3398 De-selects the primary selection.\n\
3400 end_of_file()\n\
3401 Moves the cursor to the end of the file.\n\
3403 end_of_line()\n\
3404 Moves the cursor to the end of the line.\n\
3406 end_of_selection()\n\
3407 Moves the cursor to the end of the selection \
3408 without disturbing the selection.\n\
3410 exchange()\n\
3411 Exchange the primary and secondary selections.\n\
3413 extend_adjust()\n\
3414 Attached mouse-movement events to begin a selection between the \
3415 cursor and the mouse, or extend the primary selection to the \
3416 mouse position.\n\
3418 extend_end()\n\
3419 Completes a primary drag-selection operation.\n\
3421 extend_start()\n\
3422 Begins a selection between the \
3423 cursor and the mouse. A drag-selection operation can be started with \
3424 either extend_start or grab_focus.\n\
3426 forward_character()\n\
3427 Moves the cursor one character to the right.\n\
3429 forward_paragraph()\n\
3430 Moves the cursor to the beginning of the next paragraph. Paragraphs are \
3431 defined as regions of text delimited by one or more blank lines.\n\
3433 forward_word()\n\
3434 Moves the cursor to the beginning of the next word. Word delimiters \
3435 are user-settable, and defined by the X resource wordDelimiters.\n\
3437 grab_focus()\n\
3438 Moves the cursor to the mouse pointer location, and prepares for \
3439 a possible drag-selection operation (bound to extend_adjust), or \
3440 multi-click operation (a further grab_focus action). If a second \
3441 invocation of grab focus follows immediately, it selects a whole word, \
3442 or a third, a whole line.\n\
3444 insert_string(\"string\") \n\
3445 If pending delete is on and the cursor is inside the selection, replaces \
3446 the selection with \"string\". Otherwise, inserts \"string\" at the \
3447 cursor location.\n\
3449 key_select(\"direction\")\n\
3450 Moves the cursor one character in \
3451 \"direction\" (\"left\", \"right\", \"up\", or \"down\") and extends the \
3452 selection. Same as forward/backward-character(\"extend\"), or \
3453 process-up/down(\"extend\"), for compatibility with previous versions.\n\
3455 move-destination()\n\
3456 Moves the cursor to the pointer location without disturbing the selection. \
3457 (This is an unusual way of working. We left it in for compatibility with \
3458 previous versions, but if you actually use this capability, please send us some \
3459 mail, otherwise it is likely to disappear in the future.\n\
3461 move_to()\n\
3462 If a secondary selection exists, deletes the contents of the secondary \
3463 selection and inserts it at the cursor, or if pending-delete is on and there is \
3464 a primary selection, replaces the primary selection. If no secondary selection \
3465 exists, moves the primary selection to the pointer location, deleting it \
3466 from its original position.\n\
3468 move_to_or_end_drag()\n\
3469 Completes either a secondary selection operation, or a primary \
3470 drag. If the user is dragging the mouse to adjust a secondary selection, \
3471 the selection is deleted and either inserted at the cursor location, \
3472 or, if pending-delete is on and a primary selection exists in the window, \
3473 replaces the primary selection. If the user is dragging a block of \
3474 text (primary selection), completes the drag operation and deletes the \
3475 text from it's current location.\n\
3477 newline()\n\
3478 Inserts a newline character. If Auto Indent is on, lines up the indentation \
3479 of the cursor with the current line.\n\
3481 newline_and_indent()\n\
3482 Inserts a newline character and lines up the indentation \
3483 of the cursor with the current line, regardless of the setting of Auto Indent.\n\
3485 newline_no_indent()\n\
3486 Inserts a newline character, without automatic indentation, regardless of \
3487 the setting of Auto Indent.\n\
3489 next_page()\n\
3490 Moves the cursor and scroll forward one page.\n\
3492 page_left()\n\
3493 Move the cursor and scroll left one page.\n\
3495 page_right()\n\
3496 Move the cursor and scroll right one page.\n\
3498 paste_clipboard()\n\
3499 Insert the contents of the clipboard at the cursor, or if pending delete \
3500 is on, replace the primary selection with the contents of the clipboard.\n\
3502 previous_page()\n\
3503 Moves the cursor and scroll backward one page.\n\
3505 process_bdrag()\n\
3506 Same as secondary_or_drag_start for compatibility with previous versions.\n\
3508 process_cancel()\n\
3509 Cancels the current extend_adjust, secondary_adjust, or \
3510 secondary_or_drag_adjust in progress.\n\
3512 process_down()\n\
3513 Moves the cursor down one line.\n\
3515 process_return()\n\
3516 Same as newline for compatibility with previous versions.\n\
3518 process_shift_down()\n\
3519 Same as process_down(\"extend\") for compatibility with previous versions.\n\
3521 process_shift_up()\n\
3522 Same as process_up(\"extend\") for compatibility with previous versions.\n\
3524 process_tab()\n\
3525 If tab emulation is turned on, inserts an emulated tab, otherwise inserts \
3526 a tab character.\n\
3528 process_up()\n\
3529 Moves the cursor up one line.\n\
3531 scroll_down(nLines)\n\
3532 Scroll the display down (towards the end of the file) by nLines.\n\
3534 scroll_up(nLines)\n\
3535 Scroll the display up (towards the beginning of the file) by nLines.\n\
3537 scroll_to_line(lineNum)\n\
3538 Scroll to position line number lineNum at the top of the \
3539 pane. The first line of a file is line 1.\n\
3541 secondary_adjust()\n\
3542 Attached mouse-movement events to extend the secondary selection to the \
3543 mouse position.\n\
3545 secondary_or_drag_adjust()\n\
3546 Attached mouse-movement events to extend the secondary selection, or \
3547 reposition the primary text being dragged. Takes two optional arguments, \
3548 \"copy\", and \"overlay\". \"copy\" leaves a copy of the dragged text \
3549 at the site at which the drag began. \"overlay\" does the drag in overlay \
3550 mode, meaning the dragged text is laid on top of the existing text, \
3551 obscuring and ultimately deleting it when the drag is complete.\n\
3553 secondary_or_drag_start()\n\
3554 To be attached to a mouse down event. Begins drag selecting a secondary \
3555 selection, or dragging the contents of the primary selection, depending on \
3556 whether the mouse is pressed inside of an existing primary selection.\n\
3558 secondary_start()\n\
3559 To be attached to a mouse down event. Begin drag selecting a secondary \
3560 selection.\n\
3562 select_all()\n\
3563 Select the entire file.\n\
3565 self_insert()\n\
3566 To be attached to a key-press event, inserts the character equivalent \
3567 of the key pressed.\n\
3569 Arguments to Keyboard Action Routines \n\
3571 In addition to the arguments listed in the call descriptions, any routine \
3572 involving cursor movement can take the argument \"extend\", meaning, adjust \
3573 the primary selection to the new cursor position. Routines which take \
3574 the \"extend\" argument as well as mouse dragging operations for both \
3575 primary and secondary selections can take the optional keyword \"rect\", \
3576 meaning, make the selection rectangular.",
3578 "WRITING SYNTAX HIGHLIGHTING PATTERNS\n\
3580 Patterns are the mechanism by which syntax highlighting (see Syntax \
3581 Highlighting under the heading of Features for Programming) \
3582 is programmed in NEdit, that is, how it decides what to highlight in a given \
3583 language. \
3584 To create syntax highlighting patterns for a new language, or to \
3585 modify existing patterns, select \"Recognition Patterns\" from \
3586 \"Syntax Highlighting\" sub-section of the \"Default Settings\" sub-menu \
3587 of the \"Preferences\" menu.\n\
3589 First, a word of caution. As with regular expression matching in \
3590 general, it is quite possible to write patterns which are so \
3591 inefficient that they essentially lock up the editor as they \
3592 recursively re-examine the entire contents of the file thousands of \
3593 times. With the multiplicity of patterns, the possibility of a lock-up \
3594 is significantly increased in syntax highlighting. When working \
3595 on highlighting patterns, be sure to save your work frequently.\n\
3597 NEdit's syntax highlighting is unusual in that it works in real-time \
3598 (as you type), and yet is completely programmable using standard \
3599 regular expression notation. Other syntax highlighting editors usually fall \
3600 either into the category of fully programmable but unable to keep up in \
3601 real-time, or real-time but limited programmability. The additional \
3602 burden that NEdit places on pattern writers in order to achieve this \
3603 speed/flexibility mix, is to force them to state self-imposed \
3604 limitations on the amount of context that patterns may examine when \
3605 re-parsing after a change. While the \"Pattern Context Requirements\" \
3606 heading is near the end of this section, it is not optional, and must be \
3607 understood before making any any serious effort at pattern writing.\n\
3609 In its simplest form, a highlight pattern consists of a regular \
3610 expression to match, along with a style representing the font an color \
3611 for displaying any text which matches that expression. To bold the \
3612 word, \"highlight\", wherever it appears the text, the regular expression \
3613 simply would be the word \"highlight\". The style (selected from the menu \
3614 under the heading of \"Highlight Style\") determines how the text will be \
3615 drawn. To bold the text, either select an existing style, such as \
3616 \"Keyword\", which bolds text, or create a new style and select it \
3617 under Highlight Style.\n\
3619 The full range of regular expression capabilities can be applied in \
3620 such a pattern, with the single caveat that the expression must \
3621 conclusively match or not match, within the pre-defined context \
3622 distance (as discussed below under Pattern Context Requirements).\n\
3624 To match longer ranges of text, particularly any constructs which \
3625 exceed the requested context, you must use a pattern which highlights \
3626 text between a starting and ending regular expression match. To do so, \
3627 select \"Highlight text between starting and ending REs\" under \
3628 \"Matching\", and enter both a starting and ending regular expression. \
3629 For example, to highlight everything between double quotes, you would \
3630 enter a double quote character in both the starting and ending regular \
3631 expression fields. Patterns with both a beginning and ending expression span \
3632 all characters between the two expressions, including newlines.\n\
3634 Again, the limitation for automatic parsing to operate properly is that \
3635 both expressions must match within the context distance stated for the \
3636 pattern set.\n\
3638 With the ability to span large distances, comes the responsibility to \
3639 recover when things go wrong. Remember that syntax highlighting is \
3640 called upon to parse incorrect or incomplete syntax as often as correct \
3641 syntax. To stop a pattern short of matching its end expression, you can \
3642 specify an error expression, which stops the pattern from gobbling up \
3643 more than it should. For example, if the text between double quotes \
3644 shouldn't contain newlines, the error expression might be \"$\". As with \
3645 both starting and ending expressions, error expressions must also match \
3646 within the requested context distance.\n\
3648 Coloring Sub-Expressions\n\
3650 It is also possible to color areas of text within a regular \
3651 expression match. A pattern of this type associates a style with \
3652 sub-expressions references of the parent pattern (as used in regular \
3653 expression substitution patterns, see the NEdit Help menu item on \
3654 Regular Expressions). Sub-expressions of both the starting and ending \
3655 patterns may be colored. For example, if the parent pattern has a \
3656 starting expression \"\\<\", and end expression \"\\>\", (for highlighting \
3657 all of the text contained within angle brackets), a sub-pattern using \
3658 \"&\" in both the starting and ending expression fields could color the \
3659 brackets differently from the intervening text. A quick shortcut to \
3660 typing in pattern names in the Parent Pattern field is to use the \
3661 middle mouse button to drag them from the Patterns list.\n\
3663 Hierarchical Patterns\n\
3665 A hierarchical sub-pattern, is identical to a top level pattern, but is \
3666 invoked only between the beginning and ending expression matches of its \
3667 parent pattern. Like the sub-expression coloring patterns discussed \
3668 above, it is associated with a parent pattern using the Parent Pattern \
3669 field in the pattern specification. Pattern names can be dragged from \
3670 the pattern list with the middle mouse button to the Parent Pattern \
3671 field.\n\
3673 After the start expression of the parent pattern matches, the syntax \
3674 highlighting parser searches for either the parent's end pattern or a \
3675 matching sub-pattern. When a sub-pattern matches, control is not \
3676 returned to the parent pattern until the entire sub-pattern has been \
3677 parsed, regardless of whether the parent's end pattern appears in the \
3678 text matched by the sub-pattern.\n\
3680 The most common use for this capability is for coloring sub-structure \
3681 of language constructs (smaller patterns embedded in larger patterns). \
3682 Hierarchical patterns can also simplify parsing by having sub-patterns \
3683 \"hide\" special syntax from parent patterns, such as special escape \
3684 sequences or internal comments.\n\
3686 There is no depth limit in nesting hierarchical sub-patterns, but \
3687 beyond the third level of nesting, automatic re-parsing will sometimes \
3688 have to re-parse more than the requested context distance to guarantee \
3689 a correct parse (which can slow down the maximum rate at which the user \
3690 can type if large sections of text are matched only by deeply nested \
3691 patterns).\n\
3693 While this is obviously not a complete hierarchical language parser it \
3694 is still useful in many text coloring situations. As a pattern writer, \
3695 your goal is not to completely cover the language syntax, but to \
3696 generate colorings that are useful to the programmer. Simpler patterns \
3697 are usually more efficient and also more robust when applied to \
3698 incorrect code.\n\
3700 Deferred (Pass-2) Parsing\n\
3702 NEdit does pattern matching for syntax highlighting in two passes. The \
3703 first pass is applied to the entire file when syntax highlighting is \
3704 first turned on, and to new ranges of text when they are initially read \
3705 or pasted in. The second pass is applied only as needed when text is \
3706 exposed (scrolled in to view).\n\
3708 If you have a particularly complex set of patterns, and parsing is \
3709 beginning to add a noticeable delay to opening files or operations \
3710 which change large regions of text, you can defer some of that parsing \
3711 from startup time, to when it is actually needed for viewing the text. \
3712 Deferred parsing can only be used with single expression patterns, or \
3713 begin/end patterns which match entirely within the requested context \
3714 distance. To defer the parsing of a pattern to when \
3715 the text is exposed, click on the Pass-2 pattern type button in the \
3716 highlight patterns dialog.\n\
3718 Sometimes a pattern can't be deferred, not because of context \
3719 requirements, but because it must run concurrently with pass-1 \
3720 (non-deferred) patterns. If they didn't run concurrently, a pass-1 \
3721 pattern might incorrectly match some of the characters which would \
3722 normally be hidden inside of a sequence matched by the deferred \
3723 pattern. For example, C has character constants enclosed in single \
3724 quotes. These typically do not cross line boundaries, meaning they can \
3725 be parsed entirely within the context distance of the C pattern set and \
3726 should be good candidates for deferred parsing. However, they can't be \
3727 deferred because they can contain sequences of characters which can \
3728 trigger pass-one patterns. Specifically, the sequence, '\\\"', contains \
3729 a double quote character, which would be matched by the string pattern \
3730 and interpreted as introducing a string.\n\
3732 Pattern Context Requirements\n\
3734 The context requirements of a pattern set state how much additional \
3735 text around any change must be examined to guarantee that \
3736 the patterns will match what they are intended to match. Context \
3737 requirements are a promise by NEdit to the pattern writer, that the \
3738 regular expressions in his/her patterns will be matched against at \
3739 least <line context> lines and <character context> characters, around \
3740 any modified text. Combining line and character requirements guarantee \
3741 that both will be met.\n\
3743 Automatic re-parsing happens on EVERY KEYSTROKE, so the amount of \
3744 context which must be examined is very critical to typing efficiency. \
3745 The more complicated your patterns, the more critical the context \
3746 becomes. To cover all of the keywords in a typical language, without \
3747 affecting the maximum rate at which users can enter text, you may be \
3748 limited to just a few lines and/or a few hundred characters of context.\n\
3750 The default context distance is 1 line, with no minimum character \
3751 requirement. There are several benefits to sticking with this \
3752 default. One is simply that it is easy to understand and to comply \
3753 with. Regular expression notation is designed around single line \
3754 matching. To span lines in a regular expression, you must explicitly \
3755 mention the newline character \"\\n\", and matches which are restricted to \
3756 a single line are virtually immune to lock-ups. Also, if you can code \
3757 your patterns to work within a single line of context, without an \
3758 additional character-range context requirement, the parser can take \
3759 advantage the fact that patterns don't cross line boundaries, and \
3760 nearly double its efficiency over a one-line and 1-character context \
3761 requirement. (In a single line context, you are allowed to match \
3762 newlines, but only as the first and/or last character.)",
3764 "Smart indent macros can be written for any language, but are usually \
3765 more difficult to write than highlighting patterns. A good place to start, \
3766 of course, is to look at the existing macros for C and C++.\n\
3768 Smart indent macros for a language mode consist of standard NEdit macro \
3769 language code attached to any or all of the following three activation \
3770 conditions: \
3771 1) When smart indent is first turned on for a text window containing code \
3772 of the language, 2) When a newline is typed and smart indent is expected, 3) \
3773 after any character is typed. To attach macro code to any of these code \
3774 \"hooks\", enter it in the appropriate section in the Preferences -> \
3775 Default Settings -> Auto Indent -> Program Smart Indent dialog.\n\
3777 Typically most of the code should go in the initialization section, because \
3778 that is the appropriate place for subroutine definitions, and smart indent \
3779 macros are complicated enough that you are not likely to want to write them \
3780 as one monolithic run of code. You may also put code in the Common/Shared \
3781 Initialization section (accessible through the button in the upper left \
3782 corner of the dialog). Unfortunately, since the C/C++ macros also reside \
3783 in the common/shared section, when you add code there, you run some risk of \
3784 missing out on future \
3785 upgrades to these macros, because your changes will override the built-in \
3786 defaults.\n\
3788 The newline macro is invoked after the user types a newline, but before the \
3789 newline is entered in the buffer. It takes a single argument ($1) which is \
3790 the position at which the newline will be inserted. It must return the \
3791 number of characters of indentation the line should have, or -1. A \
3792 return value of -1 means to do a standard auto-indent. You must supply \
3793 a newline macro, but the code: \"return -1\" (auto-indent), or \"return 0\" \
3794 (no indent) is sufficient.\n\
3796 The type-in macro takes two arguments. $1 is the insert position, and $2 is \
3797 the character just inserted, and does not return a value. You can do just \
3798 about anything here, but keep in mind that this macro is executed for every \
3799 keystroke typed, so if you try to get too fancy, you may degrade performance.",
3801 "SOLUTIONS TO COMMON PROBLEMS\n\
3803 For a much more comprehensive list of common problems and solutions, \
3804 see the NEdit FAQ. The latest \
3805 version of the FAQ can always be found on the nedit web site at:\n\
3807 http://nedit.org.\n\
3809 P: No files are shown in the \"Files\" list in the Open... dialog.\n\
3810 S: When you use the \"Filter\" field, include the file specification or a \
3811 complete directory specification, including the trailing \"/\" on Unix. \
3812 (See Help in the Open... dialog).\n\
3814 P: Keyboard shortcuts for menu items don't work.\n\
3815 S: Be sure the Caps Lock and Num Lock keys are both unlocked. In Motif \
3816 programs, these keys prevent the menu accelerators from working.\n\
3818 P: Find Again and Replace Again don't continue in the same direction \
3819 as the original Find or Replace.\n\
3820 S: Find Again and Replace Again don't use the direction of the original \
3821 search. The Shift key controls the direction: Ctrl+G means \
3822 forward, Shift+Ctrl+G means backward.\n\
3824 P: Preferences specified in the Preferences menu don't seem to get saved \
3825 when I select Save Defaults.\n\
3826 S: NEdit has two kinds of preferences: 1) per-window preferences, in the \
3827 Preferences menu, and 2) default settings for preferences in newly created \
3828 windows, in the Default \
3829 Settings sub-menu of the Preferences menu. Per-window preferences are not \
3830 saved by Save Defaults, only Default Settings.\n\
3832 P: Columns and indentation don't line up.\n\
3833 S: NEdit is using a proportional width font. Set the font to a fixed style \
3834 (see Preferences).\n\
3836 P: NEdit performs poorly on very large files.\n\
3837 S: Turn off Incremental Backup. With Incremental Backup on, NEdit \
3838 periodically writes a full copy of the file to disk.\n\
3840 P: Commands added to the Shell Commands menu (Unix only) don't output \
3841 anything until they are finished executing.\n\
3842 S: If the command output is \
3843 directed to a dialog, or the input is from a selection, output is collected \
3844 together and held until the command completes. De-select both of the options \
3845 and the output will be shown incrementally as the command executes.\n\
3847 P: Dialogs don't automatically get keyboard focus when they pop up.\n\
3848 S: Most X Window managers allow you to choose between two categories of \
3849 keyboard focus models: pointer focus, and explicit focus. \
3850 Pointer focus means that as you move the mouse around the screen, the window \
3851 under the mouse automatically gets the keyboard focus. NEdit users who use \
3852 this focus model should set \"Popups Under Pointer\" in the Default Settings \
3853 sub menu of the preferences menu in NEdit. Users with the explicit \
3854 focus model, in some cases, may have problems with certain dialogs, such as \
3855 Find and Replace. In MWM this is caused by the mwm resource startupKeyFocus \
3856 being set to False (generally a bad choice for explicit focus users). \
3857 NCDwm users should use the focus model \"click\" \
3858 instead of \"explicit\", again, unless you have set it that way to correct \
3859 specific problems, this is the appropriate setting for most \
3860 explicit focus users.\n\
3862 P: The Backspace key doesn't work, or deletes forward rather than backward.\n\
3863 S: While this is an X/Motif binding problem, and should be solved outside \
3864 of NEdit in the Motif virtual binding layer (or possibly xmodmap or \
3865 translations), nedit provides an out. If you set the resource: \
3866 nedit.remapDeleteKey to True, nedit will forcibly map the delete key \
3867 to backspace. The default setting of this resource recently changed, so \
3868 users who have been depending on this remapping will now have to set \
3869 it explicitly (or fix their bindings).\n\
3871 P: NEdit crashes when I try to paste text in to a text field in a dialog \
3872 (like Find or Replace) on my SunOS system.\n\
3873 S: On many SunOS systems, you have to set up an nls directory before \
3874 various inter-client communication features of Motif will function \
3875 properly. There are instructions in README.sun in \
3876 /pub/v5_0_2/individual/README.sun on \
3877 ftp.nedit.org, as well as a tar file containg a complete nls \
3878 directory: ftp://ftp.nedit.org/pub/v5_0_2/nls.tar. \
3879 README.sun contains directions for setting up an nls directory, which is \
3880 required by Motif for handling copy and paste to Motif text fields. \
3883 KNOWN BUGS\n\
3885 Below is the list of known bugs which affect NEdit. The bugs your copy \
3886 of NEdit will exhibit depend on which system you are running and with which \
3887 Motif libraries it was built. Note that there are now Motif 1.2 and/or 2.0 \
3888 libraries available on ALL supported platforms, and as you can see below \
3889 there are far fewer bugs in Motif 1.2, so it is in your best interest to \
3890 upgrade your system.\n\
3892 All Versions\n\
3894 BUG: Operations between rectangular selections on overlapping lines \
3895 do nothing.\n\
3896 WORKAROUND: None. These operations are \
3897 very complicated and rarely used.\n\
3899 BUG: Cut and Paste menu items fail, or possibly crash, for very large \
3900 (multi-megabyte) selections.\n\
3901 WORKAROUND: Use selection copy (middle mouse button click) for transferring \
3902 larger quantities of data. Cut and Paste save the copied text in server \
3903 memory, which is usually limited.\n\
3906 REPORTING BUGS\n\
3908 The nedit developers subscribe to both discuss@nedit.org and \
3909 develop@nedit.org, either of which may be used for reporting bugs. If \
3910 you're not sure, or you think the report might be of interest to the \
3911 general nedit user community, send the report to discuss@nedit.org. If \
3912 it's something obvious and boring, like we misspelled \"anemometer\" in \
3913 the on-line help, send it to develop. If you don't want to subscribe to \
3914 these lists, please add a note to your mail about cc'ing you on \
3915 responses.",
3917 "There are two separate mailing lists for nedit users, and one for developers. \
3918 Users may post to the developer mailing list to report bugs and communicate \
3919 with the nedit developers. Remember that nedit is entirely a volunteer effort, \
3920 so please ask questions first to the discussion list, and do your share to \
3921 answer other users questions as well.\n\
3923 discuss@nedit.org -- General discussion, questions and\n\
3924 answers among nedit users and\n\
3925 developers.\n\
3927 announce@nedit.org -- A lov-volume mailing list for\n\
3928 annoumcing new versions.\n\
3930 develop@nedit.org -- Communication among and with nedit\n\
3931 developers. Developers should also\n\
3932 subscribe to the discuss list.\n\
3934 To subscribe, send mail to <majordomo@nedit.org> with one or more of the \
3935 following in the body of the message:\n\
3937 subscribe announce\n\
3938 subscribe discuss\n\
3939 subscribe develop",
3941 "GNU GENERAL PUBLIC LICENSE\n\
3943 Version 2, June 1991\n\
3945 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, \
3946 Cambridge, MA 02139, USA. Everyone is permitted to copy and distribute \
3947 verbatim copies of this license document, but changing it is not \
3948 allowed.\n\
3950 Preamble\n\
3952 The licenses for most software are designed to take away your freedom \
3953 to share and change it. By contrast, the GNU General Public License is \
3954 intended to guarantee your freedom to share and change free \
3955 software--to make sure the software is free for all its users. This \
3956 General Public License applies to most of the Free Software \
3957 Foundation's software and to any other program whose authors commit to \
3958 using it. (Some other Free Software Foundation software is covered by \
3959 the GNU Library General Public License instead.) You can apply it to \
3960 your programs, too.\n\
3962 When we speak of free software, we are referring to freedom, not \
3963 price. Our General Public Licenses are designed to make sure that you \
3964 have the freedom to distribute copies of free software (and charge for \
3965 this service if you wish), that you receive source code or can get it \
3966 if you want it, that you can change the software or use pieces of it \
3967 in new free programs; and that you know you can do these things.\n\
3969 To protect your rights, we need to make restrictions that forbid \
3970 anyone to deny you these rights or to ask you to surrender the rights. \
3971 These restrictions translate to certain responsibilities for you if \
3972 you distribute copies of the software, or if you modify it.\n\
3974 For example, if you distribute copies of such a program, whether \
3975 gratis or for a fee, you must give the recipients all the rights that \
3976 you have. You must make sure that they, too, receive or can get the \
3977 source code. And you must show them these terms so they know their \
3978 rights.\n\
3980 We protect your rights with two steps: (1) copyright the software, and \
3981 (2) offer you this license which gives you legal permission to copy, \
3982 distribute and/or modify the software.\n\
3984 Also, for each author's protection and ours, we want to make certain \
3985 that everyone understands that there is no warranty for this free \
3986 software. If the software is modified by someone else and passed on, \
3987 we want its recipients to know that what they have is not the \
3988 original, so that any problems introduced by others will not reflect \
3989 on the original authors' reputations.\n\
3991 Finally, any free program is threatened constantly by software \
3992 patents. We wish to avoid the danger that redistributors of a free \
3993 program will individually obtain patent licenses, in effect making the \
3994 program proprietary. To prevent this, we have made it clear that any \
3995 patent must be licensed for everyone's free use or not licensed at \
3996 all.\n\
3998 The precise terms and conditions for copying, distribution and \
3999 modification follow.\n\
4001 GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, \
4002 DISTRIBUTION AND MODIFICATION\n\
4004 0. This License applies to any program or other work which contains a \
4005 notice placed by the copyright holder saying it may be distributed \
4006 under the terms of this General Public License. The \"Program\", below, \
4007 refers to any such program or work, and a \"work based on the Program\" \
4008 means either the Program or any derivative work under copyright law: \
4009 that is to say, a work containing the Program or a portion of it, \
4010 either verbatim or with modifications and/or translated into another \
4011 language. (Hereinafter, translation is included without limitation in \
4012 the term \"modification\".) Each licensee is addressed as \"you\".\n\
4014 Activities other than copying, distribution and modification are not \
4015 covered by this License; they are outside its scope. The act of \
4016 running the Program is not restricted, and the output from the Program \
4017 is covered only if its contents constitute a work based on the Program \
4018 (independent of having been made by running the Program). Whether that \
4019 is true depends on what the Program does.\n\
4021 1. You may copy and distribute verbatim copies of the Program's source \
4022 code as you receive it, in any medium, provided that you conspicuously \
4023 and appropriately publish on each copy an appropriate copyright notice \
4024 and disclaimer of warranty; keep intact all the notices that refer to \
4025 this License and to the absence of any warranty; and give any other \
4026 recipients of the Program a copy of this License along with the \
4027 Program.\n\
4029 You may charge a fee for the physical act of transferring a copy, and \
4030 you may at your option offer warranty protection in exchange for a \
4031 fee.\n\
4033 2. You may modify your copy or copies of the Program or any portion of \
4034 it, thus forming a work based on the Program, and copy and distribute \
4035 such modifications or work under the terms of Section 1 above, \
4036 provided that you also meet all of these conditions:\n\
4038 a) You must cause the modified files to carry prominent notices \
4039 stating that you changed the files and the date of any change.\n\
4041 b) You must cause any work that you distribute or publish, that in \
4042 whole or in part contains or is derived from the Program or any part \
4043 thereof, to be licensed as a whole at no charge to all third parties \
4044 under the terms of this License.\n\
4046 c) If the modified program normally reads commands interactively when \
4047 run, you must cause it, when started running for such interactive use \
4048 in the most ordinary way, to print or display an announcement \
4049 including an appropriate copyright notice and a notice that there is \
4050 no warranty (or else, saying that you provide a warranty) and that \
4051 users may redistribute the program under these conditions, and telling \
4052 the user how to view a copy of this License. (Exception: if the \
4053 Program itself is interactive but does not normally print such an \
4054 announcement, your work based on the Program is not required to print \
4055 an announcement.)\n\
4057 These requirements apply to the modified work as a whole. If \
4058 identifiable sections of that work are not derived from the Program, \
4059 and can be reasonably considered independent and separate works in \
4060 themselves, then this License, and its terms, do not apply to those \
4061 sections when you distribute them as separate works. But when you \
4062 distribute the same sections as part of a whole which is a work based \
4063 on the Program, the distribution of the whole must be on the terms of \
4064 this License, whose permissions for other licensees extend to the \
4065 entire whole, and thus to each and every part regardless of who wrote \
4066 it.\n\
4068 Thus, it is not the intent of this section to claim rights or contest \
4069 your rights to work written entirely by you; rather, the intent is to \
4070 exercise the right to control the distribution of derivative or \
4071 collective works based on the Program.\n\
4073 In addition, mere aggregation of another work not based on the Program \
4074 with the Program (or with a work based on the Program) on a volume of \
4075 a storage or distribution medium does not bring the other work under \
4076 the scope of this License.\n\
4078 3. You may copy and distribute the Program (or a work based on it, \
4079 under Section 2) in object code or executable form under the terms of \
4080 Sections 1 and 2 above provided that you also do one of the following:\n\
4082 a) Accompany it with the complete corresponding machine-readable \
4083 source code, which must be distributed under the terms of Sections 1 \
4084 and 2 above on a medium customarily used for software interchange; or,\n\
4086 b) Accompany it with a written offer, valid for at least three years, \
4087 to give any third party, for a charge no more than your cost of \
4088 physically performing source distribution, a complete machine-readable \
4089 copy of the corresponding source code, to be distributed under the \
4090 terms of Sections 1 and 2 above on a medium customarily used for \
4091 software interchange; or,\n\
4093 c) Accompany it with the information you received as to the offer to \
4094 distribute corresponding source code. (This alternative is allowed \
4095 only for noncommercial distribution and only if you received the \
4096 program in object code or executable form with such an offer, in \
4097 accord with Subsection b above.)\n\
4099 The source code for a work means the preferred form of the work for \
4100 making modifications to it. For an executable work, complete source \
4101 code means all the source code for all modules it contains, plus any \
4102 associated interface definition files, plus the scripts used to \
4103 control compilation and installation of the executable. However, as a \
4104 special exception, the source code distributed need not include \
4105 anything that is normally distributed (in either source or binary \
4106 form) with the major components (compiler, kernel, and so on) of the \
4107 operating system on which the executable runs, unless that component \
4108 itself accompanies the executable.\n\
4110 If distribution of executable or object code is made by offering \
4111 access to copy from a designated place, then offering equivalent \
4112 access to copy the source code from the same place counts as \
4113 distribution of the source code, even though third parties are not \
4114 compelled to copy the source along with the object code.\n\
4116 4. You may not copy, modify, sublicense, or distribute the Program \
4117 except as expressly provided under this License. Any attempt otherwise \
4118 to copy, modify, sublicense or distribute the Program is void, and \
4119 will automatically terminate your rights under this License. However, \
4120 parties who have received copies, or rights, from you under this \
4121 License will not have their licenses terminated so long as such \
4122 parties remain in full compliance.\n\
4124 5. You are not required to accept this License, since you have not \
4125 signed it. However, nothing else grants you permission to modify or \
4126 distribute the Program or its derivative works. These actions are \
4127 prohibited by law if you do not accept this License. Therefore, by \
4128 modifying or distributing the Program (or any work based on the \
4129 Program), you indicate your acceptance of this License to do so, and \
4130 all its terms and conditions for copying, distributing or modifying \
4131 the Program or works based on it.\n\
4133 6. Each time you redistribute the Program (or any work based on the \
4134 Program), the recipient automatically receives a license from the \
4135 original licensor to copy, distribute or modify the Program subject to \
4136 these terms and conditions. You may not impose any further \
4137 restrictions on the recipients' exercise of the rights granted herein. \
4138 You are not responsible for enforcing compliance by third parties to \
4139 this License.\n\
4141 7. If, as a consequence of a court judgment or allegation of patent \
4142 infringement or for any other reason (not limited to patent issues), \
4143 conditions are imposed on you (whether by court order, agreement or \
4144 otherwise) that contradict the conditions of this License, they do not \
4145 excuse you from the conditions of this License. If you cannot \
4146 distribute so as to satisfy simultaneously your obligations under this \
4147 License and any other pertinent obligations, then as a consequence you \
4148 may not distribute the Program at all. For example, if a patent \
4149 license would not permit royalty-free redistribution of the Program by \
4150 all those who receive copies directly or indirectly through you, then \
4151 the only way you could satisfy both it and this License would be to \
4152 refrain entirely from distribution of the Program.\n\
4154 If any portion of this section is held invalid or unenforceable under \
4155 any particular circumstance, the balance of the section is intended to \
4156 apply and the section as a whole is intended to apply in other \
4157 circumstances.\n\
4159 It is not the purpose of this section to induce you to infringe any \
4160 patents or other property right claims or to contest validity of any \
4161 such claims; this section has the sole purpose of protecting the \
4162 integrity of the free software distribution system, which is \
4163 implemented by public license practices. Many people have made \
4164 generous contributions to the wide range of software distributed \
4165 through that system in reliance on consistent application of that \
4166 system; it is up to the author/donor to decide if he or she is willing \
4167 to distribute software through any other system and a licensee cannot \
4168 impose that choice.\n\
4170 This section is intended to make thoroughly clear what is believed to \
4171 be a consequence of the rest of this License.\n\
4173 8. If the distribution and/or use of the Program is restricted in \
4174 certain countries either by patents or by copyrighted interfaces, the \
4175 original copyright holder who places the Program under this License \
4176 may add an explicit geographical distribution limitation excluding \
4177 those countries, so that distribution is permitted only in or among \
4178 countries not thus excluded. In such case, this License incorporates \
4179 the limitation as if written in the body of this License.\n\
4181 9. The Free Software Foundation may publish revised and/or new \
4182 versions of the General Public License from time to time. Such new \
4183 versions will be similar in spirit to the present version, but may \
4184 differ in detail to address new problems or concerns.\n\
4186 Each version is given a distinguishing version number. If the Program \
4187 specifies a version number of this License which applies to it and \
4188 \"any later version\", you have the option of following the terms and \
4189 conditions either of that version or of any later version published by \
4190 the Free Software Foundation. If the Program does not specify a \
4191 version number of this License, you may choose any version ever \
4192 published by the Free Software Foundation.\n\
4194 10. If you wish to incorporate parts of the Program into other free \
4195 programs whose distribution conditions are different, write to the \
4196 author to ask for permission. For software which is copyrighted by the \
4197 Free Software Foundation, write to the Free Software Foundation; we \
4198 sometimes make exceptions for this. Our decision will be guided by the \
4199 two goals of preserving the free status of all derivatives of our free \
4200 software and of promoting the sharing and reuse of software generally.\n\
4202 NO WARRANTY\n\
4204 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO \
4205 WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. \
4206 EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR \
4207 OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY \
4208 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE \
4209 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR \
4210 PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE \
4211 PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME \
4212 THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\
4214 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN \
4215 WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY \
4216 AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU \
4217 FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR \
4218 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE \
4219 PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING \
4220 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A \
4221 FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF \
4222 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH \
4223 DAMAGES.\n\
4225 END OF TERMS AND CONDITIONS",
4227 "The Tabs dialog controls both the operation of the Tab \
4228 key, and the interpretation of tab characters \
4229 within a file.\n\
4231 The first field, Tab Spacing, controls how NEdit \
4232 responds to tab characters in a file. On most Unix and \
4233 VMS systems the conventional interpretation of a tab \
4234 character is to advance the text position to the nearest \
4235 multiple of eight characters (a tab spacing of 8). \
4236 However, many programmers of C and other structured \
4237 languages, when given the choice, prefer a tab spacing \
4238 of 3 or 4 characters. Setting a three or four character \
4239 hardware tab spacing is useful and convenient as long as \
4240 your other software tools support it. Unfortunately, on \
4241 Unix and VMS systems, system utilities, such as more, \
4242 and printing software can't always properly display \
4243 files with other than eight character tabs.\n\
4245 Selecting \"Emulate Tabs\" will cause the Tab key to \
4246 insert the correct number of spaces or tabs to reach the \
4247 next tab stop, as if the tab spacing were set at the \
4248 value in the \"Emulated tab spacing\" field. \
4249 Backspacing immediately after entering an emulated tab \
4250 will delete it as a unit, but as soon as you move the \
4251 cursor away from the spot, NEdit will forget that the \
4252 collection of spaces and tabs is a tab, and will treat \
4253 it as separate characters. To enter a real tab \
4254 character with \"Emulate Tabs\" turned on, use Ctrl+Tab.\n\
4256 In generating emulated tabs, and in Shift Left, Paste \
4257 Column, and some rectangular selection operations, NEdit \
4258 inserts blank characters (spaces or tabs) to preserve \
4259 the alignment of non-blank characters. The bottom \
4260 toggle button in the Tabs dialog instructs NEdit whether \
4261 to insert tab characters as padding in such situations. \
4262 Turning this off, will keep NEdit from automatically \
4263 inserting tabs. Some software developers prefer to keep \
4264 their source code free of tabs to avoid its \
4265 misinterpretation on systems with different tab \
4266 character conventions."
4269 static Widget HelpWindows[NUM_TOPICS] = {NULL};
4270 static Widget HelpTextPanes[NUM_TOPICS] = {NULL};
4272 /* Information on the last search for search-again */
4273 static char LastSearchString[DF_MAX_PROMPT_LENGTH] = "";
4274 static int LastSearchTopic = -1;
4275 static int LastSearchPos = 0;
4276 static int LastSearchWasAllTopics = False;
4278 static Widget createHelpPanel(Widget parent, int topic);
4279 static void dismissCB(Widget w, XtPointer clientData, XtPointer callData);
4280 static void searchHelpCB(Widget w, XtPointer clientData, XtPointer callData);
4281 static void searchHelpAgainCB(Widget w, XtPointer clientData,
4282 XtPointer callData);
4283 static void printCB(Widget w, XtPointer clientData, XtPointer callData);
4284 static void searchHelpText(Widget parent, int parentTopic, char *searchFor,
4285 int allSections, int startPos, int startTopic);
4286 static int findTopicFromShellWidget(Widget shellWidget);
4288 void Help(Widget parent, enum HelpTopic topic)
4290 if (HelpWindows[topic] != NULL)
4291 RaiseShellWindow(HelpWindows[topic]);
4292 else
4293 HelpWindows[topic] = createHelpPanel(parent, topic);
4296 static Widget createHelpPanel(Widget parent, int topic)
4298 Arg al[50];
4299 int ac;
4300 Widget appShell, form, btn, dismissBtn;
4301 Widget sw, hScrollBar, vScrollBar;
4302 XmString st1;
4304 ac = 0;
4305 XtSetArg(al[ac], XmNtitle, HelpTitles[topic]); ac++;
4306 XtSetArg(al[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
4307 XtSetArg(al[ac], XmNiconName, HelpTitles[topic]); ac++;
4308 appShell = CreateShellWithBestVis(APP_NAME, APP_CLASS,
4309 applicationShellWidgetClass, TheDisplay, al, ac);
4310 AddSmallIcon(appShell);
4311 form = XtVaCreateManagedWidget("helpForm", xmFormWidgetClass, appShell, 0);
4312 XtVaSetValues(form, XmNshadowThickness, 0, 0);
4314 btn = XtVaCreateManagedWidget("find", xmPushButtonWidgetClass, form,
4315 XmNlabelString, st1=XmStringCreateSimple("Find..."),
4316 XmNmnemonic, 'F',
4317 XmNhighlightThickness, 0,
4318 XmNbottomAttachment, XmATTACH_FORM,
4319 XmNleftAttachment, XmATTACH_POSITION,
4320 XmNleftPosition, 3,
4321 XmNrightAttachment, XmATTACH_POSITION,
4322 XmNrightPosition, 25, 0);
4323 XtAddCallback(btn, XmNactivateCallback, searchHelpCB, appShell);
4324 XmStringFree(st1);
4326 btn = XtVaCreateManagedWidget("findAgain", xmPushButtonWidgetClass, form,
4327 XmNlabelString, st1=XmStringCreateSimple("Find Again"),
4328 XmNmnemonic, 'A',
4329 XmNhighlightThickness, 0,
4330 XmNbottomAttachment, XmATTACH_FORM,
4331 XmNleftAttachment, XmATTACH_POSITION,
4332 XmNleftPosition, 27,
4333 XmNrightAttachment, XmATTACH_POSITION,
4334 XmNrightPosition, 49, 0);
4335 XtAddCallback(btn, XmNactivateCallback, searchHelpAgainCB, appShell);
4336 XmStringFree(st1);
4338 btn = XtVaCreateManagedWidget("print", xmPushButtonWidgetClass, form,
4339 XmNlabelString, st1=XmStringCreateSimple("Print..."),
4340 XmNmnemonic, 'P',
4341 XmNhighlightThickness, 0,
4342 XmNbottomAttachment, XmATTACH_FORM,
4343 XmNleftAttachment, XmATTACH_POSITION,
4344 XmNleftPosition, 51,
4345 XmNrightAttachment, XmATTACH_POSITION,
4346 XmNrightPosition, 73, 0);
4347 XtAddCallback(btn, XmNactivateCallback, printCB, appShell);
4348 XmStringFree(st1);
4350 dismissBtn = XtVaCreateManagedWidget("dismiss", xmPushButtonWidgetClass,
4351 form, XmNlabelString, st1=XmStringCreateSimple("Dismiss"),
4352 XmNhighlightThickness, 0,
4353 XmNbottomAttachment, XmATTACH_FORM,
4354 XmNleftAttachment, XmATTACH_POSITION,
4355 XmNleftPosition, 75,
4356 XmNrightAttachment, XmATTACH_POSITION,
4357 XmNrightPosition, 97, 0);
4358 XtAddCallback(dismissBtn, XmNactivateCallback, dismissCB, appShell);
4359 XmStringFree(st1);
4361 /* Create a text widget inside of a scrolled window widget */
4362 sw = XtVaCreateManagedWidget("sw", xmScrolledWindowWidgetClass,
4363 form, XmNspacing, 0, XmNhighlightThickness, 0,
4364 XmNshadowThickness, 2,
4365 XmNtopAttachment, XmATTACH_FORM,
4366 XmNleftAttachment, XmATTACH_FORM,
4367 XmNrightAttachment, XmATTACH_FORM,
4368 XmNbottomAttachment, XmATTACH_WIDGET,
4369 XmNbottomWidget, dismissBtn, 0);
4370 hScrollBar = XtVaCreateManagedWidget("hScrollBar",
4371 xmScrollBarWidgetClass, sw, XmNorientation, XmHORIZONTAL,
4372 XmNrepeatDelay, 10, 0);
4373 vScrollBar = XtVaCreateManagedWidget("vScrollBar",
4374 xmScrollBarWidgetClass, sw, XmNorientation, XmVERTICAL,
4375 XmNrepeatDelay, 10, 0);
4376 HelpTextPanes[topic] = XtVaCreateManagedWidget("helpText",
4377 textWidgetClass, sw, textNrows, 30, textNcolumns, 60,
4378 textNhScrollBar, hScrollBar, textNvScrollBar, vScrollBar,
4379 textNreadOnly, True, textNcontinuousWrap, True,
4380 textNautoShowInsertPos, True, 0);
4381 XtVaSetValues(sw, XmNworkWindow, HelpTextPanes[topic],
4382 XmNhorizontalScrollBar, hScrollBar,
4383 XmNverticalScrollBar, vScrollBar, 0);
4384 BufSetAll(TextGetBuffer(HelpTextPanes[topic]), HelpText[topic]);
4386 /* This shouldn't be necessary (what's wrong in text.c?) */
4387 HandleXSelections(HelpTextPanes[topic]);
4389 /* Process dialog mnemonic keys */
4390 AddDialogMnemonicHandler(form);
4392 /* Set the default button */
4393 XtVaSetValues(form, XmNdefaultButton, dismissBtn, 0);
4394 XtVaSetValues(form, XmNcancelButton, dismissBtn, 0);
4396 /* realize all of the widgets in the new window */
4397 RealizeWithoutForcingPosition(appShell);
4399 /* Make close command in window menu gracefully prompt for close */
4400 AddMotifCloseCallback(appShell, (XtCallbackProc)dismissCB, appShell);
4402 return appShell;
4405 static void dismissCB(Widget w, XtPointer clientData, XtPointer callData)
4407 int topic;
4409 if ((topic = findTopicFromShellWidget((Widget)clientData)) == -1)
4410 return;
4412 /* I don't understand the mechanism by which this can be called with
4413 HelpWindows[topic] as NULL, but it has happened */
4414 XtDestroyWidget(HelpWindows[topic]);
4415 HelpWindows[topic] = NULL;
4418 static void searchHelpCB(Widget w, XtPointer clientData, XtPointer callData)
4420 char promptText[DF_MAX_PROMPT_LENGTH];
4421 int response, topic;
4422 static char **searchHistory = NULL;
4423 static int nHistoryStrings = 0;
4425 if ((topic = findTopicFromShellWidget((Widget)clientData)) == -1)
4426 return; /* shouldn't happen */
4427 SetDialogFPromptHistory(searchHistory, nHistoryStrings);
4428 response = DialogF(DF_PROMPT, HelpWindows[topic], 3,
4429 "Search for: (use up arrow key to recall previous)",
4430 promptText, "This Section", "All Sections", "Cancel");
4431 if (response == 3)
4432 return;
4433 AddToHistoryList(promptText, &searchHistory, &nHistoryStrings);
4434 searchHelpText(HelpWindows[topic], topic, promptText, response == 2, 0, 0);
4437 static void searchHelpAgainCB(Widget w, XtPointer clientData,
4438 XtPointer callData)
4440 int topic;
4442 if ((topic = findTopicFromShellWidget((Widget)clientData)) == -1)
4443 return; /* shouldn't happen */
4444 searchHelpText(HelpWindows[topic], topic, LastSearchString,
4445 LastSearchWasAllTopics, LastSearchPos, LastSearchTopic);
4448 static void printCB(Widget w, XtPointer clientData, XtPointer callData)
4450 int topic, helpStringLen;
4451 char *helpString;
4453 if ((topic = findTopicFromShellWidget((Widget)clientData)) == -1)
4454 return; /* shouldn't happen */
4455 helpString = TextGetWrapped(HelpTextPanes[topic], 0,
4456 TextGetBuffer(HelpTextPanes[topic])->length, &helpStringLen);
4457 PrintString(helpString, helpStringLen, HelpWindows[topic],
4458 HelpTitles[topic]);
4461 static void searchHelpText(Widget parent, int parentTopic, char *searchFor,
4462 int allSections, int startPos, int startTopic)
4464 int topic, beginMatch, endMatch;
4465 int found = False;
4467 /* Search for the string */
4468 for (topic=startTopic; topic<NUM_TOPICS; topic++) {
4469 if (!allSections && topic != parentTopic)
4470 continue;
4471 if (SearchString(HelpText[topic], searchFor, SEARCH_FORWARD,
4472 SEARCH_LITERAL, False, topic == startTopic ? startPos : 0,
4473 &beginMatch, &endMatch, NULL, GetPrefDelimiters())) {
4474 found = True;
4475 break;
4478 if (!found) {
4479 if (startPos != 0 || allSections && startTopic != 0) { /* Wrap search */
4480 searchHelpText(parent, parentTopic, searchFor, allSections, 0, 0);
4481 return;
4483 DialogF(DF_INF, parent, 1, "String Not Found", "Dismiss");
4484 return;
4487 /* If the appropriate window is already up, bring it to the top, if not,
4488 make the parent window become this topic */
4489 if (HelpWindows[topic] == NULL) {
4490 XtVaSetValues(HelpWindows[parentTopic], XmNtitle, HelpTitles[topic], 0);
4491 BufSetAll(TextGetBuffer(HelpTextPanes[parentTopic]), HelpText[topic]);
4492 HelpWindows[topic] = HelpWindows[parentTopic];
4493 HelpTextPanes[topic] = HelpTextPanes[parentTopic];
4494 HelpWindows[parentTopic] = NULL;
4495 HelpTextPanes[parentTopic] = NULL;
4496 } else if (topic != parentTopic)
4497 RaiseShellWindow(HelpWindows[topic]);
4498 BufSelect(TextGetBuffer(HelpTextPanes[topic]), beginMatch, endMatch);
4499 TextSetCursorPos(HelpTextPanes[topic], endMatch);
4501 /* Save the search information for search-again */
4502 strcpy(LastSearchString, searchFor);
4503 LastSearchTopic = topic;
4504 LastSearchPos = endMatch;
4505 LastSearchWasAllTopics = allSections;
4508 static int findTopicFromShellWidget(Widget shellWidget)
4510 int i;
4512 for (i=0; i<NUM_TOPICS; i++)
4513 if (shellWidget == HelpWindows[i])
4514 return i;
4515 return -1;