diff options
| author | Richard M. Stallman | 1995-01-02 06:33:09 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-01-02 06:33:09 +0000 |
| commit | 42640f8319f50c4f7656b93cdf0817f16722d3dd (patch) | |
| tree | 0350abf9cc4082b3e735513351e79cfd00b72fbf /src | |
| parent | c6367666aef7459ec683d0f49fd063a615f8f79c (diff) | |
| download | emacs-42640f8319f50c4f7656b93cdf0817f16722d3dd.tar.gz emacs-42640f8319f50c4f7656b93cdf0817f16722d3dd.zip | |
Use SAVE_MODIFF and BUF_SAVE_MODIFF
instead of direct access to the save_modiff field.
(redisplay_window): Call set_buffer_temp.
(redisplay_window): For buffer_shared count,
treat an indirect buffer as equivalent to its base.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 6dc5f1811d5..1b2324c1320 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -122,7 +122,8 @@ int scroll_step; | |||
| 122 | since the last redisplay that paused */ | 122 | since the last redisplay that paused */ |
| 123 | static int blank_end_of_window; | 123 | static int blank_end_of_window; |
| 124 | 124 | ||
| 125 | /* Number of windows showing the buffer of the selected window. | 125 | /* Number of windows showing the buffer of the selected window |
| 126 | (or another buffer with the same base buffer). | ||
| 126 | keyboard.c refers to this. */ | 127 | keyboard.c refers to this. */ |
| 127 | int buffer_shared; | 128 | int buffer_shared; |
| 128 | 129 | ||
| @@ -591,7 +592,7 @@ redisplay () | |||
| 591 | 592 | ||
| 592 | /* Detect case that we need to write a star in the mode line. */ | 593 | /* Detect case that we need to write a star in the mode line. */ |
| 593 | if (XFASTINT (w->last_modified) < MODIFF | 594 | if (XFASTINT (w->last_modified) < MODIFF |
| 594 | && XFASTINT (w->last_modified) <= current_buffer->save_modified) | 595 | && XFASTINT (w->last_modified) <= SAVE_MODIFF) |
| 595 | { | 596 | { |
| 596 | w->update_mode_line = Qt; | 597 | w->update_mode_line = Qt; |
| 597 | if (buffer_shared > 1) | 598 | if (buffer_shared > 1) |
| @@ -1015,7 +1016,7 @@ update_menu_bar (f) | |||
| 1015 | || !NILP (w->update_mode_line) | 1016 | || !NILP (w->update_mode_line) |
| 1016 | || (XFASTINT (w->last_modified) < MODIFF | 1017 | || (XFASTINT (w->last_modified) < MODIFF |
| 1017 | && (XFASTINT (w->last_modified) | 1018 | && (XFASTINT (w->last_modified) |
| 1018 | <= XBUFFER (w->buffer)->save_modified))) | 1019 | <= BUF_SAVE_MODIFF (XBUFFER (w->buffer))))) |
| 1019 | { | 1020 | { |
| 1020 | struct buffer *prev = current_buffer; | 1021 | struct buffer *prev = current_buffer; |
| 1021 | call1 (Vrun_hooks, Qmenu_bar_update_hook); | 1022 | call1 (Vrun_hooks, Qmenu_bar_update_hook); |
| @@ -1110,14 +1111,24 @@ redisplay_window (window, just_this_one) | |||
| 1110 | 1111 | ||
| 1111 | /* Otherwise set up data on this window; select its buffer and point value */ | 1112 | /* Otherwise set up data on this window; select its buffer and point value */ |
| 1112 | 1113 | ||
| 1113 | current_buffer = XBUFFER (w->buffer); | 1114 | set_buffer_temp (XBUFFER (w->buffer)); |
| 1114 | opoint = PT; | 1115 | opoint = PT; |
| 1115 | 1116 | ||
| 1116 | /* Count number of windows showing the selected buffer. */ | 1117 | /* Count number of windows showing the selected buffer. |
| 1118 | An indirect buffer counts as its base buffer. */ | ||
| 1117 | 1119 | ||
| 1118 | if (!just_this_one | 1120 | if (!just_this_one) |
| 1119 | && current_buffer == XBUFFER (XWINDOW (selected_window)->buffer)) | 1121 | { |
| 1120 | buffer_shared++; | 1122 | struct buffer *current_base, *window_base; |
| 1123 | current_base = current_buffer; | ||
| 1124 | window_base = XBUFFER (XWINDOW (selected_window)->buffer); | ||
| 1125 | if (current_base->base_buffer) | ||
| 1126 | current_base = current_base->base_buffer; | ||
| 1127 | if (window_base->base_buffer) | ||
| 1128 | window_base = window_base->base_buffer; | ||
| 1129 | if (current_base == window_base) | ||
| 1130 | buffer_shared++; | ||
| 1131 | } | ||
| 1121 | 1132 | ||
| 1122 | /* POINT refers normally to the selected window. | 1133 | /* POINT refers normally to the selected window. |
| 1123 | For any other window, set up appropriate value. */ | 1134 | For any other window, set up appropriate value. */ |
| @@ -1415,7 +1426,7 @@ done: | |||
| 1415 | } | 1426 | } |
| 1416 | 1427 | ||
| 1417 | BUF_PT (current_buffer) = opoint; | 1428 | BUF_PT (current_buffer) = opoint; |
| 1418 | current_buffer = old; | 1429 | set_buffer_temp (old); |
| 1419 | BUF_PT (current_buffer) = lpoint; | 1430 | BUF_PT (current_buffer) = lpoint; |
| 1420 | } | 1431 | } |
| 1421 | 1432 | ||
| @@ -1932,9 +1943,9 @@ redisplay_region (buf, start, end) | |||
| 1932 | } | 1943 | } |
| 1933 | 1944 | ||
| 1934 | /* Increment the buffer's time stamp, but also increment the save | 1945 | /* Increment the buffer's time stamp, but also increment the save |
| 1935 | and autosave timestamps, so as not to screw up that timekeeping. */ | 1946 | and autosave timestamps, so as not to screw up that timekeeping. */ |
| 1936 | if (BUF_MODIFF (buf) == buf->save_modified) | 1947 | if (BUF_MODIFF (buf) == BUF_SAVE_MODIFF (buf)) |
| 1937 | buf->save_modified++; | 1948 | BUF_SAVE_MODIFF (buf)++; |
| 1938 | if (BUF_MODIFF (buf) == buf->auto_save_modified) | 1949 | if (BUF_MODIFF (buf) == buf->auto_save_modified) |
| 1939 | buf->auto_save_modified++; | 1950 | buf->auto_save_modified++; |
| 1940 | 1951 | ||
| @@ -3131,13 +3142,13 @@ decode_mode_spec (w, c, maxwidth) | |||
| 3131 | case '*': | 3142 | case '*': |
| 3132 | if (!NILP (b->read_only)) | 3143 | if (!NILP (b->read_only)) |
| 3133 | return "%"; | 3144 | return "%"; |
| 3134 | if (BUF_MODIFF (b) > b->save_modified) | 3145 | if (BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) |
| 3135 | return "*"; | 3146 | return "*"; |
| 3136 | return "-"; | 3147 | return "-"; |
| 3137 | 3148 | ||
| 3138 | case '+': | 3149 | case '+': |
| 3139 | /* This differs from %* only for a modified read-only buffer. */ | 3150 | /* This differs from %* only for a modified read-only buffer. */ |
| 3140 | if (BUF_MODIFF (b) > b->save_modified) | 3151 | if (BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) |
| 3141 | return "*"; | 3152 | return "*"; |
| 3142 | if (!NILP (b->read_only)) | 3153 | if (!NILP (b->read_only)) |
| 3143 | return "%"; | 3154 | return "%"; |
| @@ -3145,7 +3156,7 @@ decode_mode_spec (w, c, maxwidth) | |||
| 3145 | 3156 | ||
| 3146 | case '&': | 3157 | case '&': |
| 3147 | /* This differs from %* in ignoring read-only-ness. */ | 3158 | /* This differs from %* in ignoring read-only-ness. */ |
| 3148 | if (BUF_MODIFF (b) > b->save_modified) | 3159 | if (BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) |
| 3149 | return "*"; | 3160 | return "*"; |
| 3150 | return "-"; | 3161 | return "-"; |
| 3151 | 3162 | ||