SXEmacs keeps a flag called the modified flag for each buffer, to
record whether you have changed the text of the buffer. This flag is
set to t whenever you alter the contents of the buffer, and
cleared to nil when you save it. Thus, the flag shows whether
there are unsaved changes. The flag value is normally shown in the
modeline (see Modeline Variables), and controls saving
(see Saving Buffers) and auto-saving (see Auto-Saving).
Some Lisp programs set the flag explicitly. For example, the function
set-visited-file-name sets the flag to t, because the text
does not match the newly-visited file, even if it is unchanged from the
file formerly visited.
The functions that modify the contents of buffers are described in Text.
This function returns
tif the buffer buffer has been modified since it was last read in from a file or saved, ornilotherwise. If buffer is not supplied, the current buffer is tested.
This function marks buffer as modified if flag is non-
nil, or as unmodified if the flag isnil. buffer defaults to the current buffer.Another effect of calling this function is to cause unconditional redisplay of the modeline for the current buffer. In fact, the function
redraw-modelineworks by doing this:(set-buffer-modified-p (buffer-modified-p))
This command marks the current buffer as unmodified, and not needing to be saved. (If arg is non-
nil, the buffer is instead marked as modified.) Don't use this function in programs, since it prints a message in the echo area; useset-buffer-modified-p(above) instead.