diff options
author | Richard M. Stallman <rms@gnu.org> | 1996-11-12 06:03:20 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1996-11-12 06:03:20 +0000 |
commit | 7a5de42daf0c138e5250c3ee0b497d903b328f94 (patch) | |
tree | 8aa5242ccaf0b47778d9271a38ebd9e642efe3ce | |
parent | b8a8f8bd5ad2bcffb4ee3152f5f65d5e38a7b1cb (diff) | |
download | emacs-7a5de42daf0c138e5250c3ee0b497d903b328f94.tar.gz |
(Fmodify_frame_parameters): Use alist in reverse order.
-rw-r--r-- | src/frame.c | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/src/frame.c b/src/frame.c index c88262c7bae..31b5b854348 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1816,13 +1816,35 @@ so that `frame-parameters' will return them.") IT_set_frame_parameters (f, alist); else #endif - for (tail = alist; !EQ (tail, Qnil); tail = Fcdr (tail)) - { - elt = Fcar (tail); - prop = Fcar (elt); - val = Fcdr (elt); - store_frame_param (f, prop, val); - } + { + int length = XINT (Flength (alist)); + int i; + Lisp_Object *parms + = (Lisp_Object *) alloca (length * sizeof (Lisp_Object)); + Lisp_Object *values + = (Lisp_Object *) alloca (length * sizeof (Lisp_Object)); + + /* Extract parm names and values into those vectors. */ + + i = 0; + for (tail = alist; CONSP (tail); tail = Fcdr (tail)) + { + Lisp_Object elt, prop, val; + + elt = Fcar (tail); + parms[i] = Fcar (elt); + values[i] = Fcdr (elt); + i++; + } + + /* Now process them in reverse of specified order. */ + for (i--; i >= 0; i--) + { + prop = parms[i]; + val = values[i]; + store_frame_param (f, prop, val); + } + } return Qnil; } |