From: Chong Yidong Date: Sun, 27 Feb 2011 22:57:22 +0000 (-0500) Subject: Avoid recording dead buffers in buffer-list frame param (Bug#7898). X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~707 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=52eb77a6ad5df5980bc8c6d7ad7ee802feb8add3;p=emacs.git Avoid recording dead buffers in buffer-list frame param (Bug#7898). * src/frame.c (store_frame_param): Don't store value directly in buffer_list and buried_buffer_list; copy the list and remove dead buffers. --- diff --git a/src/ChangeLog b/src/ChangeLog index a7c9d4c7e3c..0e5e295a622 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-02-27 Chong Yidong + + * frame.c (store_frame_param): Don't store value directly in + buffer_list and buried_buffer_list; copy the list and remove dead + buffers (Bug#7898). + 2011-02-27 Eli Zaretskii * msdos.c (readlink) [DJGPP < 2.04]: New stub function. diff --git a/src/frame.c b/src/frame.c index 3a6900a572a..05938f3e1f0 100644 --- a/src/frame.c +++ b/src/frame.c @@ -2208,15 +2208,23 @@ store_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val) register Lisp_Object old_alist_elt; /* The buffer-list parameters are stored in a special place and not - in the alist. */ + in the alist. All buffers must be live. */ if (EQ (prop, Qbuffer_list)) { - f->buffer_list = val; + Lisp_Object list = Qnil; + for (; CONSP (val); val = XCDR (val)) + if (!NILP (Fbuffer_live_p (XCAR (val)))) + list = Fcons (XCAR (val), list); + f->buffer_list = Fnreverse (list); return; } if (EQ (prop, Qburied_buffer_list)) { - f->buried_buffer_list = val; + Lisp_Object list = Qnil; + for (; CONSP (val); val = XCDR (val)) + if (!NILP (Fbuffer_live_p (XCAR (val)))) + list = Fcons (XCAR (val), list); + f->buried_buffer_list = Fnreverse (list); return; }