Mercurial > emacs
comparison src/buffer.c @ 28207:fd3ece8a61e5
(Fset_buffer_modified_p): Set update_mode_lines
only if buffer is displayed in some window.
| author | Gerd Moellmann <gerd@gnu.org> |
|---|---|
| date | Mon, 20 Mar 2000 12:24:57 +0000 |
| parents | e272d652619a |
| children | c46e609d887a |
comparison
equal
deleted
inserted
replaced
| 28206:07ac059dece0 | 28207:fd3ece8a61e5 |
|---|---|
| 804 (flag) | 804 (flag) |
| 805 register Lisp_Object flag; | 805 register Lisp_Object flag; |
| 806 { | 806 { |
| 807 register int already; | 807 register int already; |
| 808 register Lisp_Object fn; | 808 register Lisp_Object fn; |
| 809 Lisp_Object buffer, window; | |
| 809 | 810 |
| 810 #ifdef CLASH_DETECTION | 811 #ifdef CLASH_DETECTION |
| 811 /* If buffer becoming modified, lock the file. | 812 /* If buffer becoming modified, lock the file. |
| 812 If buffer becoming unmodified, unlock the file. */ | 813 If buffer becoming unmodified, unlock the file. */ |
| 813 | 814 |
| 822 unlock_file (fn); | 823 unlock_file (fn); |
| 823 } | 824 } |
| 824 #endif /* CLASH_DETECTION */ | 825 #endif /* CLASH_DETECTION */ |
| 825 | 826 |
| 826 SAVE_MODIFF = NILP (flag) ? MODIFF : 0; | 827 SAVE_MODIFF = NILP (flag) ? MODIFF : 0; |
| 827 update_mode_lines++; | 828 |
| 829 /* Set update_mode_lines only if buffer is displayed in some window. | |
| 830 Packages like jit-lock or lazy-lock preserve a buffer's modified | |
| 831 state by recording/restoring the state around blocks of code. | |
| 832 Setting update_mode_lines makes redisplay consider all windows | |
| 833 (on all frames). Stealth fontification of buffers not displayed | |
| 834 would incur additional redisplay costs if we'd set | |
| 835 update_modes_lines unconditionally. | |
| 836 | |
| 837 Ideally, I think there should be another mechanism for fontifying | |
| 838 buffers without "modifying" buffers, or redisplay should be | |
| 839 smarter about updating the `*' in mode lines. --gerd */ | |
| 840 XSETBUFFER (buffer, current_buffer); | |
| 841 window = Fget_buffer_window (buffer, Qt); | |
| 842 if (WINDOWP (window)) | |
| 843 update_mode_lines++; | |
| 844 | |
| 828 return flag; | 845 return flag; |
| 829 } | 846 } |
| 830 | 847 |
| 831 DEFUN ("buffer-modified-tick", Fbuffer_modified_tick, Sbuffer_modified_tick, | 848 DEFUN ("buffer-modified-tick", Fbuffer_modified_tick, Sbuffer_modified_tick, |
| 832 0, 1, 0, | 849 0, 1, 0, |
