diff options
author | Gerd Moellmann <gerd@gnu.org> | 2000-03-20 12:24:57 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2000-03-20 12:24:57 +0000 |
commit | 8ec01c70fa334531d0c0f634433f3b8bf1ccb450 (patch) | |
tree | 1ecd3e772b9b1caf42ad3dce608a86545d0f1bd3 /src/buffer.c | |
parent | 15e26c76c968d85f2f27ea899d3cadc28a1e10c6 (diff) | |
download | emacs-8ec01c70fa334531d0c0f634433f3b8bf1ccb450.tar.gz |
(Fset_buffer_modified_p): Set update_mode_lines
only if buffer is displayed in some window.
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c index 59487962008..878a81c47c7 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -806,6 +806,7 @@ A non-nil FLAG means mark the buffer modified.") { register int already; register Lisp_Object fn; + Lisp_Object buffer, window; #ifdef CLASH_DETECTION /* If buffer becoming modified, lock the file. @@ -824,7 +825,23 @@ A non-nil FLAG means mark the buffer modified.") #endif /* CLASH_DETECTION */ SAVE_MODIFF = NILP (flag) ? MODIFF : 0; - update_mode_lines++; + + /* Set update_mode_lines only if buffer is displayed in some window. + Packages like jit-lock or lazy-lock preserve a buffer's modified + state by recording/restoring the state around blocks of code. + Setting update_mode_lines makes redisplay consider all windows + (on all frames). Stealth fontification of buffers not displayed + would incur additional redisplay costs if we'd set + update_modes_lines unconditionally. + + Ideally, I think there should be another mechanism for fontifying + buffers without "modifying" buffers, or redisplay should be + smarter about updating the `*' in mode lines. --gerd */ + XSETBUFFER (buffer, current_buffer); + window = Fget_buffer_window (buffer, Qt); + if (WINDOWP (window)) + update_mode_lines++; + return flag; } |