(indirect-variable variable)
(error variable)))
(obsolete (get variable 'byte-obsolete-variable))
+ (watchpoints (get-variable-watchers variable))
(use (car obsolete))
(safe-var (get variable 'safe-local-variable))
(doc (or (documentation-property
(t ".")))
(terpri))
+ (when watchpoints
+ (setq extra-line t)
+ (princ " Calls these functions when changed: ")
+ (princ watchpoints)
+ (terpri))
+
(when (member (cons variable val)
(with-current-buffer buffer
file-local-variables-alist))
return Qnil;
}
+DEFUN ("get-variable-watchers", Fget_variable_watchers, Sget_variable_watchers,
+ 1, 1, 0,
+ doc: /* Return a list of SYMBOL's active watchers. */)
+ (Lisp_Object symbol)
+{
+ return (SYMBOL_TRAPPED_WRITE_P (symbol) == SYMBOL_TRAPPED_WRITE)
+ ? Fget (Findirect_variable (symbol), Qwatchers)
+ : Qnil;
+}
+
void
notify_variable_watchers (Lisp_Object symbol,
Lisp_Object newval,
DEFSYM (Qset_default, "set-default");
defsubr (&Sadd_variable_watcher);
defsubr (&Sremove_variable_watcher);
+ defsubr (&Sget_variable_watchers);
}