aboutsummaryrefslogtreecommitdiffstats
path: root/src/font.c
diff options
context:
space:
mode:
authorNoam Postavsky2015-11-19 19:50:06 -0500
committerNoam Postavsky2016-12-02 20:25:14 -0500
commit227213164e06363f0a4fb2beeeb647c99749299e (patch)
tree8fda48112af0631ce9b6c595e33101a9b5961909 /src/font.c
parent0fc4761ca88175c30da7209c9ab1cde788b66a76 (diff)
downloademacs-227213164e06363f0a4fb2beeeb647c99749299e.tar.gz
emacs-227213164e06363f0a4fb2beeeb647c99749299e.zip
Add lisp watchpoints
This allows calling a function whenever a symbol-value is changed. * src/lisp.h (lisp_h_SYMBOL_TRAPPED_WRITE_P): (SYMBOL_TRAPPED_WRITE_P): New function/macro. (lisp_h_SYMBOL_CONSTANT_P): Check for SYMBOL_NOWRITE specifically. (enum symbol_trapped_write): New enumeration. (struct Lisp_Symbol): Rename field constant to trapped_write. (make_symbol_constant): New function. * src/data.c (Fadd_variable_watcher, Fremove_variable_watcher): (set_symbol_trapped_write, restore_symbol_trapped_write): (harmonize_variable_watchers, notify_variable_watchers): New functions. * src/data.c (Fset_default): Call `notify_variable_watchers' for trapped symbols. (set_internal): Change bool argument BIND to 3-value enum and call `notify_variable_watchers' for trapped symbols. * src/data.c (syms_of_data): * src/data.c (syms_of_data): * src/font.c (syms_of_font): * src/lread.c (intern_sym, init_obarray): * src/buffer.c (syms_of_buffer): Use make_symbol_constant. * src/alloc.c (init_symbol): * src/bytecode.c (exec_byte_code): Use SYMBOL_TRAPPED_WRITE_P. * src/data.c (Fmake_variable_buffer_local, Fmake_local_variable): (Fmake_variable_frame_local): * src/eval.c (Fdefvaralias, specbind): Refer to Lisp_Symbol's trapped_write instead of constant. (Ffuncall): Move subr calling code into separate function. (funcall_subr): New function.
Diffstat (limited to 'src/font.c')
-rw-r--r--src/font.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/font.c b/src/font.c
index 9fe7c26ea9c..36e71669453 100644
--- a/src/font.c
+++ b/src/font.c
@@ -5415,19 +5415,19 @@ Each element has the form:
5415 [NUMERIC-VALUE SYMBOLIC-NAME ALIAS-NAME ...] 5415 [NUMERIC-VALUE SYMBOLIC-NAME ALIAS-NAME ...]
5416NUMERIC-VALUE is an integer, and SYMBOLIC-NAME and ALIAS-NAME are symbols. */); 5416NUMERIC-VALUE is an integer, and SYMBOLIC-NAME and ALIAS-NAME are symbols. */);
5417 Vfont_weight_table = BUILD_STYLE_TABLE (weight_table); 5417 Vfont_weight_table = BUILD_STYLE_TABLE (weight_table);
5418 XSYMBOL (intern_c_string ("font-weight-table"))->constant = 1; 5418 make_symbol_constant (intern_c_string ("font-weight-table"));
5419 5419
5420 DEFVAR_LISP_NOPRO ("font-slant-table", Vfont_slant_table, 5420 DEFVAR_LISP_NOPRO ("font-slant-table", Vfont_slant_table,
5421 doc: /* Vector of font slant symbols vs the corresponding numeric values. 5421 doc: /* Vector of font slant symbols vs the corresponding numeric values.
5422See `font-weight-table' for the format of the vector. */); 5422See `font-weight-table' for the format of the vector. */);
5423 Vfont_slant_table = BUILD_STYLE_TABLE (slant_table); 5423 Vfont_slant_table = BUILD_STYLE_TABLE (slant_table);
5424 XSYMBOL (intern_c_string ("font-slant-table"))->constant = 1; 5424 make_symbol_constant (intern_c_string ("font-slant-table"));
5425 5425
5426 DEFVAR_LISP_NOPRO ("font-width-table", Vfont_width_table, 5426 DEFVAR_LISP_NOPRO ("font-width-table", Vfont_width_table,
5427 doc: /* Alist of font width symbols vs the corresponding numeric values. 5427 doc: /* Alist of font width symbols vs the corresponding numeric values.
5428See `font-weight-table' for the format of the vector. */); 5428See `font-weight-table' for the format of the vector. */);
5429 Vfont_width_table = BUILD_STYLE_TABLE (width_table); 5429 Vfont_width_table = BUILD_STYLE_TABLE (width_table);
5430 XSYMBOL (intern_c_string ("font-width-table"))->constant = 1; 5430 make_symbol_constant (intern_c_string ("font-width-table"));
5431 5431
5432 staticpro (&font_style_table); 5432 staticpro (&font_style_table);
5433 font_style_table = make_uninit_vector (3); 5433 font_style_table = make_uninit_vector (3);