All Manuals > LispWorks IDE User Guide > 12 The Editor

12.3 Displaying and swapping between buffers

The contents of the editor window is the buffer. Technically speaking, when you edit a file, for example by File > Open..., its contents are copied into a buffer which is then displayed in the window. You actually edit the contents of the buffer, and never the file. When you save the buffer, for example by File > Save, its contents are copied back to the actual file on disk. Working in this way ensures that there is always a copy of the file on disk - if you make a mistake, or if your computer crashes, the last saved version of the file is always on disk, ensuring that you do not lose it completely.

Because of this distinction, the term buffer is used throughout, when referring to the text in the window.

An Editor can only have one editor window, although there can be many buffers open at once. This means that you can edit more than one file at once, although only one buffer can be displayed at a time in the window - any others remain hidden.

When you close a buffer, for example with the menu command File > Close or the key Ctrl+X K, the buffer is removed. This is different to the command Works > Exit > Window which closes the window and does not affect the buffer.

The diagram below shows the distinctions between the window, buffers and files on disk.

Distinctions between the window, buffers, and files on disk

The Buffers view allows you to display a list of all the buffers that are currently open in the Editor, and allows you to navigate between them. Click on the Buffers tab to switch to this view, or press Ctrl+X Ctrl+B. The Editor appears as shown in Listing buffers in the Editor below.

Listing buffers in the Editor

The Buffers view has two areas, described below.

12.3.1 Filter area

You can use this area to restrict the number of buffers displayed in the Buffers area. For example you could display just the Lisp source files (that is, those with file type lisp) by entering .lisp as shown in Filtering the buffers list in the Editor.

Filtering the buffers list in the Editor

You can filter by regular expression matching, and you can exclude matches and make the filtering case-insensitive. See 3.12 Filtering information for the details.

12.3.2 Buffers area

Each item in the Buffers area list represents an editor buffer. Properties of the buffer such as its size (in bytes) and its mode are displayed. See the Editor User Guide for information about editor modes.

Double-click on any buffer to display it in the Editor's Text view.

Buffers selected in the Buffers area can be operated on by commands in the Buffers menu, which is also available as the context menu. The associated files can be operated on by commands in the File menu. For example, to save multiple buffers, select them the Buffers area and choose File > Save. See 12.13 Using Lisp-specific commands for more details.

12.3.3 Editor tool solely as buffers list

You can use a particular Editor tool solely as a buffers list.

To do this, set an Editor tool to be non-reusable by switching off the option Works > Customize > Reusable. Then select the Buffers tab or press Ctrl+X Ctrl+B.

This Editor tool will continue to display the buffers list and will not be re-used by operations which want to display a buffer, or list definitions, and so on. Other Editor tools will be used, and created as necessary, for those operations.

Note: You can also set an option to display a buffers list (like a cut-down version of the Buffers view) in the Text view. See 12.7.2.2 Buffers list option.


LispWorks IDE User Guide (Unix version) - 01 Dec 2021 19:37:11