Next: , Previous: , Up: Controlling the Display   [Contents][Index]


10.3 Window Functions

Hemlock Variable: Default Window Width
Hemlock Variable: Default Window Height
Hemlock Variable: Make Window Hook
Function: make-window mark &key :modelinep :window :ask-user :x :y :width :height :proportion

make-window returns a window displaying text starting at mark, which must point into a buffer. If it could not make a window on the device, it returns nil. The default action is to make the new window a proportion of the current-window’s height to make room for the new window.

Modelinep specifies whether the window should display buffer modelines.

Window is a device dependent window to be used with the Hemlock window. The device may not support this argument. Window becomes the parent window for a new group of windows that behave in a stack orientation as windows do on the terminal.

If ask-user is non-nil, Hemlock prompts the user for the missing dimensions (x, y, width, and height) to make a new group of windows, as with the window argument. The device may not support this argument. Non-null values other than t may have device dependent meanings. X and y are in pixel units, but width and height are characters units. Default Window Width and Default Window Height are the default values for the width and height arguments.

Proportion determines what proportion of the current-window’s height the new window will use. The current-window retains whatever space left after accommodating the new one. The default is to split the window in half.

This invokes Make Window Hook with the new window.

Function: windowp window

This function returns t if window is a window object, otherwise nil.

Hemlock Variable: Delete Window Hook
Function: delete-window window

delete-window makes window go away, first invoking Delete Window Hook with window.

Hemlock Variable: Window Buffer Hook
Function: window-buffer window

window-buffer returns the buffer from which the window displays text. This may be changed with setf, in which case the hook Window Buffer Hook is invoked beforehand with the window and the new buffer.

Function: window-display-start window
Function: window-display-end window

window-display-start returns the mark that points before the first character displayed in window. Note that if window is the current window, then moving the start may not prove much, since recentering may move it back to approximately where it was originally.

window-display-end is similar, but points after the last character displayed. Moving the end is meaningless, since redisplay always moves it to after the last character.

Function: window-display-recentering window

This function returns whether redisplay will ensure the buffer’s point of window’s buffer is visible after redisplay. This is setf’able, and changing window’s buffer sets this to nil via Window Buffer Hook.

Function: window-point window

This function returns as a mark the position in the buffer where the cursor is displayed. This may be set with setf. If window is the current window, then setting the point will have little effect; it is forced to track the buffer point. When the window is not current, the window point is the position that the buffer point will be moved to when the window becomes current.

Function: center-window window mark

This function attempts to adjust window’s display start so the that mark is vertically centered within the window.

Function: scroll-window window n

This function scrolls the window down n display lines; if n is negative scroll up. Leave the cursor at the same text position unless we scroll it off the screen, in which case the cursor is moved to the end of the window closest to its old position.

Function: displayed-p mark window

Returns t if either the character before or the character after mark is being displayed in window, or nil otherwise.

Function: window-height window
Function: window-width window

Height or width of the area of the window used for displaying the buffer, in character positions. These values may be changed with setf, but the setting attempt may fail, in which case nothing is done.

Function: next-window window
Function: previous-window window

Return the next or previous window of window. The exact meaning of next and previous depends on the device displaying the window. It should be possible to cycle through all the windows displayed on a device using either next or previous (implying that these functions wrap around.)


Next: Cursor Positions, Previous: The Current Window, Up: Controlling the Display   [Contents][Index]