![]() |
Introduction | ![]() |
There are three main kinds of objects for buffer management in TeXmacs:
Every open TeXmacs document is stored in a unique editable buffer. Buffers typically admit a one to one correspondence to files on disk or elsewhere on the web. Some buffers are of a more auxiliary nature, such as automatically generated help buffers. All buffers admit a unique URL. In the case of auxiliary buffers, this URL is really a read-only “placeholder”, so saving this kind of buffers is impossible (of course, it remains possible to save the buffer under a new name).
It is possible to have multiple views on the same buffer. Every view is identified by a unique automatically generated URL, which again acts as a placeholder. View URLs have the form tmfs://view/n/buffer, where n is a number and buffer an encoding of the URL of the underlying buffer.
Views (contrary to the buffers themselves) can be displayed in actual windows. Currently, any TeXmacs window contains a unique view and a view may only be displayed in one window at the same time (of course, it is possible to display different views on the same buffer in different windows). Windows are again represented by automatically generated URLs of the form tmfs://window/n.
At any moment, there is at most one current view; the current buffer and the current window are the buffer of the current view and the window in which it is displayed. Most editing routines act on the current view. The C++ implementation of these objects is described in the server: buffers, views and windows.
Remark 1. In the future, views and windows should really be considered as documents themselves. Changes in the view will be automatically propagated (or not) to the corresponding buffer, and the other views. Windows will contain a document which specifies its layout (menus and toolbars). The corresponding view (or views) will be an active hyperlink (or active hyperlinks). The current APIs already reflect these future development intentions.