'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
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. */
b->text->redisplay = true;
}
-void
-maybe_set_redisplay (Lisp_Object symbol)
-{
- 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;
- }
+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)
+{
+ bset_update_mode_line (current_buffer);
+ current_buffer->prevent_redisplay_optimizations_p = true;
+ return Qnil;
}
#ifdef GLYPH_DEBUG
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);
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