summaryrefslogtreecommitdiff
path: root/src/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/data.c b/src/data.c
index c0c797da266..b024511d779 100644
--- a/src/data.c
+++ b/src/data.c
@@ -30,6 +30,7 @@ Boston, MA 02110-1301, USA. */
#include "keyboard.h"
#include "frame.h"
#include "syssignal.h"
+#include "termhooks.h" /* For FRAME_KBOARD reference in y-or-n-p. */
#ifdef STDC_HEADERS
#include <float.h>
@@ -1875,6 +1876,47 @@ If the current binding is global (the default), the value is nil. */)
return Qnil;
}
+
+extern struct device *get_device P_ ((Lisp_Object display, int));
+
+DEFUN ("terminal-local-value", Fterminal_local_value, Sterminal_local_value, 2, 2, 0,
+ doc: /* Return the terminal-local value of SYMBOL on DEVICE.
+If SYMBOL is not a terminal-local variable, then return its normal
+value, like `symbol-value'.
+
+DEVICE may be a display device id, a frame, or nil (meaning the
+selected frame's display device). */)
+ (symbol, device)
+ Lisp_Object symbol;
+ Lisp_Object device;
+{
+ Lisp_Object result;
+ struct device *d = get_device (device, 1);
+ push_kboard (d->kboard);
+ result = Fsymbol_value (symbol);
+ pop_kboard ();
+ return result;
+}
+
+DEFUN ("set-terminal-local-value", Fset_terminal_local_value, Sset_terminal_local_value, 3, 3, 0,
+ doc: /* Set the terminal-local binding of SYMBOL on DEVICE to VALUE.
+If VARIABLE is not a terminal-local variable, then set its normal
+binding, like `set'.
+
+DEVICE may be a display device id, a frame, or nil (meaning the
+selected frame's display device). */)
+ (symbol, device, value)
+ Lisp_Object symbol;
+ Lisp_Object device;
+ Lisp_Object value;
+{
+ Lisp_Object result;
+ struct device *d = get_device (device, 1);
+ push_kboard (d->kboard);
+ result = Fset (symbol, value);
+ pop_kboard ();
+ return result;
+}
/* Find the function at the end of a chain of symbol function indirections. */
@@ -3326,6 +3368,8 @@ syms_of_data ()
defsubr (&Slocal_variable_p);
defsubr (&Slocal_variable_if_set_p);
defsubr (&Svariable_binding_locus);
+ defsubr (&Sterminal_local_value);
+ defsubr (&Sset_terminal_local_value);
defsubr (&Saref);
defsubr (&Saset);
defsubr (&Snumber_to_string);