Skip to content

Commit

Permalink
(frame_buffer_list, set_frame_buffer_list): New functions.
Browse files Browse the repository at this point in the history
(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.
  • Loading branch information
Richard M. Stallman committed Mar 22, 1997
1 parent 804e5f3 commit e8ee073
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion src/frame.c
@@ -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.
Expand Down Expand Up @@ -83,6 +83,7 @@ Lisp_Object Qw32;
Lisp_Object Qpc;
Lisp_Object Qvisible;
Lisp_Object Qbuffer_predicate;
Lisp_Object Qbuffer_list;
Lisp_Object Qtitle;

Lisp_Object Vterminal_frame;
Expand Down Expand Up @@ -124,6 +125,8 @@ syms_of_frame_1 ()
staticpro (&Qvisible);
Qbuffer_predicate = intern ("buffer-predicate");
staticpro (&Qbuffer_predicate);
Qbuffer_list = intern ("buffer-list");
staticpro (&Qbuffer_list);
Qtitle = intern ("title");
staticpro (&Qtitle);

Expand Down Expand Up @@ -294,6 +297,7 @@ make_frame (mini_p)
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
Expand Down Expand Up @@ -347,6 +351,8 @@ make_frame (mini_p)
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)
Expand Down Expand Up @@ -1678,6 +1684,38 @@ frame_buffer_predicate ()
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. */

Expand All @@ -1702,6 +1740,12 @@ store_frame_param (f, prop, val)
{
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);
Expand Down Expand Up @@ -1780,6 +1824,7 @@ If FRAME is omitted, return information on the currently selected frame.")
: 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
Expand Down

0 comments on commit e8ee073

Please sign in to comment.