diff options
| author | Gregory Heytings | 2022-07-22 10:03:13 +0000 |
|---|---|---|
| committer | Gregory Heytings | 2022-07-22 12:06:31 +0200 |
| commit | 874e2525035d45efa6fa374a2ebec3740ecc1457 (patch) | |
| tree | 059221aee889a88f558802014c5680017eaec1d0 /src/dispextern.h | |
| parent | 616da8fa8efa9023f56fa731072d877e2150afbc (diff) | |
| download | emacs-874e2525035d45efa6fa374a2ebec3740ecc1457.tar.gz emacs-874e2525035d45efa6fa374a2ebec3740ecc1457.zip | |
Improve font locking in buffers with long lines (bug#56682).
* src/dispextern.h (struct it): New 'narrowed_zv' field.
* src/xdisp.c (init_iterator): Set the field.
(get_narrowed_zv): New function to set the field.
(handle_fontified_prop): Use the field, together with 'narrowed_begv',
to narrow the portion of the buffer that 'Vfontification_functions'
will see. Also bind 'inhibit-widen'.
(get_narrowed_len): New function, factored out of 'get_narrowed_begv'.
(unwind_narrowed_zv): New function.
* src/editfns.c (syms_of_editfns): New variable and symbol 'inhibit-widen'.
(Fwiden): Do nothing when 'inhibit-widen' is non-nil.
Diffstat (limited to 'src/dispextern.h')
| -rw-r--r-- | src/dispextern.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dispextern.h b/src/dispextern.h index 1cdfdca74c0..bafa98161d0 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -2336,6 +2336,10 @@ struct it | |||
| 2336 | optimize display (see the SET_WITH_NARROWED_BEGV macro). */ | 2336 | optimize display (see the SET_WITH_NARROWED_BEGV macro). */ |
| 2337 | ptrdiff_t narrowed_begv; | 2337 | ptrdiff_t narrowed_begv; |
| 2338 | 2338 | ||
| 2339 | /* Alternate end position of the buffer that may be used to | ||
| 2340 | optimize display. */ | ||
| 2341 | ptrdiff_t narrowed_zv; | ||
| 2342 | |||
| 2339 | /* C string to iterate over. Non-null means get characters from | 2343 | /* C string to iterate over. Non-null means get characters from |
| 2340 | this string, otherwise characters are read from current_buffer | 2344 | this string, otherwise characters are read from current_buffer |
| 2341 | or it->string. */ | 2345 | or it->string. */ |
| @@ -3401,6 +3405,7 @@ void redisplay_preserve_echo_area (int); | |||
| 3401 | void init_iterator (struct it *, struct window *, ptrdiff_t, | 3405 | void init_iterator (struct it *, struct window *, ptrdiff_t, |
| 3402 | ptrdiff_t, struct glyph_row *, enum face_id); | 3406 | ptrdiff_t, struct glyph_row *, enum face_id); |
| 3403 | ptrdiff_t get_narrowed_begv (struct window *w); | 3407 | ptrdiff_t get_narrowed_begv (struct window *w); |
| 3408 | ptrdiff_t get_narrowed_zv (struct window *w); | ||
| 3404 | void init_iterator_to_row_start (struct it *, struct window *, | 3409 | void init_iterator_to_row_start (struct it *, struct window *, |
| 3405 | struct glyph_row *); | 3410 | struct glyph_row *); |
| 3406 | void start_display (struct it *, struct window *, struct text_pos); | 3411 | void start_display (struct it *, struct window *, struct text_pos); |