comparison src/frame.c @ 7162:06a13bf36a8c

(Fframe_parameters) [!MULTI_FRAME]: Unstub it again.
author Karl Heuer <kwzh@gnu.org>
date Thu, 28 Apr 1994 06:16:11 +0000
parents 3ad5c55d40b8
children 6a33d4f04dbf
comparison
equal deleted inserted replaced
7161:67618cd7bdbf 7162:06a13bf36a8c
21 21
22 #include <config.h> 22 #include <config.h>
23 #include "lisp.h" 23 #include "lisp.h"
24 #include "frame.h" 24 #include "frame.h"
25 #include "termhooks.h" 25 #include "termhooks.h"
26 #include "window.h"
26 27
27 #ifdef MULTI_FRAME 28 #ifdef MULTI_FRAME
28 29
29 #include "buffer.h" 30 #include "buffer.h"
30 #include "window.h"
31 31
32 /* These help us bind and responding to switch-frame events. */ 32 /* These help us bind and responding to switch-frame events. */
33 #include "commands.h" 33 #include "commands.h"
34 #include "keyboard.h" 34 #include "keyboard.h"
35 35
1335 If FRAME is omitted, return information on the currently selected frame.") 1335 If FRAME is omitted, return information on the currently selected frame.")
1336 (frame) 1336 (frame)
1337 Lisp_Object frame; 1337 Lisp_Object frame;
1338 { 1338 {
1339 Lisp_Object alist; 1339 Lisp_Object alist;
1340 struct frame *f; 1340 FRAME_PTR f;
1341 1341
1342 if (EQ (frame, Qnil)) 1342 if (EQ (frame, Qnil))
1343 f = selected_frame; 1343 f = selected_frame;
1344 else 1344 else
1345 { 1345 {
1346 CHECK_FRAME (frame, 0); 1346 CHECK_FRAME (frame, 0);
1347 f = XFRAME (frame); 1347 f = XFRAME (frame);
1348 } 1348 }
1349 1349
1350 if (f->display.nothing == 0) 1350 if (!FRAME_LIVE_P (f))
1351 return Qnil; 1351 return Qnil;
1352 1352
1353 alist = Fcopy_alist (f->param_alist); 1353 alist = Fcopy_alist (f->param_alist);
1354 store_in_alist (&alist, Qname, f->name); 1354 store_in_alist (&alist, Qname, f->name);
1355 store_in_alist (&alist, Qheight, make_number (f->height)); 1355 store_in_alist (&alist, Qheight, make_number (FRAME_HEIGHT (f)));
1356 store_in_alist (&alist, Qwidth, make_number (f->width)); 1356 store_in_alist (&alist, Qwidth, make_number (FRAME_WIDTH (f)));
1357 store_in_alist (&alist, Qmodeline, (f->wants_modeline ? Qt : Qnil)); 1357 store_in_alist (&alist, Qmodeline, (FRAME_WANTS_MODELINE_P (f) ? Qt : Qnil));
1358 store_in_alist (&alist, Qminibuffer, 1358 store_in_alist (&alist, Qminibuffer,
1359 (! FRAME_HAS_MINIBUF_P (f) ? Qnil 1359 (! FRAME_HAS_MINIBUF_P (f) ? Qnil
1360 : (FRAME_MINIBUF_ONLY_P (f) ? Qonly 1360 : FRAME_MINIBUF_ONLY_P (f) ? Qonly
1361 : FRAME_MINIBUF_WINDOW (f)))); 1361 : FRAME_MINIBUF_WINDOW (f)));
1362 store_in_alist (&alist, Qunsplittable, (f->no_split ? Qt : Qnil)); 1362 store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil));
1363 store_in_alist (&alist, Qmenu_bar_lines, (FRAME_MENU_BAR_LINES (f))); 1363 store_in_alist (&alist, Qmenu_bar_lines, (FRAME_MENU_BAR_LINES (f)));
1364 1364
1365 /* I think this should be done with a hook. */ 1365 /* I think this should be done with a hook. */
1366 #ifdef HAVE_X_WINDOWS 1366 #ifdef HAVE_X_WINDOWS
1367 if (FRAME_X_P (f)) 1367 if (FRAME_X_P (f))
1766 #else /* not MULTI_FRAME */ 1766 #else /* not MULTI_FRAME */
1767 1767
1768 /* If we're not using multi-frame stuff, we still need to provide some 1768 /* If we're not using multi-frame stuff, we still need to provide some
1769 support functions. */ 1769 support functions. */
1770 1770
1771 Lisp_Object Qheight;
1772 Lisp_Object Qminibuffer;
1773 Lisp_Object Qmodeline;
1774 Lisp_Object Qname;
1775 Lisp_Object Qunsplittable;
1776 Lisp_Object Qmenu_bar_lines;
1777 Lisp_Object Qwidth;
1778
1771 Lisp_Object Vterminal_frame; 1779 Lisp_Object Vterminal_frame;
1772 1780
1773 /* Unless this function is defined, providing set-frame-height and 1781 /* Unless this function is defined, providing set-frame-height and
1774 set-frame-width doesn't help compatibility any, since they both 1782 set-frame-width doesn't help compatibility any, since they both
1775 want this as their first argument. */ 1783 want this as their first argument. */
1932 () 1940 ()
1933 { 1941 {
1934 return Fcons (Qnil, Fcons (Qnil, Qnil)); 1942 return Fcons (Qnil, Fcons (Qnil, Qnil));
1935 } 1943 }
1936 1944
1945 void
1946 store_in_alist (alistptr, prop, val)
1947 Lisp_Object *alistptr, val;
1948 Lisp_Object prop;
1949 {
1950 register Lisp_Object tem;
1951
1952 tem = Fassq (prop, *alistptr);
1953 if (EQ (tem, Qnil))
1954 *alistptr = Fcons (Fcons (prop, val), *alistptr);
1955 else
1956 Fsetcdr (tem, val);
1957 }
1958
1937 DEFUN ("frame-parameters", Fframe_parameters, Sframe_parameters, 0, 1, 0, 1959 DEFUN ("frame-parameters", Fframe_parameters, Sframe_parameters, 0, 1, 0,
1938 /* Don't confuse make-docfile by having two doc strings for this function. 1960 /* Don't confuse make-docfile by having two doc strings for this function.
1939 make-docfile does not pay attention to #if, for good reason! */ 1961 make-docfile does not pay attention to #if, for good reason! */
1940 0) 1962 0)
1941 (frame) 1963 (frame)
1942 Lisp_Object frame; 1964 Lisp_Object frame;
1943 { 1965 {
1944 return Qnil; 1966 Lisp_Object alist;
1967 FRAME_PTR f;
1968
1969 if (EQ (frame, Qnil))
1970 f = selected_frame;
1971 else
1972 {
1973 CHECK_FRAME (frame, 0);
1974 f = XFRAME (frame);
1975 }
1976
1977 if (!FRAME_LIVE_P (f))
1978 return Qnil;
1979
1980 alist = Qnil;
1981 store_in_alist (&alist, Qname, build_string ("emacs"));
1982 store_in_alist (&alist, Qheight, make_number (FRAME_HEIGHT (f)));
1983 store_in_alist (&alist, Qwidth, make_number (FRAME_WIDTH (f)));
1984 store_in_alist (&alist, Qmodeline, (FRAME_WANTS_MODELINE_P (f) ? Qt : Qnil));
1985 store_in_alist (&alist, Qminibuffer, FRAME_MINIBUF_WINDOW (f));
1986 store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil));
1987 store_in_alist (&alist, Qmenu_bar_lines, (FRAME_MENU_BAR_LINES (f)));
1988
1989 return alist;
1945 } 1990 }
1946 1991
1947 DEFUN ("modify-frame-parameters", Fmodify_frame_parameters, 1992 DEFUN ("modify-frame-parameters", Fmodify_frame_parameters,
1948 Smodify_frame_parameters, 2, 2, 0, 1993 Smodify_frame_parameters, 2, 2, 0,
1949 /* Don't confuse make-docfile by having two doc strings for this function. 1994 /* Don't confuse make-docfile by having two doc strings for this function.
1955 return Qnil; 2000 return Qnil;
1956 } 2001 }
1957 2002
1958 syms_of_frame () 2003 syms_of_frame ()
1959 { 2004 {
2005 Qheight = intern ("height");
2006 staticpro (&Qheight);
2007 Qminibuffer = intern ("minibuffer");
2008 staticpro (&Qminibuffer);
2009 Qmodeline = intern ("modeline");
2010 staticpro (&Qmodeline);
2011 Qname = intern ("name");
2012 staticpro (&Qname);
2013 Qunsplittable = intern ("unsplittable");
2014 staticpro (&Qunsplittable);
2015 Qmenu_bar_lines = intern ("menu-bar-lines");
2016 staticpro (&Qmenu_bar_lines);
2017 Qwidth = intern ("width");
2018 staticpro (&Qwidth);
2019
1960 DEFVAR_LISP ("terminal-frame", &Vterminal_frame, 2020 DEFVAR_LISP ("terminal-frame", &Vterminal_frame,
1961 "The initial frame-object, which represents Emacs's stdout."); 2021 "The initial frame-object, which represents Emacs's stdout.");
1962 XFASTINT (Vterminal_frame) = 0; 2022 XFASTINT (Vterminal_frame) = 0;
1963 2023
1964 defsubr (&Sselected_frame); 2024 defsubr (&Sselected_frame);