- /* 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 */
- if (buffer_window_count (current_buffer))
- {
- update_mode_lines = 10;
- current_buffer->prevent_redisplay_optimizations_p = 1;
- }
-
- return flag;
-}
-
-DEFUN ("restore-buffer-modified-p", Frestore_buffer_modified_p,
- Srestore_buffer_modified_p, 1, 1, 0,
- doc: /* Like `set-buffer-modified-p', with a difference concerning redisplay.
-It is not ensured that mode lines will be updated to show the modified
-state of the current buffer. Use with care. */)
- (Lisp_Object flag)
-{
-#ifdef CLASH_DETECTION
- Lisp_Object fn;
-
- /* If buffer becoming modified, lock the file.
- If buffer becoming unmodified, unlock the file. */
-
- fn = BVAR (current_buffer, file_truename);
- /* Test buffer-file-name so that binding it to nil is effective. */
- if (!NILP (fn) && ! NILP (BVAR (current_buffer, filename)))
- {
- bool already = SAVE_MODIFF < MODIFF;
- if (!already && !NILP (flag))
- lock_file (fn);
- else if (already && NILP (flag))
- unlock_file (fn);
- }
-#endif /* CLASH_DETECTION */
-
- SAVE_MODIFF = NILP (flag) ? MODIFF : 0;