内に含ま
その他のドキュメント
サポート リソース
| PDF 文書ファイルをダウンロードする
Using Edit in Developer Mode
4
- In addition to the standard UNIX editing tools (vi and Emacs), the OpenStep development environment provides a mouse-based text editor named Edit for creating and editing ASCII or RTF (Rich Text Format(R)) text files.
- Edit has all the standard features of a text editor: You can type paragraphs of text without pressing the Return key (the text wraps automatically at the end of each line, and if you change fonts or resize the window, the text rewraps accordingly). You can use the mouse to select where text will be entered and to select text you want to edit. And you can find and replace text, move and copy it, and so on.
- While Edit has the functionality of a good text editor, it is particularly suited for writing programming code and performing other application-development tasks. It lacks many of the capabilities found in similar applications, but in Developer Mode it has many features specifically designed for programmers. For example, Edit supports name expansion, folder browsing, block nesting in program listings, and a structured editing facility. It also provides interapplication functionality with Project Builder and Terminal.
Starting Edit
- You can start Edit from the workspace as you would start any other application. Alternatively, you can start Edit from a shell window by typing the following command at the UNIX prompt:
-
-
/usr/openstep/Apps/Edit.app/Edit [file name ...] &
- Several command-line options allow you to override various default characteristics of Edit for the work session you are about to start--characteristics such as the number of lines and columns in new windows, the font family used, and the font size. For example:
-
-
/usr/openstep/Apps/Edit.app/Edit -NSFont Times-Roman Fruit.m &
- These command-line options can be specified in any order, as long as they precede any file names. Several options are listed in Table 4-1.
-
Table 4-1
| Option | Effect |
| IndentWidth | Specifies the width of indentation for block nesting. The default value is 4. |
| NSFont | Specifies the font family. The default font is Helvetica. |
| NSFontSize | Specifies the font size, in points. The default value is 12. |
| Tags | Specifies one or more path names to tags files that will be searched by the Source command. The path names should be separated by a colon, as in a standard UNIX path list. The default is "tags," which indicates that the tags file in the current folder will be searched. See the description of using tags files under "Interacting with UNIX" on page 4-21 for more information about using tags files in Edit. |
| DeleteBackup | Specifies whether the previous version of a file is deleted or retained as a backup when you save changes to the file. The default value is YES, which means that the previous version is deleted. If the previous version is saved as a backup, its name is the same as the original file name, but with a tilde (~) appended to the name. |
| NSMenuX | Specifies the (positive) distance in pixels from the left edge of
the screen to the left edge of the main menu. |
| NSMenuY | Specifies the (positive) distance in pixels from the bottom of the screen to the top of the main menu. |
- Edit will use the default value for each option unless you override it with a command-line option. The value specified in the command line will remain in effect only for the work session you are about to start. The next time you use Edit, the defaults go back into effect.
- You can set new default values for each of the above characteristics (except for screen coordinates) using the Preferences panel, which is described in the "Setting Preferences." Most defaults set with the Preferences panel remain in effect until you change them.
Setting Preferences
- The Preferences command in the Info menu displays the Preferences panel, shown in Figure 4-1. The Preferences panel lets you set default values for various Edit options. For example, you can set default font properties or specify the size of new windows. To use the features of Edit's Developer Mode, click on the Developer Mode radio button as shown in Figure 4-1.

Figure 4-1
- Enter values and click on buttons to specify new preferences, as described below. Then click on Set to set the new preferences (or click on Revert to restore the previous settings). In general, the new settings remain in effect until you change them. However, you can temporarily override some of the defaults by starting up Edit from a shell window and specifying one or more command-line options (as described in "Starting Edit" on page 4-1).
- You can press the button labeled User Options and, in the pop-up list that appears (see Figure 4-2), choose from several other sets of options that are available (see "Global Options" on page 4-6, "Temporary Settings" on page 4-7, "Text Options" on page 4-8, and "C Options" on page 4-11).

Figure 4-2
User Options
- Choose User Options in the Preferences panel's pop-up list to see the user options that you can specify. User options are saved in your defaults database and continue to be used until you specify different values for them.
Start-up Options
-
Figure 4-3 shows Edit's start-up options. By default Edit starts in User mode, which presents just a subset of the commands available in Developer mode. If you are using Edit for application development be sure to click on the Developer Mode button.

Figure 4-3
New Document Format Options
-
Figure 4-4 shows the new document format options. Click on one of the radio buttons to specify whether new documents are created in RTF (Rich Text Format) or ASCII format.
- After you have created or opened a document, you can change its format by choosing the Make Rich Text command or the Make ASCII command in the Text menu.

Figure 4-4
Default Font for RTF Files
-
Figure 4-5 shows the field that allows you to set a default font for Edit windows that are in RTF format. Click on the Set button to bring up the Font panel. Specify the font family, typeface, and size, and click on the Set button in the Font panel when you are finished. After you save these settings, all subsequently created RTF documents display text in the specified font by default.

Figure 4-5
Default Font for ASCII Files
-
Figure 4-6 on page 4-6 shows the field that allows you to set a default font for Edit windows that are in ASCII format. Click on the Set button to bring up the Font panel. Specify the font family, typeface, and size, and click on the Set
- button in the Font panel when you are finished. After you save these settings, all subsequently opened Edit windows that contain ASCII files display text in the specified font.
- When working with code or UNIX command output, it is best to use a fixed-width font family, such as Courier.

Figure 4-6
Global Options
- Choose Global Options in the Preferences panel's pop-up list to see the global options that can be specified. Global options are saved in your defaults database and continue to be used until you specify different values for them.
Save Options
-
Figure 4-7 shows the save options that determine what happens when you save a file. When you select the Delete backup file option, Edit automatically deletes the previous version of a file when the current version is saved. Click on Don't delete backup file to retain the previous version of a file when you save the current version (if the previous version of a file is saved). This backup file is saved under the original file name, but with a tilde (~) appended to the name.
- If you try to save a file that is write-protected, you can do so by responding affirmatively to the confirmation panel that appears as long as you own the file. Check the Save Files Writeable button if you want such write-protected files to lose their write-protected status when they are saved.

Figure 4-7
Default Window Size Options
-
Figure 4-8 shows the options that let you ser a default size for Edit file windows. Enter a width in number of characters in the Width field and a height in number of lines in the Height field. Edit files that you open after saving these settings are displayed in windows with the dimensions you specify. Since these dimensions are specified in characters and lines, the default window sizes are affected by the default font.

Figure 4-8
Emacs Key Bindings
-
Figure 4-9 shows the options for Emacs key bindings. Click on one of the radio buttons to specify whether or not Emacs key bindings are enabled.

Figure 4-9
Temporary Settings
- Choose Temporary Settings in the Preferences panel's pop-up list to see the temporary settings that can be specified. These are called temporary settings because they are not saved in your defaults database.
Line Wrap Options
-
Figure 4-10 shows the options that determine how text wraps. When you select the Word boundaries option, text wraps onto the following line at the end of each full line, but no words are split across lines. Clicking on Character boundaries also causes text to be wrapped at the end of each line, but words can be split across lines. Clicking on Don't wrap causes text to not wrap at all.

Figure 4-10
Rich Text Display Options
-
Figure 4-11 shows the options for how RTF files are displayed. When you select the Edit Rich Text Format option, RTF files that you open are displayed as formatted text. Click on Ignore Rich Text Format to view RTF files as unformatted text with the format commands visible. Because other applications use Edit to view formatted text, you should normally leave the Edit Rich Text Format option selected.

Figure 4-11
Text Options
- Choose Text Options in the Preferences panel's pop-up list to see the text options that you can specify. Text options are saved in your defaults database and continue to be used until you specify different values for them.
Automatic Indenting Options
-
Figure 4-12 shows the options that determine whether or not lines are automatically indented. When you select the Automatically indent lines option, Edit indents each new line the same as the line above it (automatic indentation is useful for typing indented lines of code). Click on Don't auto-indent lines if you want each new line to start at the left margin.

Figure 4-12
Structure Level of Blank Lines
-
Figure 4-13 shows the options that determine how blank lines are treated in your text structure. When you select the Same as previous line option, Edit assigns each "blank" line (that is, each line that contains no visible text) the same structure level as the previous line. Click on Determined by indentation if you want the structure level of blank lines to be determined by the amount of indentation (that is, tabs and spaces) on that line, rather than by the indentation of the previous line.

Figure 4-13
Alignment Options
-
Figure 4-14 on page 4-10 shows the alignment options for text. In the Indent field, enter the number of characters you want to shift right or left with the Text menu's Nest and Unnest commands. In the Tabs field, enter the number of characters you want between tab stops.

Figure 4-14
Open at Structure Level Options
- The options shown in Figure 4-15 determine how many levels of structure will be visible in a newly opened files. In the ASCII and RTF fields, enter a number between 0 and 99 to specify how many levels will be visible in a file of that type. A 0 indicates that only the top level of text, text that is flush left, will be visible; a 1 indicates that the first sublevel of text should also be visible, and so on.

Figure 4-15
Editing Modes
- In addition to the default Text mode, there are two editing modes for C and Lisp source files, shown in Figure 4-16. These modes optimize some minor aspects of Edit's behavior for use with each of these programming languages. You can specify in the Modes field any additional file extensions that you want associated with either of these two modes.

Figure 4-16
C Options
- Choose C Options in the Preferences panel's pop-up list to see the C source code options that you can specify. C options are saved in your defaults database and continue to be used until you specify different values for them.
Structure for Top Level
-
Figure 4-17 shows the options that determine how the commands in the Structure submenu operate on top-level text. When you select the Independent of 1st character option, commands in the Structure submenu operate solely on the basis of indentation, independent of particular characters. Click on Determined by 1st character if you want Structure submenu commands to treat C preprocessor directives (lines whose first character is #) specially--that is, as second-level text, rather than top-level tezt.

Figure 4-17
Structure Level of Blank Lines
-
Figure 4-18 determines how blank lines are treated in your C source code structure. When you select the Same as previous line option, Edit assigns each "blank" line (that is, each line that contains no visible text) the same structure level as the previous line. Click on Determined by indentation if you want the structure level of blank lines to be determined by the amount of indentation (that is, tabs and spaces) on that line, rather than by the indentation of the previous line.

Figure 4-18
Tags Path
-
Figure 4-19 shows the field that lets you specify one or more tags files that you want Edit to search when you choose the Source command in the Utilities menu. In the Path field, enter the path names of the files you want searched. A tags file, which you create using the UNIX ctags command, contains the locations of program object definitions among a given group of files. The Source command searches the tags files specified here for the location of an object definition and then opens the file containing the definition.
- If you leave the default entry of tags:../tags in this field, Edit searches only the main window) and in the current folder's parent folder. You can replace or add to the default, however, by entering the path names of one or more other tags files; you separate multiple path names with a colon as in a standard UNIX path list.
- See the description of the Source command in "Commands in the Utilities Menu" on page 4-31 for more information about using Edit's Source command with tags files.

Figure 4-19
Include Path
-
Figure 4-20 on page 4-13 shows the field in which you can specify your default include path (the path the preprocessor uses to search for system header files). You can redefine this path by editing the text and then clicking on the Set button.

Figure 4-20
Performing Basic Operations
- For information about basic operations of Edit that are available in both User mode and Developer mode, see the following sections in Using the OpenStep Desktop:
-
- Selecting Text
- Deleting and Replacing Text
- Finding Text
- Replacing Text that You Find
- Checking Your Spelling
- Setting Margins, Indentation, and Tabs
- Checking Your Spelling
- For more information about basic operations common to Edit and other standard OpenStep applications, see Using the OpenStep Desktop.
Opening Edit Files
- In addition to opening Edit files from the workspace, you can open them from within Edit by using the Open or Open Selection commands in the File menu. (These commands are described in "Commands in the File Menu" on page 4-25.)
- An alternate way to open one or more files is to use Edit's openfile command at the UNIX prompt in a shell window. You can specify one or more file names (or path names), which are interpreted relative to the shell
- window's current folder. For example, the following command would open all the files in the current folder that end with a .c extension, plus all the files in a subfolder called headers that end with a .h extension:
-
-
openfile *.c headers/*.h
- Each file is opened in its own Edit window. You can use the openfile command only when Edit is running.
Using File Windows and Folder Windows
- Edit provides two types of standard windows: file windows and folder windows. As in other applications, there are also panels and menus.
-
Note - Unless otherwise specified, folder windows mentioned in this chapter are Edit folder windows, not Workspace Manager folder windows.
- An Edit file window displays a document file that you can view and edit. When you make changes to text displayed in a file window, the version of the file on the disk is not affected until you save the file with the File menu's Save command. When a file contains unsaved changes, the window's title bar displays a partially drawn close button. If you miniaturize a window containing unsaved changes, its miniwindow is highlighted in gray.
- An Edit folder window displays a list of the files and subdirectories contained in a folder. You do not edit the contents of a folder window; instead, you use the displayed folder listing to find and select other files or directories to open.
- Two special features are available in Edit folder windows:
-
- You can type a character to find and select the first item starting with that character. Each additional character you type deselects the previously selected item and finds the first item starting with the newly typed character. You can also use the commands in the Find submenu to find and select items in a folder window.
- You can double-click a file or folder name to open an Edit window displaying that file or folder. This is equivalent to selecting the name and choosing the Open Selection command in the File menu.
- You can also open an Edit folder window by choosing the Open Folder command in the File menu. The command displays a panel in which you enter the path name of a folder to be opened.
Contracting and Expanding Text in a File Window
- In Developer Mode, Edit provides a Structure capability that lets you quickly move around in C files as well as in any other type of file where levels of structure are represented by varying degrees of indentation--outlines, for example. Commands in the Structure menu can be used to "contract" text in the main window, displaying only the text at a particular level of indentation. Text that is indented beyond that level is hidden. Figure 4-21 shows a document that has been contracted--only the top-level lines (those that are flush left) are visible. Notice the two white text arrows, which indicate the presence of contracted text.

Figure 4-21
- When text is contracted, only the display is changed--the document itself, including font changes and text properties, remains unchanged. However, while some Edit commands affect both the expanded and the contracted portions of the document (for example, Cut and Paste), other commands affect only the portions of the document that are expanded (for example, commands that change the font).
- Commands in the Structure submenu let you expand or contract either the entire contents of the window, or just the current selection. The rest of this section describes some mouse shortcuts that you will probably use even more frequently than the menu commands.
- Clicking on a text arrow expands (that is, displays) the text that the arrow represents. Control-clicking on a text arrow expands just the top level of the text that the arrow represents. For example, Figure 4-22 shows what the drawSource definition looks like after Control-clicking on the first of the two text arrows shown in Figure 4-21. Notice that the drawSource definition has expanded, but the drawDestination definition is still contracted. Also notice that the drawSource definition has not expanded completely--the switch statement contains yet another level of contracted text.

Figure 4-22
-
Figure 4-23 on page 4-17 shows the drawSource definition after Control-clicking on the switch statement's text arrow. Each case statement in the switch contains an additional level of contracted text. The text for CIRCLE, however, is not contracted--it has already been expanded by clicking (or Control-clicking) on its text arrow.

Figure 4-23
- If you want to recursively expand all the sublevels of text represented by a text arrow, click on, instead of Control-clicking on, the arrow.
- Control-clicking anywhere within an indented block of text contracts the text.
Adding Help Links
- The Help menu in Edit provides commands that are used to add or edit Help links. Although Help links are designed for use within an application's on-line Help system, they can also be used more generally. For example, the Contents file for the release notes could contain links to the various release note files. For information about adding a Help system to an application you are developing, see "Commands in the Project Menu" on page 2-33 and "Attaching Help to Objects" on page 3-132.
- To work with Help links and markers, use the following commands in the Help menu (choose the Help command in the Format menu):
-
- Choose Insert Link to insert a Help link at the current insertion point. In the Link Inspector that appears, specify the name of a file and (optionally) a marker in that file.
- Choose Insert Marker to insert a Help marker at the insertion point in the main window. A Marker panel appears in which you specify a name to associate with the marker. When you insert a link to the marker, you will identify it by this name.
- Choose Show Markers to show all the markers in the main window, or Hide Markers to hide them.
- If you want to edit a link or marker you have created, Command-click on it to bring up the Inspector panel. To delete a link or marker, select it and press the Delete key, just as you would with text.
Using Templates
- Three commands on the Expert menu--Expansion Dictionary, Insert Field, and Next Field--let you create and use text string abbreviations. Text string abbreviations are abbreviations for commonly used text strings or templates that you can type and then expand into the full text entry with a single keystroke.
- To define a text string abbreviation, open the Expansion Dictionary panel by choosing Expansion Dictionary in the Expert menu.

Figure 4-24
- In the Key field at the top of the panel, enter an abbreviation for the text string or template. In the Expansion field at the bottom of the panel, enter the expanded text that you want the abbreviation to represent. Then click on the Add button. The new abbreviation appears on the list in the middle of the panel.
- If you want the expansion to occupy more than one line, press Alt-Return to insert Return characters between lines in the Expansion field. When you press Alt-Return, the line of expanded text you just typed disappears from the field, leaving room to type the next line.
- To use a text abbreviation, set the Key Bindings On option in the Emacs Key Bindings field of Global Options in the Preferences panel (see "Global Options" on page 4-6), type the abbreviation in a document, and then press the Escape key; the abbreviation is replaced by its expansion. For example, if you
- frequently need to type setOutputForm, you could use the Expansion Dictionary command to associate the abbreviation sof with the longer declaration. To enter setOutputForm, you would only have to type sof and press Escape. The abbreviation does not even have to be typed in full for the expansion to occur, as long as what you do type refers unambiguously to a glossary entry.
- If you are using the Expansion Dictionary window to create a template containing fields you will be editing after the text is expanded, surround each field with European quotation marks («»), as described below. For example:
-
-
Subject: «subject»
To: «recipient»
cc: «cc»»
«message»
- You can enter European quotation marks in the Expansion field by choosing the Insert Field command, or you can enter them directly from the keyboard by pressing and releasing the Compose key and then typing Shift-<-<, then pressing and releasing the Compose key and typing Shift->->. After inserting the template into a document, you can quickly find each editable field by choosing the Next Field command, which positions the insertion point at the next field in the template.

Figure 4-25
- After entering the abbreviation and the expanded text it stands for in the Key and Expansion fields, click on the Add button to accept the new glossary entry.

Figure 4-26
- To remove a glossary entry, type its abbreviation in the Key field and click on the Remove button.
Using Keyboard Editing Commands
- In addition to letting you edit text using menu commandsand their keyboard equivalents, Edit also supports several Emacs-style editing commands that can be typed from the keyboard. Table 4-2 lists the key combination corresponding to each of these commands and a description of what the command does.
-
Table 4-2
| Command | Action |
| Control-B | Moves back one character |
| Control-F | Moves forward one character |
| Alt-b | Moves back one word |
| Alt-f | Moves forward one word |
| Control-A | Moves to beginning of line |
| Control-E | Moves to end of line |
| Control-D | Deletes next character |
| Control-H | Deletes previous character |
| Alt-d | Deletes to end of current (or next) word |
| Alt-h | Deletes to beginning of current (or previous) word |
| Control-K | Deletes forward to end of line |
| Alt-< | Moves to beginning of text |
| Alt-> | Moves to end of text |
| Control-N | Moves down one line |
| Control-P | Moves up one line |
Interacting with UNIX
- Edit provides some useful commands for using UNIX utilities from within Edit. These include the following:
-
- Two commands for piping output from UNIX commands directly into Edit files
- A Source command that you can use with one or more tags files to locate program objects in a group of files
Piping UNIX Output to a File
- Edit lets you pipe the output of a UNIX command directly into an Edit window. This is a useful technique for inserting output from other applications into your own programs.
- For example, to produce a 1996 calendar in an empty window, choose Command in the Utilities menu, enter the following in the panel that appears, and press Return:
-
-
cal 1996
- The output appears in an untitled window.
- If instead you wanted the calendar to appear in the main window, position the insertion point where you want the calendar to appear (or select what you want it to replace). Then choose Pipe in the Utilities menu. Enter the same command as before and press Return. This time the output appears in the main window at the insertion point or in place of the current selection.
- You can also use the Pipe command to manipulate the current text selection with another UNIX program. If the command accepts input, the selection will be used as input--for example, you could sort the selection with the sort command.
- If there are Command and Pipe commands that you use frequently, you can define them as menu items in the User Commands and User Pipes submenus in the Utilities menu. To do this, enter a definition for each command in a file named .openstep/.commanddict or .openstep/.pipedict in your home folder.
- Each command definition contains at least two fields, separated by tabs:
-
-
command name<tab>command definition
- For example, the following entry defines a Pipe command called Sort Selection, which runs the UNIX sort command using the current selection as input:
-
-
Sort Selection sort -
- One additional field, inserted between the two required fields and separated from them by tabs, can be used to specify a keyboard alternative for the command. For example, this definition of the Sort Selection command assigns to it the keyboard alternative Command-5:
-
-
Sort Selection 5
sort -
- If you make changes to your .commanddict or .pipedict file while Edit is running, you must quit and restart Edit in order for your changes to appear in the User Commands or User Pipes menu.
- You can use two special variables, shown in Table 4-3, as arguments to the UNIX commands you specify:.
-
Table 4-3
| Argument | Meaning |
| $file | Refers to the file that is displayed in the main window (which may be different from the contents of the window). |
| $selection | Refers to the contents of the current selection, which can be either text that is selected in a file window, or a file that is selected in a folder window |
- Here are some examples of how these variables might be used in a .commanddict definition:
-
-
Print Two Up P enscript -2r $file
GrepAppkit A fgrep -n "$selection" /usr/include/appkit/*.h
- The first example prints the contents of the file that is displayed in the main window. The second example searches for occurrences of the selected text in the Application Kit header files.
Using a Tags File
- If you are maintaining a large number of files as part of a programming project, you can use Edit's Source command with a tags file to quickly locate the definition of an object in that group of files. A tags file (which you create with the UNIX ctags command) lists the locations of program objects (such as functions, procedures, global variables, and typedefs) that are in a specified group of files.
- To locate an object definition, simply select it and choose Source (or choose Source and type the object name in the panel that appears). Edit searches one or more tags files for the location of the object definition and then opens the file containing the definition. Normally, Edit searches the tags file in the current folder (the folder containing the file in the main window). However,
- you can specify other tags files to be searched either with the Preferences command or by specifying the Tags option when starting up Edit from a shell window.
- More information on tags files is given in the ctags UNIX manual page. For more information on using the Source command, see the command description in "Commands in the Utilities Menu" on page 4-31.
Edit Command Reference
- The following sections summarize the menus and commands available in Edit.
Commands in the Main Menu
- Edit's main menu contains the standard Info, Print, Windows, Services, Hide, and Quit commands. The other commands and the submenus they open are described in the sections that follow. Several standard commands are discussed here only in terms of their particular use in Edit.
Commands in the File Menu
- Edit's File menu contains the standard Open, New, Revert to Saved, and Close commands. The other commands are described in Table 4-4.
-
Table 4-4
| Command | Description |
Save, Save As, Save
To,Save All | These are the standard commands for saving the contents of
the main window on the disk.
When you save a file, Edit first moves the contents of the old
version to a temporary backup file, which has the same name
as the previous file but with a tilde (~) appended to it (for
example, the backup file corresponding to Fruit.m would be
Fruit.m~).
Next, Edit writes the new version of the file and then it
normally deletes the backup file. If something happens that
prevents Edit from saving the file, however, the backup file
remains so you can recover its contents. Or, if you always want
the backup file to remain, even after the new version is
successfully saved, you can set the Don't delete backup file
option in the Preferences panel.
While the file is being saved, saving: appears before the file
name in the title bar of the window (in the case of small files, it
appears only for an instant). Until saving: has disappeared,
do not use the file (for example, do not try to compile or copy
it). |
| Open Selection | Opens the file or folder currently selected in the main window. Normally, you use this command on a selection in a folder window. However, it also works on selected text in a file window. The selected text must be either a full path name, or a file name or path name relative to the current folder (the folder containing the file in the main window). |
| Open Folder | Displays a panel in which you enter the path name of a folder to be opened. When you click on OK, the folder opens in an Edit folder window. When the panel appears, Edit displays the name of the current folder in the Folder name field. |
Commands in the Edit Menu
- Edit's Edit menu contains the standard Cut, Copy, Paste, Delete, and Select All commands, plus commands for opening the Link submenu and the Find submenu described in "Commands in the Link Submenu" and "Commands in the Find Submenu. Other commands are described in Table 4-5.
-
Table 4-5
| Command | Description |
| Undelete | Reinserts the most recently deleted text, even if the text has not been put on the pasteboard. You can insert the deleted text at a new location by positioning the insertion point where you want to insert the text (or selecting text that you want it to replace) and then choosing Undelete. |
| Spelling | Opens the Spelling Panel for checking the spelling of words in the main window. See "Checking Your Spelling" in Using the OpenStep Desktop. |
| Check Spelling | Has the same effect as clicking Find Next in the Spelling panel--that is, it finds the next word not contained in the spelling dictionary. See "Checking Your Spelling" in Using the OpenStep Desktop. |
Commands in the Link Submenu
- Edit's Link submenu provides the commands described in Table 4-6 for working with linked documents. For more information, see "Adding Linked Graphics" in Using the OpenStep Desktop.
-
Table 4-6
| Command | Description |
| Paste and Link | Pastes a copy of a graphic contained on the pasteboard, but creates a link to the document that the graphic came from, so that future changes to the original graphic will affect the copy in the Edit document as well. |
Show Links, Hide
Links | Shows (or hides) whether or not graphics are linked
by displaying a linked chain around the border of each linked
graphic. |
| Link Inspector | Opens the Link Inspector panel. |
Commands in the Find Submenu
- Edit's Find submenu contains the standard Find Panel, Find Next, Find Previous, and Enter Selection commands. Other commands are described in Table 4-7.
-
Table 4-7
| Command | Description |
| Jump to Selection | Scrolls the insertion point or current text selection into view. |
| Line Range | Opens a panel that identifies by number the line or line range containing the current selection in the main window. If the Character option in this panel is selected instead of the Line option, then the character range is displayed instead of the line range. You can also use the panel to search for a particular line, line range, character, or character range in the main window. Enter a number or a range (a range is two numbers separated by a colon) in the Range field. Click on the Select button to select that character, line, or range of the file.
|
Commands in the Format Menu
- The Format menu contains commands for displaying the standard Font and Text submenus, as well as Edit-specific Help and Structure submenus (seeTable 4-9 on page 4-29 and Table 4-10 on page 4-30). It also contains the Page Layout command described in Table 4-8.
-
Table 4-8
| Command | Description |
| Page Layout | Displays the standard Page Layout panel for choosing among various paper sizes, scaling factors, and orientations for text printed from the main window. When you print text that is displayed in a window, the printed words wrap exactly as theyare wrapped on the screen. Therefore, if you change the page layout, the width of the window may also need to be changed in order for the text to print correctly. Changing the page layout does not affect the size of the main window, so you need to make this adjustment.
|
Commands in the Font Submenu
- The Font submenu contains the standard Font commands, plus a few additional commands that let you change the font properties of the text displayed in the main window--for example, the Colors command opens the standard Colors panel, which you can use to change the color of the selected text.
- In an RTF file, font changes apply to the current selection and are saved when you save the contents of the window.
- In an ASCII file, font changes are applied to the entire contents of the main window--font changes in non-RTF files are not saved when you save the contents of the window.
Commands in the Text Submenu
- Edit's Text submenu contains commands (see Table 4-9) that let you change properties of the text displayed in the main window. Some of these commands work only on text in RTF files; use the Make Rich Text command if you want to change the contents of the main window from ASCII to RTF.
-
Table 4-9
| Command | Description |
Align Left, Center,
Align Right | These align the text with the left margin (ragged right), center
it between both margins, or align it with the right margin
(ragged left). |
| Make Rich Text, | Changes the format of the text in the main window from |
| Make ASCII | RTF to ASCII, or vice versa. In an RTF file, font changes and other text properties (such as superscripting and subscripting) can be saved as part of the file and displayed along with the text. |
| Nest, Unnest | These commands help you indent blocks of program code. Select the program lines you want to indent and then choose Nest. Each line in the selected program text will be indented the default amount (four characters, unless you have specified a different default value in the Preferences panel or overridden the default when you started up Edit from a shell window). Unnest moves the selected lines the default number of characters to the left, thus counteracting the effect of Nest.
|
Show Ruler, Hide
Ruler | Show Ruler displays a ruler at the top of the main window, and
the Hide Ruler command removes it. With this ruler you can
set margins, tabs, and paragraph indentation. See "Using the
Ruler" in Using the OpenStep Desktop. |
-
Table 4-9 (Continued)
| Command | Description |
Copy Ruler, Paste
Ruler | Copy Ruler copies the ruler settings of the paragraph
containing the insertion point or the beginning of the current
selection, so that you can subsequently paste them with Paste
Ruler. It is as though there's a separate pasteboard for the
ruler, and Copy Ruler replaces what is already on it, just as
Copy does for text.
Paste Ruler affects the paragraph containing the insertion point
or the current selection. It replaces the paragraph's ruler
settings with the last ones you copied with Copy Ruler. If the
current selection spans more than one paragraph, Paste Ruler
replaces the ruler settings of all the selected paragraphs.
These commands do not require the ruler to be showing, and
they do not change the contents of the pasteboard. |
Commands in the Help Submenu
- The Help submenu provides the commands described in Table 4-10, which are used to add or edit Help links. Although Help links are designed for use within an application's on-line Help system, they can also be used more generally (for example, the Contents file for the release notes could contain links to the various release note files). For more information about working with Help links and markers, see "Adding Help Links" on page 4-17. For information about adding a Help system to an application you are developing, see "Commands in the Project Menu" on page 2-33 and "Attaching Help to Objects" on page 3-132.
-
Table 4-10
| Command | Description |
| Insert Link | Inserts a Help link at the insertion point in the main window. |
| Insert Marker | Inserts a Help marker at the insertion point in the main window. |
Show Markers,
Hide Markers | Shows (or hides) all the markers in the main window. |
Commands in the Sructure Submenu
- The Structure submenu provides commands (see Table 4-11) that control whether certain portions of the text in the main window are expanded (that is, visible) or contracted (that is, hidden). These commands are useful for working with files that have a regular multilevel structure, in which the various levels of structure are represented by varying degrees of indentation; for example, an outline or Objective C language source code. See "Contracting and Expanding Text in a File Window" on page 4-15 for a detailed introduction to this Edit feature.
-
Table 4-11
| Command | Description |
Contract All,
Expand All | These contract or expand all the text in the main window. |
Contract Sel,
Expand Sel | These contract or expand the selected text in the main window. |
Commands in the Utilities Menu
- Commands in the Utilities menu, described in Table 4-12 on page 4-32, perform a variety of functions such as providing an interface to the UNIX shell and looking up information in a UNIX manual page. There are also two customizable submenus--User Commands and User Pipes--to which you can add commands that you have defined yourself.
-
Table 4-12
| Command | Description |
| Command | Displays a panel in which you specify a UNIX command to be run. The output of the command appears in a window titled UNTITLED, rather than in the main window. Two variables can be used as arguments to the UNIX command you specify:
$file refers to the file that is displayed in the main window.
selection refers to the contents of the current selection, which must be single file specification (wildcards can be used). Normally this will be a file that is selected in a folder window.
|
| User Commands | Displays a submenu of commands you have defined and saved in a file named .openstep/.commanddict in your home folder. Any changes you make to the .commanddict file do not take effect until the next time you start Edit. The .commanddict file format is described in "Piping UNIX Output to a File" on page 4-22. |
| Pipe | Works the same as Command, with one important difference: The output of the UNIX command that you specify is not displayed in another window--instead, the output (including any error messages that might be generated) appears in the main window at the insertion point or in place of the current selection. |
| User Pipes | Displays a submenu that contains pipe commands you have defined and saved in a file named .pipedict in your home folder. These commands may be similar to commands you define in the User Commands menu, but the output appears in the main window at the insertion point or in place of the current selection, rather than in a separate window. The .pipedict file format is described earlier in "Piping UNIX Output to a File" on page 4-22."
|
-
Table 4-12 (Continued)
| Command | Description |
| Source | Opens the file containing the definition of the program object (such as a function, procedure, global variable, or typedef) selected in the main window. This command searches one or more tags files for the location of the object definition and then opens the file containing the definition. Normally, Edit searches the tags file in the current folder (the folder containing the file in the main window). However, you can specify other tags files to be searched either in the Preferences panel or when starting up Edit from a shell window. To locate an object definition, select the function name, macro, or other program object in the file you are working in and choose Source. Edit opens the file containing the required information and highlights the first occurrence of the object in the text. If you choose Source without selecting text, Edit displays a panel that prompts you to enter the program object you want defined. If Edit cannot locate the object, it informs you that no such tags file entry for the object exists. (If this happens, use the Preferences command to make sure that the path name of the tags file listing the location of the object is specified.) A tags file is a file you create with the UNIX ctags command. The file lists the locations of specified program objects (such as functions, procedures, global variables, and typedefs). More information on tags files is given in the ctags UNIX manual page.
|
| Manual | Displays a UNIX manual page in an Edit window. First select the manual page subject in the main window and then choose Manual. If there is no selection, a panel appears prompting you for an entry. |
| Match | If you select one of a matching pair of delimiters (parentheses, braces, or square brackets) and choose Match, the pair of delimiters and the enclosed text become selected. You can also invoke this command by double-clicking on either of the delimiters. |
Commands in the Expert Submenu
- The Expert menu provides the advanced commands described in Table 4-13.
-
Table 4-13
| Command | Description |
| Update Folder | Updates the contents of the main window, which must be a folder window. Folder windows are not automatically updated, so this command is useful when files in a folder have been created, deleted, or renamed. |
| Copy PS | Copies the contents of the main window onto the pasteboard as an Encapsulated PostScript (EPS) image. Once pasted into an application that accepts EPS images, the pasted copy of the text can no longer be edited. |
Expansion
Dictionary | Opens the Expansion Dictionary panel for managing text
expansion definitions. See "Using Templates" on page 4-18 for
a complete description of this panel. |
| Insert Field | Creates a new field in an expansion template. See "Using Templates" on page 4-18. |
| Next Field | Moves the insertion point to the next field in an expansion template. See "Using Templates" on page 4-18. |
| Close Ancestors | Closes all Edit windows associated with each folder that
is neither the main window's folder nor one of its subfolders. |
| Close Descendants | Closes all Edit windows associated with each folder that is a subfolder of the main window's folder. If the main window is a folder window it will remain open, but if the main window is a file window it will be closed as well. |
|
|