1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-20 18:17:20 +00:00

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.
This commit is contained in:
Noam Postavsky 2015-11-21 17:02:42 -05:00
parent cfd2b9eae1
commit d3faef9bae
4 changed files with 10 additions and 17 deletions

View File

@ -2249,9 +2249,8 @@ See also `toggle-frame-maximized'."
'window-system-version "it does not give useful information." "24.3")
;; Variables which should trigger redisplay of the current buffer.
(setq redisplay--variables (make-hash-table :test 'eq :size 10))
(mapc (lambda (var)
(puthash var 1 redisplay--variables))
(add-variable-watcher var (symbol-function 'set-buffer-redisplay)))
'(line-spacing
overline-margin
line-prefix

View File

@ -1275,8 +1275,6 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where,
default: emacs_abort ();
}
maybe_set_redisplay (symbol);
start:
switch (sym->redirect)
{

View File

@ -1063,7 +1063,6 @@ extern void wset_redisplay (struct window *w);
extern void fset_redisplay (struct frame *f);
extern void bset_redisplay (struct buffer *b);
extern void bset_update_mode_line (struct buffer *b);
extern void maybe_set_redisplay (Lisp_Object);
/* Call this to tell redisplay to look for other windows than selected-window
that need to be redisplayed. Calling one of the *set_redisplay functions
above already does it, so it's only needed in unusual cases. */

View File

@ -622,15 +622,15 @@ bset_update_mode_line (struct buffer *b)
b->text->redisplay = true;
}
void
maybe_set_redisplay (Lisp_Object symbol)
DEFUN ("set-buffer-redisplay", Fset_buffer_redisplay,
Sset_buffer_redisplay, 4, 4, 0,
doc: /* Mark the current buffer for redisplay.
This function may be passed to `add-variable-watcher'. */)
(Lisp_Object symbol, Lisp_Object newval, Lisp_Object op, Lisp_Object where)
{
if (HASH_TABLE_P (Vredisplay__variables)
&& hash_lookup (XHASH_TABLE (Vredisplay__variables), symbol, NULL) >= 0)
{
bset_update_mode_line (current_buffer);
current_buffer->prevent_redisplay_optimizations_p = true;
}
bset_update_mode_line (current_buffer);
current_buffer->prevent_redisplay_optimizations_p = true;
return Qnil;
}
#ifdef GLYPH_DEBUG
@ -31322,6 +31322,7 @@ They are still logged to the *Messages* buffer. */);
message_dolog_marker3 = Fmake_marker ();
staticpro (&message_dolog_marker3);
defsubr (&Sset_buffer_redisplay);
#ifdef GLYPH_DEBUG
defsubr (&Sdump_frame_glyph_matrix);
defsubr (&Sdump_glyph_matrix);
@ -31991,10 +31992,6 @@ display table takes effect; in this case, Emacs does not consult
doc: /* */);
Vredisplay__mode_lines_cause = Fmake_hash_table (0, NULL);
DEFVAR_LISP ("redisplay--variables", Vredisplay__variables,
doc: /* A hash-table of variables changing which triggers a thorough redisplay. */);
Vredisplay__variables = Qnil;
DEFVAR_BOOL ("redisplay--inhibit-bidi", redisplay__inhibit_bidi,
doc: /* Non-nil means it is not safe to attempt bidi reordering for display. */);
/* Initialize to t, since we need to disable reordering until