comparison src/frame.c @ 22188:9fba463768ec

(frame_buffer_predicate): New arg FRAME. (frame_buffer_list, set_frame_buffer_list): Likewise. (make_frame): Pass new arg to Fother_buffer. (make_frame_visible_1): New function. (Fmake_frame_visible): Use that.
author Richard M. Stallman <rms@gnu.org>
date Fri, 22 May 1998 20:04:40 +0000
parents 697991d2a2c4
children 1e52542fb338
comparison
equal deleted inserted replaced
22187:9509e86a7be5 22188:9fba463768ec
354 XWINDOW (root_window)->buffer = Qt; 354 XWINDOW (root_window)->buffer = Qt;
355 buf = Fcurrent_buffer (); 355 buf = Fcurrent_buffer ();
356 /* If buf is a 'hidden' buffer (i.e. one whose name starts with 356 /* If buf is a 'hidden' buffer (i.e. one whose name starts with
357 a space), try to find another one. */ 357 a space), try to find another one. */
358 if (XSTRING (Fbuffer_name (buf))->data[0] == ' ') 358 if (XSTRING (Fbuffer_name (buf))->data[0] == ' ')
359 buf = Fother_buffer (buf, Qnil); 359 buf = Fother_buffer (buf, Qnil, Qnil);
360 Fset_window_buffer (root_window, buf); 360 Fset_window_buffer (root_window, buf);
361 361
362 f->buffer_list = Fcons (buf, Qnil); 362 f->buffer_list = Fcons (buf, Qnil);
363 } 363 }
364 364
1422 #endif 1422 #endif
1423 1423
1424 return Qnil; 1424 return Qnil;
1425 } 1425 }
1426 1426
1427 static void make_frame_visible_1 P_ ((Lisp_Object));
1428
1427 DEFUN ("make-frame-visible", Fmake_frame_visible, Smake_frame_visible, 1429 DEFUN ("make-frame-visible", Fmake_frame_visible, Smake_frame_visible,
1428 0, 1, "", 1430 0, 1, "",
1429 "Make the frame FRAME visible (assuming it is an X-window).\n\ 1431 "Make the frame FRAME visible (assuming it is an X-window).\n\
1430 If omitted, FRAME defaults to the currently selected frame.") 1432 If omitted, FRAME defaults to the currently selected frame.")
1431 (frame) 1433 (frame)
1443 FRAME_SAMPLE_VISIBILITY (XFRAME (frame)); 1445 FRAME_SAMPLE_VISIBILITY (XFRAME (frame));
1444 x_make_frame_visible (XFRAME (frame)); 1446 x_make_frame_visible (XFRAME (frame));
1445 } 1447 }
1446 #endif 1448 #endif
1447 1449
1450 make_frame_visible_1 (XFRAME (frame)->root_window);
1451
1448 /* Make menu bar update for the Buffers and Frams menus. */ 1452 /* Make menu bar update for the Buffers and Frams menus. */
1449 windows_or_buffers_changed++; 1453 windows_or_buffers_changed++;
1450 1454
1451 return frame; 1455 return frame;
1456 }
1457
1458 /* Update the display_time slot of the buffers shown in WINDOW
1459 and all its descendents. */
1460
1461 static void
1462 make_frame_visible_1 (window)
1463 Lisp_Object window;
1464 {
1465 struct window *w;
1466
1467 for (;!NILP (window); window = w->next)
1468 {
1469 w = XWINDOW (window);
1470
1471 if (!NILP (w->buffer))
1472 XBUFFER (w->buffer)->display_time = Fcurrent_time ();
1473
1474 if (!NILP (w->vchild))
1475 make_frame_visible_1 (w->vchild);
1476 if (!NILP (w->hchild))
1477 make_frame_visible_1 (w->hchild);
1478 }
1452 } 1479 }
1453 1480
1454 DEFUN ("make-frame-invisible", Fmake_frame_invisible, Smake_frame_invisible, 1481 DEFUN ("make-frame-invisible", Fmake_frame_invisible, Smake_frame_invisible,
1455 0, 2, "", 1482 0, 2, "",
1456 "Make the frame FRAME invisible (assuming it is an X-window).\n\ 1483 "Make the frame FRAME invisible (assuming it is an X-window).\n\
1694 } 1721 }
1695 1722
1696 /* Return the buffer-predicate of the selected frame. */ 1723 /* Return the buffer-predicate of the selected frame. */
1697 1724
1698 Lisp_Object 1725 Lisp_Object
1699 frame_buffer_predicate () 1726 frame_buffer_predicate (frame)
1700 { 1727 Lisp_Object frame;
1701 return selected_frame->buffer_predicate; 1728 {
1729 return XFRAME (frame)->buffer_predicate;
1702 } 1730 }
1703 1731
1704 /* Return the buffer-list of the selected frame. */ 1732 /* Return the buffer-list of the selected frame. */
1705 1733
1706 Lisp_Object 1734 Lisp_Object
1707 frame_buffer_list () 1735 frame_buffer_list (frame)
1708 { 1736 Lisp_Object frame;
1709 return selected_frame->buffer_list; 1737 {
1738 return XFRAME (frame)->buffer_list;
1710 } 1739 }
1711 1740
1712 /* Set the buffer-list of the selected frame. */ 1741 /* Set the buffer-list of the selected frame. */
1713 1742
1714 void 1743 void
1715 set_frame_buffer_list (list) 1744 set_frame_buffer_list (frame, list)
1716 Lisp_Object list; 1745 Lisp_Object frame, list;
1717 { 1746 {
1718 selected_frame->buffer_list = list; 1747 XFRAME (frame)->buffer_list = list;
1719 } 1748 }
1720 1749
1721 /* Discard BUFFER from the buffer-list of each frame. */ 1750 /* Discard BUFFER from the buffer-list of each frame. */
1722 1751
1723 void 1752 void
1918 store_in_alist (&alist, Qminibuffer, 1947 store_in_alist (&alist, Qminibuffer,
1919 (! FRAME_HAS_MINIBUF_P (f) ? Qnil 1948 (! FRAME_HAS_MINIBUF_P (f) ? Qnil
1920 : FRAME_MINIBUF_ONLY_P (f) ? Qonly 1949 : FRAME_MINIBUF_ONLY_P (f) ? Qonly
1921 : FRAME_MINIBUF_WINDOW (f))); 1950 : FRAME_MINIBUF_WINDOW (f)));
1922 store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil)); 1951 store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil));
1923 store_in_alist (&alist, Qbuffer_list, frame_buffer_list ()); 1952 store_in_alist (&alist, Qbuffer_list,
1953 frame_buffer_list (Fselected_frame ()));
1924 1954
1925 /* I think this should be done with a hook. */ 1955 /* I think this should be done with a hook. */
1926 #ifdef HAVE_WINDOW_SYSTEM 1956 #ifdef HAVE_WINDOW_SYSTEM
1927 if (FRAME_WINDOW_P (f)) 1957 if (FRAME_WINDOW_P (f))
1928 x_report_frame_params (f, &alist); 1958 x_report_frame_params (f, &alist);