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
Window > Close 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.
Figure 13.2 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
tab to switch to this view, or press
Ctrl+X Ctrl+B. The Editor appears as shown in Listing buffers in the Editor below.
Figure 13.3 Listing buffers in the Editor
The Buffers view has two areas, described below.
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.
You can filter by regular expression matching, and you can exclude matches and make the filtering case-insensitive. See Filtering information for the details.
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 LispWorks Editor User Guide for information about editor modes.
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 Using Lisp-specific commands for more details.
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 Buffers list option.
LispWorks IDE User Guide (Macintosh version) - 12 Feb 2015