Two structures 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:
beggptgpt_bytezz_bytegap_sizemodiffsave_modiffchars_modiffoverlay_modiffmodiff 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; and overlay_modiff counts only modifications
to the overlays.
beg_unchangedend_unchangedunchanged_modifiedoverlay_unchanged_modifiedmodiff and overlay_modiff, respectively,
after the last compelete redisplay. If their current values match
modiff or overlay_modiff, that means
beg_unchanged and end_unchanged contain no useful
information.
markerschain are the other
markers referring to this buffer text.
intervalsSome of the fields of struct buffer are:
nextown_textstruct buffer_text structure that ordinarily holds the buffer
contents. In indirect buffers, this field is not used.
textbuffer_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.
ptpt_bytebegvbegv_bytezvzv_bytebase_bufferlocal_flagsDEFVAR_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.)
modtimeauto_save_modifiedlast_window_startwindow-start position in the buffer as of the last time the
buffer was displayed in a window.
clip_changedprevent_redisplay_optimizations_poverlay_centeroverlays_beforeoverlays_afteroverlays_before is sorted in order of decreasing end position,
and overlays_after is sorted in order of increasing beginning
position.
namesave_lengthbuffer_text structure because indirect buffers are never
saved.
directorydefault-directory (see File Name Expansion).
filenamenil. This is
the value of the buffer-local variable buffer-file-name
(see Buffer File Name).
undo_listbacked_upauto_save_file_nameread_onlyfile_formatfile_truenameinvisibility_specdisplay_countdisplay_timebuffer- and have
underscores replaced with dashes. For instance, undo_list
stores the value of buffer-undo-list. See Standard Buffer-Local Variables.
markmarkers. See The Mark.
local_var_alistmajor_modelisp-mode.
mode_name"Lisp".
keymapabbrev_tablesyntax_tablecategory_tabledisplay_tabledowncase_tableupcase_tablecase_canon_tableminor_modespt_markerbegv_markerzv_markerpt, begv, and zv respectively, for this buffer
when the buffer is not current.
mode_line_formatheader_line_formatcase_fold_searchtab_widthfill_columnleft_marginauto_fill_functiontruncate_linesword_wrapctl_arrowselective_displayselective_display_ellipsesoverwrite_modeabbrev_modedisplay_tablemark_activeenable_multibyte_charactersbuffer_file_coding_systemauto_save_file_formatcache_long_line_scanspoint_before_scrollleft_fringe_widthright_fringe_widthfringes_outside_marginsscroll_bar_widthindicate_empty_linesindicate_buffer_boundariesfringe_indicator_alistfringe_cursor_alistscroll_up_aggressivelyscroll_down_aggressivelycursor_typecursor_in_non_selected_windowsmode_line_format stores the value of mode-line-format.
See Standard Buffer-Local Variables.
last_selected_windownil
if that window no longer displays this buffer.