Mercurial > emacs
changeset 25369:7b65011c5136
(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.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Mon, 23 Aug 1999 00:11:39 +0000 |
parents | f9949db6ca7d |
children | 20d8158841b0 |
files | src/buffer.h |
diffstat | 1 files changed, 58 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/buffer.h Mon Aug 23 00:11:36 1999 +0000 +++ b/src/buffer.h Mon Aug 23 00:11:39 1999 +0000 @@ -157,6 +157,45 @@ /* Marker chain of buffer. */ #define BUF_MARKERS(buf) ((buf)->text->markers) + +#define BUF_UNCHANGED_MODIFIED(buf) \ + ((buf)->text->unchanged_modified) + +#define BUF_OVERLAY_UNCHANGED_MODIFIED(buf) \ + ((buf)->text->overlay_unchanged_modified) +#define BUF_BEG_UNCHANGED(buf) ((buf)->text->beg_unchanged) +#define BUF_END_UNCHANGED(buf) ((buf)->text->end_unchanged) + +#define UNCHANGED_MODIFIED \ + BUF_UNCHANGED_MODIFIED (current_buffer) +#define OVERLAY_UNCHANGED_MODIFIED \ + BUF_OVERLAY_UNCHANGED_MODIFIED (current_buffer) +#define BEG_UNCHANGED BUF_BEG_UNCHANGED (current_buffer) +#define END_UNCHANGED BUF_END_UNCHANGED (current_buffer) + +/* Compute how many characters at the top and bottom of BUF are + unchanged when the range START..END is modified. This computation + must be done each time BUF is modified. */ + +#define BUF_COMPUTE_UNCHANGED(buf, start, end) \ + do \ + { \ + if (BUF_UNCHANGED_MODIFIED (buf) == MODIFF \ + && BUF_OVERLAY_UNCHANGED_MODIFIED (buf) == OVERLAY_MODIFF) \ + { \ + BUF_BEG_UNCHANGED (buf) = (start) - BUF_BEG (buf); \ + BUF_END_UNCHANGED (buf) = BUF_Z (buf) - (end); \ + } \ + else \ + { \ + if (BUF_Z (buf) - (end) < BUF_END_UNCHANGED (buf)) \ + BUF_END_UNCHANGED (buf) = BUF_Z (buf) - (end); \ + if ((start) - BUF_BEG (buf) < BUF_BEG_UNCHANGED (buf)) \ + BUF_BEG_UNCHANGED (buf) = (start) - BUF_BEG (buf); \ + } \ + } \ + while (0) + /* Macros to set PT in the current buffer, or another buffer.. */ @@ -381,6 +420,21 @@ int overlay_modiff; /* Counts modifications to overlays. */ + /* Minimum value of GPT - BEG since last redisplay that finished. */ + int beg_unchanged; + + /* Minimum value of Z - GPT since last redisplay that finished. */ + int end_unchanged; + + /* MODIFF as of last redisplay that finished; if it matches MODIFF, + beg_unchanged and end_unchanged contain no useful information. */ + int unchanged_modified; + + /* BUF_OVERLAY_MODIFF of current buffer, as of last redisplay that + finished; if it matches BUF_OVERLAY_MODIFF, beg_unchanged and + end_unchanged contain no useful information. */ + int overlay_unchanged_modified; + /* Properties of this buffer's text -- conditionally compiled. */ DECLARE_INTERVALS @@ -474,6 +528,10 @@ struct region_cache *newline_cache; struct region_cache *width_run_cache; + /* Non-zero means don't use redisplay optimizations for + displaying this buffer. */ + unsigned prevent_redisplay_optimizations_p : 1; + /* Changes in the buffer are recorded here for undo. t means don't record anything. This information belongs to the base buffer of an indirect buffer,