diff options
| author | Noam Postavsky | 2015-11-21 17:02:42 -0500 |
|---|---|---|
| committer | Noam Postavsky | 2016-12-02 20:25:15 -0500 |
| commit | d3faef9baedadc9eaec46814ba9bbe5168048328 (patch) | |
| tree | c6669ac6e10bf90e925472c50eda8cc57c793572 /src | |
| parent | cfd2b9eae17754c0e109961f2880f05012a4891d (diff) | |
| download | emacs-d3faef9baedadc9eaec46814ba9bbe5168048328.tar.gz emacs-d3faef9baedadc9eaec46814ba9bbe5168048328.zip | |
Ensure redisplay using variable watcher
This replaces looking up the variable name in redisplay--variables when
setting it.
* lisp/frame.el: Replace redisplay--variables with add-variable-watcher
calls.
* src/xdisp.c (Fset_buffer_redisplay): Rename from maybe_set_redisplay,
set the redisplay flag unconditionally.
(Vredisplay__variables): Remove it.
* src/data.c (set_internal): Remove maybe_set_redisplay call.
Diffstat (limited to 'src')
| -rw-r--r-- | src/data.c | 2 | ||||
| -rw-r--r-- | src/window.h | 1 | ||||
| -rw-r--r-- | src/xdisp.c | 23 |
3 files changed, 10 insertions, 16 deletions
diff --git a/src/data.c b/src/data.c index 095b740c1b2..81846b5dcbc 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -1275,8 +1275,6 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, | |||
| 1275 | default: emacs_abort (); | 1275 | default: emacs_abort (); |
| 1276 | } | 1276 | } |
| 1277 | 1277 | ||
| 1278 | maybe_set_redisplay (symbol); | ||
| 1279 | |||
| 1280 | start: | 1278 | start: |
| 1281 | switch (sym->redirect) | 1279 | switch (sym->redirect) |
| 1282 | { | 1280 | { |
diff --git a/src/window.h b/src/window.h index a124b3311d0..4a102f2246e 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -1063,7 +1063,6 @@ extern void wset_redisplay (struct window *w); | |||
| 1063 | extern void fset_redisplay (struct frame *f); | 1063 | extern void fset_redisplay (struct frame *f); |
| 1064 | extern void bset_redisplay (struct buffer *b); | 1064 | extern void bset_redisplay (struct buffer *b); |
| 1065 | extern void bset_update_mode_line (struct buffer *b); | 1065 | extern void bset_update_mode_line (struct buffer *b); |
| 1066 | extern void maybe_set_redisplay (Lisp_Object); | ||
| 1067 | /* Call this to tell redisplay to look for other windows than selected-window | 1066 | /* Call this to tell redisplay to look for other windows than selected-window |
| 1068 | that need to be redisplayed. Calling one of the *set_redisplay functions | 1067 | that need to be redisplayed. Calling one of the *set_redisplay functions |
| 1069 | above already does it, so it's only needed in unusual cases. */ | 1068 | above already does it, so it's only needed in unusual cases. */ |
diff --git a/src/xdisp.c b/src/xdisp.c index 2acdfa90b7a..ad0b9686f04 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -622,15 +622,15 @@ bset_update_mode_line (struct buffer *b) | |||
| 622 | b->text->redisplay = true; | 622 | b->text->redisplay = true; |
| 623 | } | 623 | } |
| 624 | 624 | ||
| 625 | void | 625 | DEFUN ("set-buffer-redisplay", Fset_buffer_redisplay, |
| 626 | maybe_set_redisplay (Lisp_Object symbol) | 626 | Sset_buffer_redisplay, 4, 4, 0, |
| 627 | { | 627 | doc: /* Mark the current buffer for redisplay. |
| 628 | if (HASH_TABLE_P (Vredisplay__variables) | 628 | This function may be passed to `add-variable-watcher'. */) |
| 629 | && hash_lookup (XHASH_TABLE (Vredisplay__variables), symbol, NULL) >= 0) | 629 | (Lisp_Object symbol, Lisp_Object newval, Lisp_Object op, Lisp_Object where) |
| 630 | { | 630 | { |
| 631 | bset_update_mode_line (current_buffer); | 631 | bset_update_mode_line (current_buffer); |
| 632 | current_buffer->prevent_redisplay_optimizations_p = true; | 632 | current_buffer->prevent_redisplay_optimizations_p = true; |
| 633 | } | 633 | return Qnil; |
| 634 | } | 634 | } |
| 635 | 635 | ||
| 636 | #ifdef GLYPH_DEBUG | 636 | #ifdef GLYPH_DEBUG |
| @@ -31322,6 +31322,7 @@ They are still logged to the *Messages* buffer. */); | |||
| 31322 | message_dolog_marker3 = Fmake_marker (); | 31322 | message_dolog_marker3 = Fmake_marker (); |
| 31323 | staticpro (&message_dolog_marker3); | 31323 | staticpro (&message_dolog_marker3); |
| 31324 | 31324 | ||
| 31325 | defsubr (&Sset_buffer_redisplay); | ||
| 31325 | #ifdef GLYPH_DEBUG | 31326 | #ifdef GLYPH_DEBUG |
| 31326 | defsubr (&Sdump_frame_glyph_matrix); | 31327 | defsubr (&Sdump_frame_glyph_matrix); |
| 31327 | defsubr (&Sdump_glyph_matrix); | 31328 | defsubr (&Sdump_glyph_matrix); |
| @@ -31991,10 +31992,6 @@ display table takes effect; in this case, Emacs does not consult | |||
| 31991 | doc: /* */); | 31992 | doc: /* */); |
| 31992 | Vredisplay__mode_lines_cause = Fmake_hash_table (0, NULL); | 31993 | Vredisplay__mode_lines_cause = Fmake_hash_table (0, NULL); |
| 31993 | 31994 | ||
| 31994 | DEFVAR_LISP ("redisplay--variables", Vredisplay__variables, | ||
| 31995 | doc: /* A hash-table of variables changing which triggers a thorough redisplay. */); | ||
| 31996 | Vredisplay__variables = Qnil; | ||
| 31997 | |||
| 31998 | DEFVAR_BOOL ("redisplay--inhibit-bidi", redisplay__inhibit_bidi, | 31995 | DEFVAR_BOOL ("redisplay--inhibit-bidi", redisplay__inhibit_bidi, |
| 31999 | doc: /* Non-nil means it is not safe to attempt bidi reordering for display. */); | 31996 | doc: /* Non-nil means it is not safe to attempt bidi reordering for display. */); |
| 32000 | /* Initialize to t, since we need to disable reordering until | 31997 | /* Initialize to t, since we need to disable reordering until |