Next: Window Internals, Up: Object Internals
Two structures (see buffer.h) are used to represent buffers
in C. The buffer_text
structure contains fields describing the
text of a buffer; the buffer
structure holds other fields. In
the case of indirect buffers, two or more buffer
structures
reference the same buffer_text
structure.
Here are some of the fields in struct buffer_text
:
beg
char
, with the gap somewhere in its midst.
gpt
gpt_byte
z
z_byte
gap_size
modiff
save_modiff
chars_modiff
overlay_modiff
modiff
is incremented after each
buffer-modification event, and is never otherwise changed;
save_modiff
contains the value of modiff
the last time
the buffer was visited or saved; chars_modiff
counts only
modifications to the characters in the buffer, ignoring all other
kinds of changes (such as text properties); and overlay_modiff
counts only modifications to the buffer's overlays.
beg_unchanged
end_unchanged
unchanged_modified
overlay_unchanged_modified
modiff
and overlay_modiff
, respectively,
after the last complete redisplay. If their current values match
modiff
or overlay_modiff
, that means
beg_unchanged
and end_unchanged
contain no useful
information.
markers
chain
are the other
markers referring to this buffer text.
intervals
Some of the fields of struct buffer
are:
header
union vectorlike_header
is common to all
vectorlike objects.
own_text
struct buffer_text
structure that ordinarily holds the buffer
contents. In indirect buffers, this field is not used.
text
buffer_text
structure for this buffer. In an
ordinary buffer, this is the own_text
field above. In an
indirect buffer, this is the own_text
field of the base buffer.
next
pt
pt_byte
begv
begv_byte
zv
zv_byte
base_buffer
local_flags
DEFVAR_PER_BUFFER
, and their buffer-local bindings are stored
in fields in the buffer structure itself. (Some of these fields are
described in this table.)
modtime
auto_save_modified
last_window_start
window-start
position in the buffer as of the last time the
buffer was displayed in a window.
clip_changed
prevent_redisplay_optimizations_p
overlay_center
overlays_before
overlays_after
overlays_before
is sorted in order of decreasing end position,
and overlays_after
is sorted in order of increasing beginning
position.
name
_
to indicate that they
should not be accessed directly, but via the BVAR
macro, like
this:
Lisp_Object buf_name = BVAR (buffer, name);
save_length
buffer_text
structure
because indirect buffers are never saved.
directory
default-directory
(see File Name Expansion).
filename
nil
. This is
the value of the buffer-local variable buffer-file-name
(see Buffer File Name).
undo_list
backed_up
auto_save_file_name
auto_save_file_format
read_only
file_format
file_truename
invisibility_spec
display_count
display_time
buffer-
and have
underscores replaced with dashes. For instance, undo_list
stores the value of buffer-undo-list
.
mark
markers
. See The Mark.
local_var_alist
major_mode
lisp-mode
.
mode_name
"Lisp"
.
keymap
abbrev_table
syntax_table
category_table
display_table
downcase_table
upcase_table
case_canon_table
minor_modes
pt_marker
begv_marker
zv_marker
pt
, begv
, and zv
respectively, for this buffer
when the buffer is not current.
mode_line_format
header_line_format
case_fold_search
tab_width
fill_column
left_margin
auto_fill_function
truncate_lines
word_wrap
ctl_arrow
bidi_display_reordering
bidi_paragraph_direction
selective_display
selective_display_ellipses
overwrite_mode
abbrev_mode
mark_active
enable_multibyte_characters
buffer_file_coding_system
cache_long_line_scans
point_before_scroll
left_fringe_width
right_fringe_width
fringes_outside_margins
scroll_bar_width
indicate_empty_lines
indicate_buffer_boundaries
fringe_indicator_alist
fringe_cursor_alist
scroll_up_aggressively
scroll_down_aggressively
cursor_type
cursor_in_non_selected_windows
mode_line_format
stores the value of mode-line-format
.
last_selected_window
nil
if that window no longer displays this buffer.