X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/71025e5e1d69b9749c1c64668c69386f1f07f601..7bca5cf2214f3ab2442bc3f1b5ef442ce1cc20b3:/src/frame.c diff --git a/src/frame.c b/src/frame.c index 9c3e5241f6..22504128d6 100644 --- a/src/frame.c +++ b/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. @@ -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; @@ -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); @@ -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 @@ -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) @@ -496,15 +502,8 @@ make_terminal_frame () Vframe_list = Fcons (frame, Vframe_list); terminal_frame_count++; - if (terminal_frame_count == 1) - { - f->name = build_string ("Emacs"); - } - else - { - sprintf (name, "Emacs-%d", terminal_frame_count); - f->name = build_string (name); - } + sprintf (name, "F%d", terminal_frame_count); + f->name = build_string (name); f->visible = 1; /* FRAME_SET_VISIBLE wd set frame_garbaged. */ f->async_visible = 1; /* Don't let visible be cleared later. */ @@ -1159,6 +1158,8 @@ but if the second optional argument FORCE is non-nil, you may do so.") free (FRAME_INSERTN_COST (f)); if (FRAME_DELETE_COST (f)) free (FRAME_DELETE_COST (f)); + if (FRAME_MESSAGE_BUF (f)) + free (FRAME_MESSAGE_BUF (f)); #ifdef HAVE_WINDOW_SYSTEM /* Free all fontset data. */ @@ -1678,6 +1679,54 @@ 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); + } +} + +/* Move BUFFER to the end of the buffer-list of each frame. */ + +void +frames_bury_buffer (buffer) + Lisp_Object buffer; +{ + Lisp_Object frame, tail; + + FOR_EACH_FRAME (tail, frame) + { + XFRAME (frame)->buffer_list + = nconc2 (Fdelq (buffer, XFRAME (frame)->buffer_list), + Fcons (buffer, Qnil)); + } +} + /* Modify the alist in *ALISTPTR to associate PROP with VAL. If the alist already has an element for PROP, we change it. */ @@ -1702,6 +1751,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); @@ -1780,6 +1835,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