aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
authorMiles Bader2007-10-11 16:24:58 +0000
committerMiles Bader2007-10-11 16:24:58 +0000
commitc73bd236f75b742ad4642ec94798987ae6e3e1e8 (patch)
treeef5edc8db557fc1d25a17c379e4ae63a38b3ba5c /src/data.c
parentecb21060d5c1752d41d7a742be565c59b5fcb855 (diff)
parent58ade22bf16a9ec2ff0aee6c59d8db4d1703e94f (diff)
downloademacs-c73bd236f75b742ad4642ec94798987ae6e3e1e8.tar.gz
emacs-c73bd236f75b742ad4642ec94798987ae6e3e1e8.zip
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 866-879) - Merge multi-tty branch - Update from CVS - Merge from emacs--rel--22 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-257
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c74
1 files changed, 69 insertions, 5 deletions
diff --git a/src/data.c b/src/data.c
index b262f6e2b92..6439686dcd9 100644
--- a/src/data.c
+++ b/src/data.c
@@ -30,6 +30,7 @@ Boston, MA 02110-1301, USA. */
30#include "keyboard.h" 30#include "keyboard.h"
31#include "frame.h" 31#include "frame.h"
32#include "syssignal.h" 32#include "syssignal.h"
33#include "termhooks.h" /* For FRAME_KBOARD reference in y-or-n-p. */
33 34
34#ifdef STDC_HEADERS 35#ifdef STDC_HEADERS
35#include <float.h> 36#include <float.h>
@@ -769,8 +770,11 @@ Value, if non-nil, is a list \(interactive SPEC). */)
769 770
770 if (SUBRP (fun)) 771 if (SUBRP (fun))
771 { 772 {
772 if (XSUBR (fun)->prompt) 773 char *spec = XSUBR (fun)->intspec;
773 return list2 (Qinteractive, build_string (XSUBR (fun)->prompt)); 774 if (spec)
775 return list2 (Qinteractive,
776 (*spec != '(') ? build_string (spec) :
777 Fcar (Fread_from_string (build_string (spec), Qnil, Qnil)));
774 } 778 }
775 else if (COMPILEDP (fun)) 779 else if (COMPILEDP (fun))
776 { 780 {
@@ -873,7 +877,18 @@ do_symval_forwarding (valcontents)
873 877
874 case Lisp_Misc_Kboard_Objfwd: 878 case Lisp_Misc_Kboard_Objfwd:
875 offset = XKBOARD_OBJFWD (valcontents)->offset; 879 offset = XKBOARD_OBJFWD (valcontents)->offset;
876 return *(Lisp_Object *)(offset + (char *)current_kboard); 880 /* We used to simply use current_kboard here, but from Lisp
881 code, it's value is often unexpected. It seems nicer to
882 allow constructions like this to work as intuitively expected:
883
884 (with-selected-frame frame
885 (define-key local-function-map "\eOP" [f1]))
886
887 On the other hand, this affects the semantics of
888 last-command and real-last-command, and people may rely on
889 that. I took a quick look at the Lisp codebase, and I
890 don't think anything will break. --lorentey */
891 return *(Lisp_Object *)(offset + (char *)FRAME_KBOARD (SELECTED_FRAME ()));
877 } 892 }
878 return valcontents; 893 return valcontents;
879} 894}
@@ -961,7 +976,7 @@ store_symval_forwarding (symbol, valcontents, newval, buf)
961 976
962 case Lisp_Misc_Kboard_Objfwd: 977 case Lisp_Misc_Kboard_Objfwd:
963 { 978 {
964 char *base = (char *) current_kboard; 979 char *base = (char *) FRAME_KBOARD (SELECTED_FRAME ());
965 char *p = base + XKBOARD_OBJFWD (valcontents)->offset; 980 char *p = base + XKBOARD_OBJFWD (valcontents)->offset;
966 *(Lisp_Object *) p = newval; 981 *(Lisp_Object *) p = newval;
967 } 982 }
@@ -1107,7 +1122,7 @@ find_symbol_value (symbol)
1107 1122
1108 case Lisp_Misc_Kboard_Objfwd: 1123 case Lisp_Misc_Kboard_Objfwd:
1109 return *(Lisp_Object *)(XKBOARD_OBJFWD (valcontents)->offset 1124 return *(Lisp_Object *)(XKBOARD_OBJFWD (valcontents)->offset
1110 + (char *)current_kboard); 1125 + (char *)FRAME_KBOARD (SELECTED_FRAME ()));
1111 } 1126 }
1112 } 1127 }
1113 1128
@@ -1868,6 +1883,51 @@ If the current binding is global (the default), the value is nil. */)
1868 1883
1869 return Qnil; 1884 return Qnil;
1870} 1885}
1886
1887/* This code is disabled now that we use the selected frame to return
1888 keyboard-local-values. */
1889#if 0
1890extern struct terminal *get_terminal P_ ((Lisp_Object display, int));
1891
1892DEFUN ("terminal-local-value", Fterminal_local_value, Sterminal_local_value, 2, 2, 0,
1893 doc: /* Return the terminal-local value of SYMBOL on TERMINAL.
1894If SYMBOL is not a terminal-local variable, then return its normal
1895value, like `symbol-value'.
1896
1897TERMINAL may be a terminal id, a frame, or nil (meaning the
1898selected frame's terminal device). */)
1899 (symbol, terminal)
1900 Lisp_Object symbol;
1901 Lisp_Object terminal;
1902{
1903 Lisp_Object result;
1904 struct terminal *t = get_terminal (terminal, 1);
1905 push_kboard (t->kboard);
1906 result = Fsymbol_value (symbol);
1907 pop_kboard ();
1908 return result;
1909}
1910
1911DEFUN ("set-terminal-local-value", Fset_terminal_local_value, Sset_terminal_local_value, 3, 3, 0,
1912 doc: /* Set the terminal-local binding of SYMBOL on TERMINAL to VALUE.
1913If VARIABLE is not a terminal-local variable, then set its normal
1914binding, like `set'.
1915
1916TERMINAL may be a terminal id, a frame, or nil (meaning the
1917selected frame's terminal device). */)
1918 (symbol, terminal, value)
1919 Lisp_Object symbol;
1920 Lisp_Object terminal;
1921 Lisp_Object value;
1922{
1923 Lisp_Object result;
1924 struct terminal *t = get_terminal (terminal, 1);
1925 push_kboard (d->kboard);
1926 result = Fset (symbol, value);
1927 pop_kboard ();
1928 return result;
1929}
1930#endif
1871 1931
1872/* Find the function at the end of a chain of symbol function indirections. */ 1932/* Find the function at the end of a chain of symbol function indirections. */
1873 1933
@@ -3173,6 +3233,10 @@ syms_of_data ()
3173 defsubr (&Slocal_variable_p); 3233 defsubr (&Slocal_variable_p);
3174 defsubr (&Slocal_variable_if_set_p); 3234 defsubr (&Slocal_variable_if_set_p);
3175 defsubr (&Svariable_binding_locus); 3235 defsubr (&Svariable_binding_locus);
3236#if 0 /* XXX Remove this. --lorentey */
3237 defsubr (&Sterminal_local_value);
3238 defsubr (&Sset_terminal_local_value);
3239#endif
3176 defsubr (&Saref); 3240 defsubr (&Saref);
3177 defsubr (&Saset); 3241 defsubr (&Saset);
3178 defsubr (&Snumber_to_string); 3242 defsubr (&Snumber_to_string);