GNU TeXmacsUser manualReferenceAboutEnglish
Manipulating TeXmacs windows
(window-list)
(list of all TeXmacs windows)

Return the list of all TeXmacs windows. The number of windows is returned by (windows-number).

(current-window)
(current window)

Return the window in which the current view is displayed. If the current view is not displayed in a window, then an empty URL is returned.

(window->buffer win)
(buffer displayed in window)

This routine returns the buffer which is currently being displayed in the window win, or #f. The glued variant window-to-buffer returns (url-none) instead of #f. Warning: in the future, when a window will be allowed to contain multiple buffers, this routine might be replaced by window->buffers.

(window->view win)
(view displayed in window)

This routine returns the view which is currently being displayed in the window win, or (url-none). Warning: in the future, when a window will be allowed to contain multiple views, this routine might be replaced by window->views.

(window-set-buffer win buf)
(show buffer in window)

Display the buffer buf in the window win, using a view on buf which is not yet displayed in another window (a new view is created if necessary). Nothing happens if the window has no view, or already displays buf.

(window-set-view win vw focus?)
(show view in window)

Display the view vw in the window win. If focus? is #t, or if the view previously displayed in win was the current view, then vw becomes the current view. The program aborts if the view was already attached to another window.

(window-focus win)
(focus window)

Set the current focus to the window win. The current implementation is still a bit bugged and only correct if you want to execute a sequence of commands under the assumption that win carries the focus and if you return the focus to the original window at the end.

(switch-to-window win)
(switch to another window)

Map the window win and give it the keyboard focus.

(open-window)
(create new window)

Create a new window with an empty buffer and return the URL of the window. The variant (open-window-geometry geom) in addition specifies the geometry of the new window, and (clone-window) opens a new window on the current buffer.

(open-buffer-in-window buf cnt attrs)
(open buffer in new window)

Create a new window and set its main buffer to that identified by the URL buf. If buf is not yet a valid buffer, it is created and its contents set to cnt, otherwise the second parameter is ignored. The window is created with its attributes set to attrs (currently only the geometry is taken into account, but this might be extended in the future, see the C++ function url new_window (bool map_flag= true, tree geom= "") in

Texmacs/Data/new_window.cpp

). The URL of the new window is returned.

(kill-window win)
(close a window)

Close the window win, without closing the buffer which it displays. If this was the last window, then TeXmacs quits (unless it is running as a server).

See windows for the corresponding C++ data structures.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".