TextEditor(1) TextEditor(1)NAME TextEditor - lets you edit files interactively through mouse and menu operations SYNOPSIS TextEditor [file]... ARGUMENTS file Specifies the file to be edited. DESCRIPTION TextEditor is a mouse-based text-editing program for use with both Macintosh and A/UX text-only files. It is compatible with A/UX 2.0 and later systems. TextEditor provides an alternative to the vi and ed text editors for those who prefer to work with the mouse and pull-down menus rather than with keyboard commands. You can start TextEditor by double-clicking its icon, by double-clicking the icon of a Macintosh or A/UX text file while TextEditor is the default editor, or by typing TextEditor on the A/UX command line. (For the last two launch methods to work, your startup file should set the search directory list stored in PATH to include /mac/bin, and FINDER_EDITOR should be set to /mac/bin/TextEditor.) For more information about making TextEditor the default editor, see A/UX Essentials. If you double-click a file icon or specify a filename when invoking TextEditor from the command line, the text of that file appears in the first window displayed; otherwise, the first window is empty. TextEditor lets you open several windows at once, each displaying text from a different file; however, you can work in only one window at a time. The window in which you are working is called the ``active window.'' You can scroll and page through the text in the active window by using the scroll bar that appears at its right side, as described in A/UX Essentials . Files created or edited by TextEditor are saved as text-only files of type 'TEXT'. They can contain tab and newline characters but no other formatting information. This file structure is compatible with that of other applications that create text-only files; for example, TextEditor can process MacWrite files saved with the Text Only option. The tab setting, font setting, selection, window settings, auto-indent state, invisible character state, and markers applicable to a file are saved with the file in its resource fork. This resource fork appears as a file named %file in January 1992 1
TextEditor(1) TextEditor(1)the A/UX directory that contains the primary file. You can tell TextEditor not to save this resource file by clicking the Save Text Only radio button in the dialog box that appears when you select any of the following items from the File menu: New, Close, Save As, and Save a Copy. Mouse-Based Editing In TextEditor, the procedure for inserting text entered from the keyboard is simple. Use the mouse to position the I- beam pointer on the screen at any place in the text inside the text window and then click (press and release) the mouse button. When you click, a blinking vertical bar appears at the pointer position to mark the current text-insertion point. Characters you enter from the keyboard always appear at this insertion point. At any time, you can move the pointer to a new place in the text and click to establish a new insertion point. Caution: Except for the tab and newline characters, TextEditor ignores zero-width (control) characters generated by the keyboard. If you need to enter such a character into a document, generate it in the Key Caps desk accessory (accessible in the Apple menu) and use the Copy and Paste menu items in the Edit menu to transfer it to the document. The general procedure for using TextEditor to edit or otherwise modify existing text comprises two steps: First you select the text to be changed and then you choose the operation you want to perform on the selection. If you select text and immediately enter one or more characters from the keyboard, rather than choosing a menu item, TextEditor deletes the selected text and inserts the text entered from the keyboard in its place. In many cases, TextEditor lets you undo an operation if you make a mistake. Choose Undo from the Edit menu immediately after the faulty operation. The next section, ``Text Selection,'' tells you how to select a range of text. The subsequent section, ``Menu Items,'' describes the operations you can perform. Text Selection You can use several techniques to select a range of text for a TextEditor editing operation. Double-clicking. When you position the pointer on a word and click the mouse button twice in rapid succession, TextEditor selects that word. This technique is called 2 January 1992
TextEditor(1) TextEditor(1)``double-clicking.'' In this selection mode, TextEditor recognizes two character domains. One domain contains the uppercase and lowercase letters, the ten numerals, and the underscore character; the other domain contains all other characters, including punctuation, space, and newline. If you double-click a character from the letter domain, TextEditor selects text in both directions from that character to the first character belonging to the punctuation domain. If you double-click on a punctuation character, except for one of the enclosing characters described later in ``Enclosed Text Selection,'' TextEditor selects just that character. Triple-clicking. When you place the cursor anywhere within a line of text and click the mouse button three times in rapid succession, TextEditor selects the entire line. This technique is called ``triple-clicking.'' Dragging. When you move the pointer over text from one place to another while holding down the mouse button, TextEditor selects all the text the pointer passes over until you release the mouse button. This technique is called ``dragging.'' By dragging, you can select any amount of text from a single character to an entire document. When you attempt to move the pointer above or below the text currently displayed, TextEditor automatically scrolls the window to display more text. Shift selection. When you move the pointer to a place other than the current insertion point and then click while holding down the SHIFT key, TextEditor selects all the text between the insertion point and the pointer position, even when they are on different pages of the document and the insertion point is not visible. Marker selection. You can create names for selections of text as described in ``Mark Menu'' in the ``Menu Items'' section, later in the ``Description'' section. To select a piece of text that you have previously named, you just choose its name from the Mark menu. Enclosed-text selection. When you double-click on particular delimiters, TextEditor selects all text between the delimiter you double-clicked and its mating delimiter. The delimiter characters and their mates are (text) [text] {text} This method of selecting text works both backward and forward. For example, if you double-click on a right January 1992 3
TextEditor(1) TextEditor(1)bracket, TextEditor searches backward for the first preceding left bracket. It also correctly parses nested structures that use the same enclosing characters. When you double-click the first occurrence of a delimiter in the following list, TextEditor forward-selects all text between it and the next occurrence of the same delimiter. The self-mating delimiters are " ' ` / \ When you make a selection by double-clicking any of the delimiter characters just listed, TextEditor selects all characters between that delimiter and the mating delimiter. The search for the mating character continues until the beginning or end of the document is reached. The resulting selection does not include the delimiters themselves. If TextEditor does not find a mating delimiter, it selects only the character that you originally double-clicked. Menu Items TextEditor displays menus titled File, Edit, Find, Mark, and Window in the menu bar at the top of the screen, plus the Apple menu at the far left. Each menu contains menu items that perform various TextEditor actions. To choose a menu item, position the pointer on a menu title, press the mouse button, and move the mouse downward while holding down the mouse button. Release the button when the pointer has highlighted the desired item. Menu actions operate only on the active window. You can invoke many menu actions from the keyboard by holding down the COMMAND key (not CONTROL) while typing a character. The character required is shown beside the COMMAND-key symbol in the menu display. Such COMMAND-key equivalents can be entered with lowercase characters; you don't need to hold down the SHIFT key as well. The sections that follow describe the actions performed by the various TextEditor menu items. Apple menu. At the far left of the menu bar, the Apple symbol is the title of a menu that contains the About TextEditor menu item. Choosing that menu item displays a dialog box that gives version information. File menu. The menu items in the File menu let you create, retrieve, and save files, print text, and quit TextEditor. The File menu contains the following menu items: 4 January 1992
TextEditor(1) TextEditor(1)New... Creates a new empty file of type 'TEXT'. This menu item first displays a dialog box that lets you enter a filename and select a directory to contain the document. When you click the Desktop button in this dialog box, TextEditor lists the names of disks (volumes) that appear on the desktop, to allow you to switch between them. Once you have selected a volume, and possibly a folder or nested folder on a volume, you can click the New button to create an empty file in the selected location. At that time, a new, active TextEditor window appears. The dialog box contains radio buttons that let you specify whether the resulting file will be saved with its formatting information or as text only. The COMMAND-key equivalent for the New menu item is COMMAND-N. Open... Opens an existing text file from a disk. This menu item first displays a list of all files of type 'TEXT' that are available in the current directory. You can click the Desktop button to view the names of disks (volumes) that appear on the desktop. To open a file, double-click its name, or select its name and then click the Open button. When you open a file for the first time, TextEditor places the insertion point at the beginning of the text. When you open the file subsequently, it appears in the last state in which TextEditor saved it; the previous selection or insertion point is preserved (if you have saved formatting information) unless the file has been modified by other software. To open a nonmodifiable copy of a file, click the Read-Only checkbox. If the file you specify is already open in TextEditor, its window is made active. The COMMAND-key equivalent for the Open menu item is COMMAND-O. Close Closes the active window and removes it from view. You can display the window later by using the Window menu. This menu item does not save the window contents on a disk. If you have not previously saved the file, a dialog box appears that lets you specify whether the file being closed is to be saved and, if so, whether it should be saved with formatting information or as a text-only file. The COMMAND-key equivalent for the Close menu item is COMMAND-W. January 1992 5
TextEditor(1) TextEditor(1)Save Saves the contents of the active window on a disk, in the file that was originally opened, without closing the window. This menu item is dimmed if the contents of the file have not been changed since the last Save action. The COMMAND-key equivalent for the Save menu item is COMMAND-S. Save As... Allows you to make a copy of the currently active file, which you must then save under a different name. This menu item saves the current contents of the window as the new file, and allows you to continue editing the new file. The old file is left unchanged with its original name. Save a Copy... Allows you to save the current state of the active window to a new file with the name ``Copy Of file.'' Revert to Saved Discards all changes that you have made to the contents of the active window since they were last saved. This menu item is dimmed if the contents of the file have not been changed since the last Save action. Page Setup Displays a dialog box that lets you set the page size, orientation, and reduction or enlargement for subsequent printing actions. Print Window Prints text from the active window. If part of the text is selected, TextEditor prints only the selection; otherwise, it prints the entire document displayed in the window. Use the Chooser desk accessory, available in the Apple menu, to specify which printer to use. Use the Page Setup menu item to specify page size, orientation, and scale. Quit Quits TextEditor and returns you to the Finder. If there are unsaved changes to any files, TextEditor gives you a chance to save them. The COMMAND-key equivalent for the Quit menu item is COMMAND-Q. Edit menu. The menu items in the Edit menu allow you to move text and perform global formatting actions. The Edit menu contains the following menu items: Undo Reverses the most recent text change. If you choose Undo a second time, the change is reinstated. This menu action does not affect changes to the resource fork, such as font or tab settings. If there was no 6 January 1992
TextEditor(1) TextEditor(1)previous action taken, this menu item is dimmed. The COMMAND-key equivalent for the Undo menu item is COMMAND-Z. Cut Removes the currently selected text from the active window and places it in the Clipboard. The COMMAND-key equivalent for the Cut menu item is COMMAND-X. Copy Copies the currently selected text in the active window to the Clipboard without deleting it from the window. The COMMAND-key equivalent for the Copy menu item is COMMAND-C. Paste Replaces the currently selected text in the active window with the contents of the Clipboard. If there is no current selection, TextEditor inserts the contents of the Clipboard at the current insertion point. The COMMAND-key equivalent for the Paste menu item is COMMAND-V. Clear Deletes the currently selected text from the active window. The keyboard equivalent for the Clear menu item is DELETE. Select All Selects the entire document that is displayed in the active window. The COMMAND-key equivalent for the Select All menu item is COMMAND-A. Show Clipboard Opens a new, active TextEditor window that displays the contents of the Clipboard, if any. Format... Displays a dialog box that lets you set typography and indentation for the entire document that is displayed in the active window. The scroll box lets you select a font and size for the active window by clicking items in the lists. The Auto Indent checkbox in the Format dialog box turns auto-indenting on and off. When auto-indenting is on, press RETURN to align text with the left margin of the preceding line. You can override auto-indenting for any single line, aligning it to the far left margin, by holding down OPTION while you press RETURN. The Show Invisibles checkbox in the Format dialog box turns the display mode for invisible characters on and January 1992 7
TextEditor(1) TextEditor(1)off. When display mode is on, all characters in the document are displayed, including those normally invisible. Tabs are shown as triangles, spaces as diamonds, newlines as logical negation characters (), and all other normally invisible characters as upside- down question marks. The Tabs text box in the Format dialog box lets you enter the number of spaces signified by each tab character in the active window. Align Aligns the left margin of all the currently selected text in the active window with the top line of the selection. Shift Left Moves the currently selected text in the active window one tab measure to the left, preserving indentation within the selection. The COMMAND-key equivalent for the Shift Left menu item is COMMAND-{. If you also hold down the SHIFT key while pressing COMMAND-{, the distance moved becomes one space instead of one tab. Shift Right Performs the same action as Shift Left, but moves the selection to the right. The COMMAND-key equivalent for the Shift Right menu item is COMMAND-}. Find menu. The menu items in the Find menu help you find and replace text in the active window. All search actions start by displaying a dialog box that lets you specify the following options by clicking a checkbox: Literal Finds the exact string you entered, wherever it may appear, even if it is part of another string. Entire Word Finds the string you entered only if it constitutes an entire word. The determination of word boundaries is the same as with double-clicking, described in ``Text Selection,'' earlier in the ``Description'' section. The Entire Word and Literal options are mutually exclusive. Case Sensitive Finds the string you entered only if the uppercase and lowercase status of all letters in the found string is the same as that of the letters in the search string. 8 January 1992
TextEditor(1) TextEditor(1)Search Backward Searches from the current selection or insertion point toward the beginning of the document. You can temporarily reverse the direction of searching, either from forward to backward or from backward to forward, by holding down the SHIFT key when you start a search operation. Wrap-around Search Searches forward to the end of the document, then starts searching again from the beginning to the current selection or insertion point. If Search Backward is also selected, Wrap-around Search does the same operation in the reverse direction. By default, only the Literal checkbox is selected. Whenever a search fails, TextEditor produces a beep, or other sound you set as your preferred alert sound. The Find menu contains the following menu items: Find... Finds the next occurrence of the string you specify in the text box. TextEditor scrolls the active window to display the found string and selects the text it has found. The COMMAND-key equivalent for the Find menu item is COMMAND-F. Find Same Repeats the most recent Find operation. The COMMAND- key equivalent for the Find Same menu item is COMMAND- G. Find Selection Finds the next occurrence of the currently selected text. The COMMAND-key equivalent for the Find Selection menu item is COMMAND-H. Display Selection Scrolls the active window to display the currently selected text. Replace... Finds the next occurrence of the string you specify in the text box and replaces it with another string that you also specify in a second text box. The COMMAND-key equivalent for the Replace menu item is COMMAND-R. Replace Same Repeats the latest Replace operation. The COMMAND-key equivalent for the Replace Same menu item is COMMAND-T. January 1992 9
TextEditor(1) TextEditor(1)Mark menu. The menu items in the Mark menu help you navigate long documents. They let you associate labels with pieces of text so you can easily find them later. They also make it easy to select large pieces of text, as explained in ``Text Selection,'' earlier in the ``Description'' section. The upper part of the Mark menu, above the horizontal line, contains the menu items Mark and Unmark; the lower part contains a list of all mark labels that you have created for the currently active window. The Mark and Unmark menu items perform the following actions: Mark... Displays a dialog box that lets you attach a label to a text position. If you previously selected a piece of text, the label applies to the whole selection; if not, it applies to the current position of the insertion point. If you try to create a label by using a name that is already taken, TextEditor displays a dialog box that lets you either replace the old marker or choose a new name. The COMMAND-key equivalent for the Mark menu item is COMMAND-M. Unmark... Displays a dialog box that lets you remove unwanted markers. The Unmark dialog box shows you a list of all current markers. You can select one or more of them, by clicking or dragging, and then click the Delete button. If you decide you don't want to delete a marker, click the Cancel button. When you choose one of the label items in the lower part of the menu, TextEditor scrolls the active window to the marked text and either selects it (if you originally marked a selection) or places the insertion point at the marked position. Window menu. The menu items in the Window menu allow you to arrange and display TextEditor windows. The upper part of the Window menu, above the horizontal line, contains the menu items Tile Windows and Stack Windows; the lower part contains a list of the absolute pathnames of all open TextEditor windows. The menu items in the upper part of the Window menu perform the following actions: Tile Windows Arranges the currently open windows vertically, so that at least part of the contents of each is visible. Stack Windows 10 January 1992
TextEditor(1) TextEditor(1)Arranges the currently open windows in a diagonally staggered overlapping pattern, with the active window in front. The active window is the only one whose contents are visible. When you choose one of the windows listed in the lower part of the menu, TextEditor makes it the active window. The names of currently displayed windows are listed in the order in which they were originally displayed. In addition, they are marked as follows: Check symbol Indicates the currently active window. Round bullet (⊕) Indicates the window that was active just before the currently active window, and hence is second to the front. Underline (_) Indicates any window containing changes that have not yet been saved. FILES /mac/bin/TextEditor Executable file SEE ALSO ed(1), ex(1), sed(1), vi(1) A/UX Essentials A/UX Text Editing Tools MPW 3.0 Reference January 1992 11