Lugaru's Epsilon Programmer's Editor 14.04
Context:
|
Epsilon User's Manual and Reference > Primitives and EEL Subroutines > Display Primitives > Buffer Text in Windowsto_buffer(char *buf) /* buffer.e */ The to_buffer( ) subroutine defined in buffer.e connects the current window to the named buffer, while to_buffer_num( ) does the same, but takes a buffer number. Both work by setting the window_bufnum variable, first remembering the previous buffer displayed in the window so the user can easily return to it. The window_bufnum variable stores the buffer number of the buffer displayed in the current window. Both of these functions check the file date of the new buffer and warn the user if the buffer's file has been modified on disk. The switch_to_buffer( ) subroutine skips this checking.
The give_prev_buf( ) subroutine retrieves the saved buffer
number of the previous buffer displayed in the current window. If
the previous buffer has been deleted, or there is no previous buffer
for this window, it returns the number of another recently-used
buffer. If it can't find any suitable buffer, it returns
The to_another_buffer( ) subroutine makes sure that Sometimes the user may issue a command that switches buffers, while in a bufed pop-up window, or some other type of pop-up window. Issuing to_buffer( ) would switch the pop-up window to the new buffer, rather than the underlying window. Such commands should call the tiled_only( ) subroutine before switching buffers. This subroutine removes any bufed windows or other unwanted windows, and returns to the original tiled window. It calls the quit_bufed( ) subroutine to remove bufed windows. If it can't remove some pop-up windows, it tries to abort the command that created them. The quit_bufed( ) subroutine uses the in_bufed( ) subroutine to determine if the current window is a bufed window.
The window_end variable provides the buffer position of the last character displayed in the window. Epsilon's redisplay sets this variable. Setting it does nothing. The fix_window_start( ) subroutine adjusts window_start, if necessary, so that it occurs at the beginning of a line.
A return value of
The window_line_to_position( ) primitive takes the number of
a row in the current window, and returns the buffer position of the
first character displayed on that row. It returns
Some of the functions that return information about the text
displayed in a window only provide information as of the last
redisplay. Due to buffer changes, their information may now be
outdated. The build_window( ) primitive reconstructs the
current window internally, updating Epsilon's idea of which lines of
text go where in the window, how much will fit, and so forth. This
primitive updates the value of window_end. It may also modify
the display_column and window_start variables if displaying
the window as they indicate doesn't get to point. The
build_window( ) function also updates the values returned by
the
Use the window_to_fit( ) subroutine to ensure that a pop-up
window is no taller than it needs to be. It sets the window's height
so that it's just big enough to hold the buffer's text, but never
more than The popup_near_window( ) subroutine tries to move a pop-up window on the screen so it's near another window. It also adjusts the height of the pop-up window based on its contents, by calling window_to_fit( ). The bufed command uses this to position its pop-up buffer list near the tiled window from which you invoked it.
|