All Manuals > LispWorks IDE User Guide > 13 The Editor

NextPrevUpTopContentsIndex

13.1 Displaying and editing files

The Text view is the default view in the Editor, and is the one which you will become most familiar with. In this view, a buffer containing the text of the current file is displayed, and you can move around it and change its contents as you wish, then save it back to the original file (assuming that you have permission to write to it). The Text view is automatically displayed when you first invoked the Editor, and you can click on the Text tab to switch back to it from any other view. Text view in the Editor below shows an Editor in the Text view with a file open.

Figure 13.1 Text view in the Editor

The Text view has three areas, described below.

13.1.1 The toolbar

The Editor toolbar offers easy access to commands which operate on source code. In the Text view it allows you to set breakpoints, and macroexpand, compile or evaluate code.

The Editor toolbar also contains the standard history toolbar. This is enabled in every view of the Editor tool.

13.1.2 The editor window

The editor window is the main part of the Editor. The text of the current file is shown in this area. A block cursor denotes the current position in the files in Emacs emulation. In KDE/Gnome editor emulation, a vertical line cursor appears in the active editor window. Text is entered into the file at this position when you type or paste.

To move the cursor to a particular point in the file, you can use any combination of the following methods:

If you are unfamiliar with the Editor, you can use the first two methods to begin with. As you become more familiar, you will find it is often quicker to use the keyboard commands described in the LispWorks Editor User Guide . Some of the most basic commands are also described in this chapter, in Basic Editor commands.

13.1.3 The echo area

Underneath the editor window is an echo area, identical to the echo area in the other tools. This is used by the Editor to display status messages, and to request more information from you when necessary. The echo area is contained in every view in the Editor.

Whenever you invoke a command which requires further input (for instance, if you search a file for a piece of text, in which case you need to specify the text you want to search for), you are prompted for that input in the echo area. Type any information that is needed by the Editor, and the characters you type are displayed ("echoed") in the echo area.

For many commands, you can save time by using completion . When you have partially specified input in the echo area, you can press a key (usually Tab, ? or Space, depending on the command) and the Editor attempts to complete what you have typed. If it cannot complete your partial input uniquely, a window appears which lists all the possible alternatives and allows you to select the desired completion. See Completion for detailed instructions.

For example, suppose you have three files in the current directory, test1.lisp, test2.lisp and test3.lisp, and you want to edit test2.lisp using keyboard commands. Type Ctrl+X Ctrl+F, then type test and press Tab. A list appears which shows all three files. To edit test2.lisp, double-click on the item marked test2.lisp in this list. For longer lists, the completion GUI helps you to quickly reduce the choice. See Completion for details.

To see when completion is appropriate and when it is not, experiment by pressing the Tab key when typing in the echo area. As a rule, if there are a finite number of things you could meaningfully enter, then completion is appropriate. Thus, when opening a file already on disk, completion is appropriate (there is a finite number of files in the current directory). When specifying a string to search for, however, completion is not appropriate (you could enter any string).

13.1.4 Using keyboard commands

A full description of the keyboard commands available in the Editor is beyond the scope of this manual, and you are advised to study the LispWorks Editor User Guide to gain a full appreciation of the capabilities of the Editor. However, of necessity, certain basic keyboard commands are discussed in this chapter. See Basic Editor commands of this manual for a brief introduction to some of the most important ones. The menu commands available are described throughout the rest of this chapter.

As with other keyboard commands used in the environment, the keyboard commands used in the Editor are invoked by using a combination of the modifier keys Control, Shift, Escape, Alt and Command (not all of these are available on each platform), in conjunction with ordinary keys. Some of the commands available perform the same, or a similar task as a menu command.

Each keyboard command in the editor is actually a shortcut for an extended editor command . You can invoke any extended command by typing its command name in full, preceded by the keyboard command Alt+X. Thus, to invoke the extended command Visit Tags File, type Alt+X visit tags file followed by Return. Case is not significant in these commands, and completion (described in Completion) may be used to avoid the need to type long command names out in full. This method is often useful if you are not certain what the keyboard shortcut is, and there are many extended commands which do not have keyboard shortcuts at all.

Many of the keyboard commands described in this chapter and in the LispWorks Editor User Guide also work in the Listener. Feel free to experiment in the Listener with any of the keyboard commands that are described.


LispWorks IDE User Guide (Unix version) - 13 Sep 2017

NextPrevUpTopContentsIndex