comparison src/frame.c @ 10207:e6618f52efe9

(Fmodify_frame_parameters): For non-X frames, call store_frame_param for each parameter set. (store_frame_param): Handle buffer_predicate field. (frame_buffer_predicate): New function. (Qbuffer_predicate): New variable. (syms_of_frame): Set it up.
author Richard M. Stallman <rms@gnu.org>
date Wed, 21 Dec 1994 22:26:02 +0000
parents 92b33538b36a
children 9ef4bfc9a320
comparison
equal deleted inserted replaced
10206:c017d1157655 10207:e6618f52efe9
87 Lisp_Object Qunsplittable; 87 Lisp_Object Qunsplittable;
88 Lisp_Object Qmenu_bar_lines; 88 Lisp_Object Qmenu_bar_lines;
89 Lisp_Object Qwidth; 89 Lisp_Object Qwidth;
90 Lisp_Object Qx; 90 Lisp_Object Qx;
91 Lisp_Object Qvisible; 91 Lisp_Object Qvisible;
92 Lisp_Object Qbuffer_predicate;
92 93
93 extern Lisp_Object Vminibuffer_list; 94 extern Lisp_Object Vminibuffer_list;
94 extern Lisp_Object get_minibuffer (); 95 extern Lisp_Object get_minibuffer ();
95 extern Lisp_Object Fhandle_switch_frame (); 96 extern Lisp_Object Fhandle_switch_frame ();
96 extern Lisp_Object Fredirect_frame_focus (); 97 extern Lisp_Object Fredirect_frame_focus ();
175 f->condemned_scroll_bars = Qnil; 176 f->condemned_scroll_bars = Qnil;
176 f->face_alist = Qnil; 177 f->face_alist = Qnil;
177 f->menu_bar_items = Qnil; 178 f->menu_bar_items = Qnil;
178 f->menu_bar_vector = Qnil; 179 f->menu_bar_vector = Qnil;
179 f->menu_bar_items_used = 0; 180 f->menu_bar_items_used = 0;
181 f->buffer_predicate = Qnil;
180 182
181 root_window = make_window (); 183 root_window = make_window ();
182 if (mini_p) 184 if (mini_p)
183 { 185 {
184 mini_window = make_window (); 186 mini_window = make_window ();
1340 return FRAME_FOCUS_FRAME (XFRAME (frame)); 1342 return FRAME_FOCUS_FRAME (XFRAME (frame));
1341 } 1343 }
1342 1344
1343 1345
1344 1346
1347 /* Return the value of frame parameter PROP in frame FRAME. */
1348
1345 Lisp_Object 1349 Lisp_Object
1346 get_frame_param (frame, prop) 1350 get_frame_param (frame, prop)
1347 register struct frame *frame; 1351 register struct frame *frame;
1348 Lisp_Object prop; 1352 Lisp_Object prop;
1349 { 1353 {
1353 if (EQ (tem, Qnil)) 1357 if (EQ (tem, Qnil))
1354 return tem; 1358 return tem;
1355 return Fcdr (tem); 1359 return Fcdr (tem);
1356 } 1360 }
1357 1361
1362 /* Return the buffer-predicate of the selected frame. */
1363
1364 Lisp_Object
1365 frame_buffer_predicate ()
1366 {
1367 return selected_frame->buffer_predicate;
1368 }
1369
1370 /* Modify the alist in *ALISTPTR to associate PROP with VAL.
1371 If the alist already has an element for PROP, we change it. */
1372
1358 void 1373 void
1359 store_in_alist (alistptr, prop, val) 1374 store_in_alist (alistptr, prop, val)
1360 Lisp_Object *alistptr, val; 1375 Lisp_Object *alistptr, val;
1361 Lisp_Object prop; 1376 Lisp_Object prop;
1362 { 1377 {
1379 tem = Fassq (prop, f->param_alist); 1394 tem = Fassq (prop, f->param_alist);
1380 if (EQ (tem, Qnil)) 1395 if (EQ (tem, Qnil))
1381 f->param_alist = Fcons (Fcons (prop, val), f->param_alist); 1396 f->param_alist = Fcons (Fcons (prop, val), f->param_alist);
1382 else 1397 else
1383 Fsetcdr (tem, val); 1398 Fsetcdr (tem, val);
1399
1400 if (EQ (prop, Qbuffer_predicate))
1401 f->buffer_predicate = val;
1384 1402
1385 if (EQ (prop, Qminibuffer) && WINDOWP (val)) 1403 if (EQ (prop, Qminibuffer) && WINDOWP (val))
1386 { 1404 {
1387 if (! MINI_WINDOW_P (XWINDOW (val))) 1405 if (! MINI_WINDOW_P (XWINDOW (val)))
1388 error ("Surrogate minibuffer windows must be minibuffer windows."); 1406 error ("Surrogate minibuffer windows must be minibuffer windows.");
1464 } 1482 }
1465 1483
1466 /* I think this should be done with a hook. */ 1484 /* I think this should be done with a hook. */
1467 #ifdef HAVE_X_WINDOWS 1485 #ifdef HAVE_X_WINDOWS
1468 if (FRAME_X_P (f)) 1486 if (FRAME_X_P (f))
1469 #if 1
1470 x_set_frame_parameters (f, alist); 1487 x_set_frame_parameters (f, alist);
1471 #else 1488 else
1489 #endif
1472 for (tail = alist; !EQ (tail, Qnil); tail = Fcdr (tail)) 1490 for (tail = alist; !EQ (tail, Qnil); tail = Fcdr (tail))
1473 { 1491 {
1474 elt = Fcar (tail); 1492 elt = Fcar (tail);
1475 prop = Fcar (elt); 1493 prop = Fcar (elt);
1476 val = Fcdr (elt); 1494 val = Fcdr (elt);
1477 x_set_frame_param (f, prop, val, get_frame_param (f, prop));
1478 store_frame_param (f, prop, val); 1495 store_frame_param (f, prop, val);
1479 } 1496 }
1480 #endif
1481 #endif
1482 1497
1483 return Qnil; 1498 return Qnil;
1484 } 1499 }
1485 1500
1486 DEFUN ("frame-char-height", Fframe_char_height, Sframe_char_height, 1501 DEFUN ("frame-char-height", Fframe_char_height, Sframe_char_height,
1752 staticpro (&Qwidth); 1767 staticpro (&Qwidth);
1753 Qx = intern ("x"); 1768 Qx = intern ("x");
1754 staticpro (&Qx); 1769 staticpro (&Qx);
1755 Qvisible = intern ("visible"); 1770 Qvisible = intern ("visible");
1756 staticpro (&Qvisible); 1771 staticpro (&Qvisible);
1772 Qbuffer_predicate = intern ("buffer-predicate");
1773 staticpro (&Qbuffer_predicate);
1757 1774
1758 staticpro (&Vframe_list); 1775 staticpro (&Vframe_list);
1759 1776
1760 DEFVAR_LISP ("terminal-frame", &Vterminal_frame, 1777 DEFVAR_LISP ("terminal-frame", &Vterminal_frame,
1761 "The initial frame-object, which represents Emacs's stdout."); 1778 "The initial frame-object, which represents Emacs's stdout.");