The create( ) primitive makes a new buffer. It takes the name of the buffer to create. If the buffer already exists, nothing happens. In either case, it returns the buffer number of the buffer.
Some primitives let you specify a buffer by
name; others let you specify a buffer by number. Epsilon tries never
to reuse buffer numbers, so EEL functions can look a buffer up by its
buffer number to see if a particular buffer still exists. Functions
that accept a buffer number generally start with
Use the bufnum_to_name( ) primitive to convert from a buffer number to the buffer's name. If no such buffer exists, it returns a null pointer. The name_to_bufnum( ) primitive takes a buffer name, and gives you the corresponding buffer number. If no such buffer exists, it returns zero.
The zap( ) primitive creates a buffer if necessary, but empties it of all characters if the buffer already exists. So calling zap( ) always results in an empty buffer. The zap( ) primitive returns the buffer number of the buffer, whether or not it needed to create the buffer. The buf_zap( ) primitive works like zap( ), except the former takes a buffer number instead of a buffer name, and signals an error if no buffer with that number exists. Unlike zap( ), buf_zap( ) cannot create a buffer. Neither primitive switches to the emptied buffer.
The change_buffer_name( ) primitive renames the current buffer
to the indicated name. If there is already a buffer with the new
name, the primitive returns
The delete_buffer( ) primitive removes a buffer with a given name. It also removes all windows associated with the buffer. The buf_delete( ) primitive does the same thing, but takes a buffer number. Epsilon signals an error if the buffer does not exist, if it contains a running process, or if one of the buffer's windows could not be deleted. If the buffer might have syntax highlighting in it, use the delete_user_buffer( ) subroutine instead; it cleans up some data needed by syntax highlighting.
The drop_buffer( ) subroutine deletes the buffer, but queries the user first like the kill-buffer command if the buffer contains unsaved changes.
The EEL subroutine temp_buf( ), defined in basic.e, uses the exist( ) primitive to create an unused name for a temporary buffer. It returns the name of the empty buffer it creates. The tmp_buf( ) subroutine creates a temporary buffer like temp_buf( ), but returns its number instead of its name.
To set the bufname variable, use the syntax