aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/data.c b/src/data.c
index 07730d0924f..095b740c1b2 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1463,6 +1463,16 @@ SYMBOL (or its aliases) are set. */)
1463 return Qnil; 1463 return Qnil;
1464} 1464}
1465 1465
1466DEFUN ("get-variable-watchers", Fget_variable_watchers, Sget_variable_watchers,
1467 1, 1, 0,
1468 doc: /* Return a list of SYMBOL's active watchers. */)
1469 (Lisp_Object symbol)
1470{
1471 return (SYMBOL_TRAPPED_WRITE_P (symbol) == SYMBOL_TRAPPED_WRITE)
1472 ? Fget (Findirect_variable (symbol), Qwatchers)
1473 : Qnil;
1474}
1475
1466void 1476void
1467notify_variable_watchers (Lisp_Object symbol, 1477notify_variable_watchers (Lisp_Object symbol,
1468 Lisp_Object newval, 1478 Lisp_Object newval,
@@ -3874,4 +3884,5 @@ syms_of_data (void)
3874 DEFSYM (Qset_default, "set-default"); 3884 DEFSYM (Qset_default, "set-default");
3875 defsubr (&Sadd_variable_watcher); 3885 defsubr (&Sadd_variable_watcher);
3876 defsubr (&Sremove_variable_watcher); 3886 defsubr (&Sremove_variable_watcher);
3887 defsubr (&Sget_variable_watchers);
3877} 3888}