diff options
| author | Noam Postavsky | 2015-11-19 19:50:06 -0500 |
|---|---|---|
| committer | Noam Postavsky | 2016-12-02 20:25:14 -0500 |
| commit | 227213164e06363f0a4fb2beeeb647c99749299e (patch) | |
| tree | 8fda48112af0631ce9b6c595e33101a9b5961909 /src/alloc.c | |
| parent | 0fc4761ca88175c30da7209c9ab1cde788b66a76 (diff) | |
| download | emacs-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/alloc.c')
| -rw-r--r-- | src/alloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/alloc.c b/src/alloc.c index ae32400708a..6eced7bab18 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -3567,7 +3567,7 @@ init_symbol (Lisp_Object val, Lisp_Object name) | |||
| 3567 | set_symbol_next (val, NULL); | 3567 | set_symbol_next (val, NULL); |
| 3568 | p->gcmarkbit = false; | 3568 | p->gcmarkbit = false; |
| 3569 | p->interned = SYMBOL_UNINTERNED; | 3569 | p->interned = SYMBOL_UNINTERNED; |
| 3570 | p->constant = 0; | 3570 | p->trapped_write = SYMBOL_UNTRAPPED_WRITE; |
| 3571 | p->declared_special = false; | 3571 | p->declared_special = false; |
| 3572 | p->pinned = false; | 3572 | p->pinned = false; |
| 3573 | } | 3573 | } |