Variable: buffer-saved-size
buffer-saved-size is a buffer-local variable defined in buffer.c.
Documentation
Length of current buffer when last read in, saved or auto-saved.
0 initially.
-1 means auto-saving turned off until next real save.
If you set this to -2, that means don't turn off auto-saving in this buffer
if its text size shrinks. If you use buffer-swap-text on a buffer,
you probably should set this to -2 in that buffer.
Source Code
// Defined in /usr/src/emacs/src/buffer.c
DEFVAR_PER_BUFFER ("buffer-saved-size", &BVAR (current_buffer, save_length),
Qintegerp,
doc: /* Length of current buffer when last read in, saved or auto-saved.
0 initially.
-1 means auto-saving turned off until next real save.
If you set this to -2, that means don't turn off auto-saving in this buffer
if its text size shrinks. If you use `buffer-swap-text' on a buffer,
you probably should set this to -2 in that buffer. */);