comparison src/frame.c @ 29616:8d7a0f575a0e

(Fmodify_frame_parameters): Doc fix. (store_frame_param): Call swap_in_global_binding if the variable's current binding was chosen based on this frame.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 13 Jun 2000 13:21:16 +0000
parents 963baceb2414
children c38afaed3dd0
comparison
equal deleted inserted replaced
29615:2a0aee2ed953 29616:8d7a0f575a0e
1954 void 1954 void
1955 store_frame_param (f, prop, val) 1955 store_frame_param (f, prop, val)
1956 struct frame *f; 1956 struct frame *f;
1957 Lisp_Object prop, val; 1957 Lisp_Object prop, val;
1958 { 1958 {
1959 register Lisp_Object tem; 1959 register Lisp_Object old_alist_elt;
1960 1960
1961 /* The buffer-alist parameter is stored in a special place and is
1962 not in the alist. */
1961 if (EQ (prop, Qbuffer_list)) 1963 if (EQ (prop, Qbuffer_list))
1962 { 1964 {
1963 f->buffer_list = val; 1965 f->buffer_list = val;
1964 return; 1966 return;
1965 } 1967 }
1966 1968
1967 tem = Fassq (prop, f->param_alist); 1969 /* If PROP is a symbol which is supposed to have frame-local values,
1968 if (EQ (tem, Qnil)) 1970 and it is set up based on this frame, switch to the global
1971 binding. That way, we can create or alter the frame-local binding
1972 without messing up the symbol's status. */
1973 if (SYMBOLP (prop))
1974 {
1975 Lisp_Object valcontents;
1976 valcontents = XSYMBOL (prop)->value;
1977 if ((BUFFER_LOCAL_VALUEP (valcontents)
1978 || SOME_BUFFER_LOCAL_VALUEP (valcontents))
1979 && XBUFFER_LOCAL_VALUE (valcontents)->check_frame
1980 && XFRAME (XBUFFER_LOCAL_VALUE (valcontents)->frame) == f)
1981 swap_in_global_binding (prop);
1982 }
1983
1984 /* Update the frame parameter alist. */
1985 old_alist_elt = Fassq (prop, f->param_alist);
1986 if (EQ (old_alist_elt, Qnil))
1969 f->param_alist = Fcons (Fcons (prop, val), f->param_alist); 1987 f->param_alist = Fcons (Fcons (prop, val), f->param_alist);
1970 else 1988 else
1971 Fsetcdr (tem, val); 1989 Fsetcdr (old_alist_elt, val);
1972 1990
1991 /* Update some other special parameters in their special places
1992 in addition to the alist. */
1993
1973 if (EQ (prop, Qbuffer_predicate)) 1994 if (EQ (prop, Qbuffer_predicate))
1974 f->buffer_predicate = val; 1995 f->buffer_predicate = val;
1975 1996
1976 if (! FRAME_WINDOW_P (f)) 1997 if (! FRAME_WINDOW_P (f))
1977 { 1998 {
2070 "Modify the parameters of frame FRAME according to ALIST.\n\ 2091 "Modify the parameters of frame FRAME according to ALIST.\n\
2071 ALIST is an alist of parameters to change and their new values.\n\ 2092 ALIST is an alist of parameters to change and their new values.\n\
2072 Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.\n\ 2093 Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.\n\
2073 The meaningful PARMs depend on the kind of frame.\n\ 2094 The meaningful PARMs depend on the kind of frame.\n\
2074 Undefined PARMs are ignored, but stored in the frame's parameter list\n\ 2095 Undefined PARMs are ignored, but stored in the frame's parameter list\n\
2075 so that `frame-parameters' will return them.") 2096 so that `frame-parameters' will return them.\n\
2097 \n\
2098 The value of frame parameter FOO can also be accessed\n\
2099 as a frame-local binding for the variable FOO, if you have\n\
2100 enabled such bindings for that variable with `make-variable-frame-local'.")
2076 (frame, alist) 2101 (frame, alist)
2077 Lisp_Object frame, alist; 2102 Lisp_Object frame, alist;
2078 { 2103 {
2079 FRAME_PTR f; 2104 FRAME_PTR f;
2080 register Lisp_Object tail, prop, val; 2105 register Lisp_Object tail, prop, val;