diff options
| author | Richard M. Stallman | 1997-03-22 04:07:26 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-03-22 04:07:26 +0000 |
| commit | fa54c6ae11fb3052c964d8dfe137c6209f3f314a (patch) | |
| tree | a844e2099c5895479543cd3488cbb771934c780c /src | |
| parent | 99a8b2d23690b6d5150ecdb004ed0b6d2dcdd8a6 (diff) | |
| download | emacs-fa54c6ae11fb3052c964d8dfe137c6209f3f314a.tar.gz emacs-fa54c6ae11fb3052c964d8dfe137c6209f3f314a.zip | |
(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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/frame.c | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/src/frame.c b/src/frame.c index 9c3e5241f61..51827be40d9 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Generic frame functions. | 1 | /* Generic frame functions. |
| 2 | Copyright (C) 1993, 1994, 1995 Free Software Foundation. | 2 | Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation. |
| 3 | 3 | ||
| 4 | This file is part of GNU Emacs. | 4 | This file is part of GNU Emacs. |
| 5 | 5 | ||
| @@ -83,6 +83,7 @@ Lisp_Object Qw32; | |||
| 83 | Lisp_Object Qpc; | 83 | Lisp_Object Qpc; |
| 84 | Lisp_Object Qvisible; | 84 | Lisp_Object Qvisible; |
| 85 | Lisp_Object Qbuffer_predicate; | 85 | Lisp_Object Qbuffer_predicate; |
| 86 | Lisp_Object Qbuffer_list; | ||
| 86 | Lisp_Object Qtitle; | 87 | Lisp_Object Qtitle; |
| 87 | 88 | ||
| 88 | Lisp_Object Vterminal_frame; | 89 | Lisp_Object Vterminal_frame; |
| @@ -124,6 +125,8 @@ syms_of_frame_1 () | |||
| 124 | staticpro (&Qvisible); | 125 | staticpro (&Qvisible); |
| 125 | Qbuffer_predicate = intern ("buffer-predicate"); | 126 | Qbuffer_predicate = intern ("buffer-predicate"); |
| 126 | staticpro (&Qbuffer_predicate); | 127 | staticpro (&Qbuffer_predicate); |
| 128 | Qbuffer_list = intern ("buffer-list"); | ||
| 129 | staticpro (&Qbuffer_list); | ||
| 127 | Qtitle = intern ("title"); | 130 | Qtitle = intern ("title"); |
| 128 | staticpro (&Qtitle); | 131 | staticpro (&Qtitle); |
| 129 | 132 | ||
| @@ -294,6 +297,7 @@ make_frame (mini_p) | |||
| 294 | f->menu_bar_vector = Qnil; | 297 | f->menu_bar_vector = Qnil; |
| 295 | f->menu_bar_items_used = 0; | 298 | f->menu_bar_items_used = 0; |
| 296 | f->buffer_predicate = Qnil; | 299 | f->buffer_predicate = Qnil; |
| 300 | f->buffer_list = Qnil; | ||
| 297 | #ifdef MULTI_KBOARD | 301 | #ifdef MULTI_KBOARD |
| 298 | f->kboard = initial_kboard; | 302 | f->kboard = initial_kboard; |
| 299 | #endif | 303 | #endif |
| @@ -347,6 +351,8 @@ make_frame (mini_p) | |||
| 347 | if (XSTRING (Fbuffer_name (buf))->data[0] == ' ') | 351 | if (XSTRING (Fbuffer_name (buf))->data[0] == ' ') |
| 348 | buf = Fother_buffer (buf, Qnil); | 352 | buf = Fother_buffer (buf, Qnil); |
| 349 | Fset_window_buffer (root_window, buf); | 353 | Fset_window_buffer (root_window, buf); |
| 354 | |||
| 355 | f->buffer_list = Fcons (buf, Qnil); | ||
| 350 | } | 356 | } |
| 351 | 357 | ||
| 352 | if (mini_p) | 358 | if (mini_p) |
| @@ -1678,6 +1684,38 @@ frame_buffer_predicate () | |||
| 1678 | return selected_frame->buffer_predicate; | 1684 | return selected_frame->buffer_predicate; |
| 1679 | } | 1685 | } |
| 1680 | 1686 | ||
| 1687 | /* Return the buffer-list of the selected frame. */ | ||
| 1688 | |||
| 1689 | Lisp_Object | ||
| 1690 | frame_buffer_list () | ||
| 1691 | { | ||
| 1692 | return selected_frame->buffer_list; | ||
| 1693 | } | ||
| 1694 | |||
| 1695 | /* Set the buffer-list of the selected frame. */ | ||
| 1696 | |||
| 1697 | void | ||
| 1698 | set_frame_buffer_list (list) | ||
| 1699 | Lisp_Object list; | ||
| 1700 | { | ||
| 1701 | selected_frame->buffer_list = list; | ||
| 1702 | } | ||
| 1703 | |||
| 1704 | /* Discard BUFFER from the buffer-list of each frame. */ | ||
| 1705 | |||
| 1706 | void | ||
| 1707 | frames_discard_buffer (buffer) | ||
| 1708 | Lisp_Object buffer; | ||
| 1709 | { | ||
| 1710 | Lisp_Object frame, tail; | ||
| 1711 | |||
| 1712 | FOR_EACH_FRAME (tail, frame) | ||
| 1713 | { | ||
| 1714 | XFRAME (frame)->buffer_list | ||
| 1715 | = Fdelq (buffer, XFRAME (frame)->buffer_list); | ||
| 1716 | } | ||
| 1717 | } | ||
| 1718 | |||
| 1681 | /* Modify the alist in *ALISTPTR to associate PROP with VAL. | 1719 | /* Modify the alist in *ALISTPTR to associate PROP with VAL. |
| 1682 | If the alist already has an element for PROP, we change it. */ | 1720 | If the alist already has an element for PROP, we change it. */ |
| 1683 | 1721 | ||
| @@ -1702,6 +1740,12 @@ store_frame_param (f, prop, val) | |||
| 1702 | { | 1740 | { |
| 1703 | register Lisp_Object tem; | 1741 | register Lisp_Object tem; |
| 1704 | 1742 | ||
| 1743 | if (EQ (prop, Qbuffer_list)) | ||
| 1744 | { | ||
| 1745 | f->buffer_list = val; | ||
| 1746 | return; | ||
| 1747 | } | ||
| 1748 | |||
| 1705 | tem = Fassq (prop, f->param_alist); | 1749 | tem = Fassq (prop, f->param_alist); |
| 1706 | if (EQ (tem, Qnil)) | 1750 | if (EQ (tem, Qnil)) |
| 1707 | f->param_alist = Fcons (Fcons (prop, val), f->param_alist); | 1751 | f->param_alist = Fcons (Fcons (prop, val), f->param_alist); |
| @@ -1780,6 +1824,7 @@ If FRAME is omitted, return information on the currently selected frame.") | |||
| 1780 | : FRAME_MINIBUF_ONLY_P (f) ? Qonly | 1824 | : FRAME_MINIBUF_ONLY_P (f) ? Qonly |
| 1781 | : FRAME_MINIBUF_WINDOW (f))); | 1825 | : FRAME_MINIBUF_WINDOW (f))); |
| 1782 | store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil)); | 1826 | store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil)); |
| 1827 | store_in_alist (&alist, Qbuffer_list, frame_buffer_list ()); | ||
| 1783 | 1828 | ||
| 1784 | /* I think this should be done with a hook. */ | 1829 | /* I think this should be done with a hook. */ |
| 1785 | #ifdef HAVE_WINDOW_SYSTEM | 1830 | #ifdef HAVE_WINDOW_SYSTEM |