diff options
| author | Gerd Moellmann | 1999-08-23 00:11:39 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 1999-08-23 00:11:39 +0000 |
| commit | 133a3962c9e5a67590dfa179e46307360e29d06e (patch) | |
| tree | 947c508000d04bbc2965a7ea38ce4416f7f587ad /src/buffer.h | |
| parent | b5a225b4949590401fd8a0b9c4d4117ad33e691d (diff) | |
| download | emacs-133a3962c9e5a67590dfa179e46307360e29d06e.tar.gz emacs-133a3962c9e5a67590dfa179e46307360e29d06e.zip | |
(BUF_COMPUTE_UNCHANGED): New.
(struct buffer): Add prevent_redisplay_optimizations_p.
(BUF_UNCHANGED_MODIFIED, UNCHANGED_MODIFIED,
BUF_OVERLAY_UNCHANGED_MODIFIED, OVERLAY_UNCHANGED_MODIFIED,
BUF_BEG_UNCHANGED, BEG_UNCHANGED, BUF_END_UNCHANGED,
END_UNCHANGED): New.
(struct buffer_text): Add beg_unchanged, end_unchanged,
unchanged_modified, overlay_unchanged_modified.
Diffstat (limited to 'src/buffer.h')
| -rw-r--r-- | src/buffer.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h index 99a1f60a296..eab6d79aef9 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -157,6 +157,45 @@ Boston, MA 02111-1307, USA. */ | |||
| 157 | 157 | ||
| 158 | /* Marker chain of buffer. */ | 158 | /* Marker chain of buffer. */ |
| 159 | #define BUF_MARKERS(buf) ((buf)->text->markers) | 159 | #define BUF_MARKERS(buf) ((buf)->text->markers) |
| 160 | |||
| 161 | #define BUF_UNCHANGED_MODIFIED(buf) \ | ||
| 162 | ((buf)->text->unchanged_modified) | ||
| 163 | |||
| 164 | #define BUF_OVERLAY_UNCHANGED_MODIFIED(buf) \ | ||
| 165 | ((buf)->text->overlay_unchanged_modified) | ||
| 166 | #define BUF_BEG_UNCHANGED(buf) ((buf)->text->beg_unchanged) | ||
| 167 | #define BUF_END_UNCHANGED(buf) ((buf)->text->end_unchanged) | ||
| 168 | |||
| 169 | #define UNCHANGED_MODIFIED \ | ||
| 170 | BUF_UNCHANGED_MODIFIED (current_buffer) | ||
| 171 | #define OVERLAY_UNCHANGED_MODIFIED \ | ||
| 172 | BUF_OVERLAY_UNCHANGED_MODIFIED (current_buffer) | ||
| 173 | #define BEG_UNCHANGED BUF_BEG_UNCHANGED (current_buffer) | ||
| 174 | #define END_UNCHANGED BUF_END_UNCHANGED (current_buffer) | ||
| 175 | |||
| 176 | /* Compute how many characters at the top and bottom of BUF are | ||
| 177 | unchanged when the range START..END is modified. This computation | ||
| 178 | must be done each time BUF is modified. */ | ||
| 179 | |||
| 180 | #define BUF_COMPUTE_UNCHANGED(buf, start, end) \ | ||
| 181 | do \ | ||
| 182 | { \ | ||
| 183 | if (BUF_UNCHANGED_MODIFIED (buf) == MODIFF \ | ||
| 184 | && BUF_OVERLAY_UNCHANGED_MODIFIED (buf) == OVERLAY_MODIFF) \ | ||
| 185 | { \ | ||
| 186 | BUF_BEG_UNCHANGED (buf) = (start) - BUF_BEG (buf); \ | ||
| 187 | BUF_END_UNCHANGED (buf) = BUF_Z (buf) - (end); \ | ||
| 188 | } \ | ||
| 189 | else \ | ||
| 190 | { \ | ||
| 191 | if (BUF_Z (buf) - (end) < BUF_END_UNCHANGED (buf)) \ | ||
| 192 | BUF_END_UNCHANGED (buf) = BUF_Z (buf) - (end); \ | ||
| 193 | if ((start) - BUF_BEG (buf) < BUF_BEG_UNCHANGED (buf)) \ | ||
| 194 | BUF_BEG_UNCHANGED (buf) = (start) - BUF_BEG (buf); \ | ||
| 195 | } \ | ||
| 196 | } \ | ||
| 197 | while (0) | ||
| 198 | |||
| 160 | 199 | ||
| 161 | /* Macros to set PT in the current buffer, or another buffer.. */ | 200 | /* Macros to set PT in the current buffer, or another buffer.. */ |
| 162 | 201 | ||
| @@ -381,6 +420,21 @@ struct buffer_text | |||
| 381 | 420 | ||
| 382 | int overlay_modiff; /* Counts modifications to overlays. */ | 421 | int overlay_modiff; /* Counts modifications to overlays. */ |
| 383 | 422 | ||
| 423 | /* Minimum value of GPT - BEG since last redisplay that finished. */ | ||
| 424 | int beg_unchanged; | ||
| 425 | |||
| 426 | /* Minimum value of Z - GPT since last redisplay that finished. */ | ||
| 427 | int end_unchanged; | ||
| 428 | |||
| 429 | /* MODIFF as of last redisplay that finished; if it matches MODIFF, | ||
| 430 | beg_unchanged and end_unchanged contain no useful information. */ | ||
| 431 | int unchanged_modified; | ||
| 432 | |||
| 433 | /* BUF_OVERLAY_MODIFF of current buffer, as of last redisplay that | ||
| 434 | finished; if it matches BUF_OVERLAY_MODIFF, beg_unchanged and | ||
| 435 | end_unchanged contain no useful information. */ | ||
| 436 | int overlay_unchanged_modified; | ||
| 437 | |||
| 384 | /* Properties of this buffer's text -- conditionally compiled. */ | 438 | /* Properties of this buffer's text -- conditionally compiled. */ |
| 385 | DECLARE_INTERVALS | 439 | DECLARE_INTERVALS |
| 386 | 440 | ||
| @@ -474,6 +528,10 @@ struct buffer | |||
| 474 | struct region_cache *newline_cache; | 528 | struct region_cache *newline_cache; |
| 475 | struct region_cache *width_run_cache; | 529 | struct region_cache *width_run_cache; |
| 476 | 530 | ||
| 531 | /* Non-zero means don't use redisplay optimizations for | ||
| 532 | displaying this buffer. */ | ||
| 533 | unsigned prevent_redisplay_optimizations_p : 1; | ||
| 534 | |||
| 477 | /* Changes in the buffer are recorded here for undo. | 535 | /* Changes in the buffer are recorded here for undo. |
| 478 | t means don't record anything. | 536 | t means don't record anything. |
| 479 | This information belongs to the base buffer of an indirect buffer, | 537 | This information belongs to the base buffer of an indirect buffer, |