changeset 17221:0530a375eb21

(frame_buffer_list, set_frame_buffer_list): New functions. (store_frame_param): Handle buffer-list parameter. (Qbuffer_list): New variable. (syms_of_frame_1): Initialize it. (make_frame): Initialize buffer_list field. (Fframe_parameters): Handle buffer-list parameter. (frames_discard_buffer): New function. (make_frame): Initialize buffer_list.
author Richard M. Stallman <rms@gnu.org>
date Sat, 22 Mar 1997 04:07:26 +0000
parents 08906793cec3
children 60053e19d485
files src/frame.c
diffstat 1 files changed, 46 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/frame.c	Sat Mar 22 04:06:40 1997 +0000
+++ b/src/frame.c	Sat Mar 22 04:07:26 1997 +0000
@@ -1,5 +1,5 @@
 /* Generic frame functions.
-   Copyright (C) 1993, 1994, 1995 Free Software Foundation.
+   Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation.
 
 This file is part of GNU Emacs.
 
@@ -83,6 +83,7 @@
 Lisp_Object Qpc;
 Lisp_Object Qvisible;
 Lisp_Object Qbuffer_predicate;
+Lisp_Object Qbuffer_list;
 Lisp_Object Qtitle;
 
 Lisp_Object Vterminal_frame;
@@ -124,6 +125,8 @@
   staticpro (&Qvisible);
   Qbuffer_predicate = intern ("buffer-predicate");
   staticpro (&Qbuffer_predicate);
+  Qbuffer_list = intern ("buffer-list");
+  staticpro (&Qbuffer_list);
   Qtitle = intern ("title");
   staticpro (&Qtitle);
 
@@ -294,6 +297,7 @@
   f->menu_bar_vector = Qnil;
   f->menu_bar_items_used = 0;
   f->buffer_predicate = Qnil;
+  f->buffer_list = Qnil;
 #ifdef MULTI_KBOARD
   f->kboard = initial_kboard;
 #endif
@@ -347,6 +351,8 @@
     if (XSTRING (Fbuffer_name (buf))->data[0] == ' ')
       buf = Fother_buffer (buf, Qnil);
     Fset_window_buffer (root_window, buf);
+
+    f->buffer_list = Fcons (buf, Qnil);
   }
 
   if (mini_p)
@@ -1678,6 +1684,38 @@
   return selected_frame->buffer_predicate;
 }
 
+/* Return the buffer-list of the selected frame.  */
+
+Lisp_Object
+frame_buffer_list ()
+{
+  return selected_frame->buffer_list;
+}
+
+/* Set the buffer-list of the selected frame.  */
+
+void
+set_frame_buffer_list (list)
+     Lisp_Object list;
+{
+  selected_frame->buffer_list = list;
+}
+
+/* Discard BUFFER from the buffer-list of each frame.  */
+
+void
+frames_discard_buffer (buffer)
+     Lisp_Object buffer;
+{
+  Lisp_Object frame, tail;
+
+  FOR_EACH_FRAME (tail, frame)
+    {
+      XFRAME (frame)->buffer_list
+	= Fdelq (buffer, XFRAME (frame)->buffer_list);
+    }
+}
+
 /* Modify the alist in *ALISTPTR to associate PROP with VAL.
    If the alist already has an element for PROP, we change it.  */
 
@@ -1702,6 +1740,12 @@
 {
   register Lisp_Object tem;
 
+  if (EQ (prop, Qbuffer_list))
+    {
+      f->buffer_list = val;
+      return;
+    }
+
   tem = Fassq (prop, f->param_alist);
   if (EQ (tem, Qnil))
     f->param_alist = Fcons (Fcons (prop, val), f->param_alist);
@@ -1780,6 +1824,7 @@
 		   : FRAME_MINIBUF_ONLY_P (f) ? Qonly
 		   : FRAME_MINIBUF_WINDOW (f)));
   store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil));
+  store_in_alist (&alist, Qbuffer_list, frame_buffer_list ());
 
   /* I think this should be done with a hook.  */
 #ifdef HAVE_WINDOW_SYSTEM