diff options
| author | Juanma Barranquero | 2008-06-04 20:50:27 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2008-06-04 20:50:27 +0000 |
| commit | cfbb239560674ae303f3ed30d40ab85eef3c9656 (patch) | |
| tree | 1f71432d6a78f5c12ed49d6422eb3cd56d6f3f1c | |
| parent | 2124318ae30f32a42a59f2efe1d88b2ac51ab752 (diff) | |
| download | emacs-cfbb239560674ae303f3ed30d40ab85eef3c9656.tar.gz emacs-cfbb239560674ae303f3ed30d40ab85eef3c9656.zip | |
(Fwindow_parameters, Fwindow_parameter, Fset_window_parameter): New defuns.
(syms_of_window): Defsubr the new defuns.
(make_window): Initialize window_parameters to nil.
| -rw-r--r-- | src/window.c | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/src/window.c b/src/window.c index 295e45b25a8..8ab518d178f 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -273,6 +273,7 @@ make_window () | |||
| 273 | p->frame = Qnil; | 273 | p->frame = Qnil; |
| 274 | p->display_table = Qnil; | 274 | p->display_table = Qnil; |
| 275 | p->dedicated = Qnil; | 275 | p->dedicated = Qnil; |
| 276 | p->window_parameters = Qnil; | ||
| 276 | p->pseudo_window_p = 0; | 277 | p->pseudo_window_p = 0; |
| 277 | bzero (&p->cursor, sizeof (p->cursor)); | 278 | bzero (&p->cursor, sizeof (p->cursor)); |
| 278 | bzero (&p->last_cursor, sizeof (p->last_cursor)); | 279 | bzero (&p->last_cursor, sizeof (p->last_cursor)); |
| @@ -1313,7 +1314,7 @@ DEFUN ("set-window-dedicated-p", Fset_window_dedicated_p, | |||
| 1313 | If it is dedicated, Emacs will not automatically change | 1314 | If it is dedicated, Emacs will not automatically change |
| 1314 | which buffer appears in it. | 1315 | which buffer appears in it. |
| 1315 | The second argument is the new value for the dedication flag; | 1316 | The second argument is the new value for the dedication flag; |
| 1316 | non-nil means yes. */) | 1317 | non-nil means yes. */) |
| 1317 | (window, arg) | 1318 | (window, arg) |
| 1318 | Lisp_Object window, arg; | 1319 | Lisp_Object window, arg; |
| 1319 | { | 1320 | { |
| @@ -1324,6 +1325,52 @@ non-nil means yes. */) | |||
| 1324 | return w->dedicated; | 1325 | return w->dedicated; |
| 1325 | } | 1326 | } |
| 1326 | 1327 | ||
| 1328 | DEFUN ("window-parameters", Fwindow_parameters, Swindow_parameters, | ||
| 1329 | 0, 1, 0, | ||
| 1330 | doc: /* Return the parameters-alist of window WINDOW. | ||
| 1331 | It is a list of elements of the form (PARAMETER . VALUE). | ||
| 1332 | The meaningful PARAMETERs depend on the kind of window. | ||
| 1333 | If WINDOW is omitted, return information on the currently selected window. */) | ||
| 1334 | (window) | ||
| 1335 | Lisp_Object window; | ||
| 1336 | { | ||
| 1337 | if (NILP (window)) | ||
| 1338 | window = selected_window; | ||
| 1339 | return decode_window (window)->window_parameters; | ||
| 1340 | } | ||
| 1341 | |||
| 1342 | DEFUN ("window-parameter", Fwindow_parameter, Swindow_parameter, | ||
| 1343 | 2, 2, 0, | ||
| 1344 | doc: /* Return WINDOW's value for parameter PARAMETER. | ||
| 1345 | If WINDOW is nil, describe the currently selected window. */) | ||
| 1346 | (window, parameter) | ||
| 1347 | Lisp_Object window, parameter; | ||
| 1348 | { | ||
| 1349 | if (NILP (window)) | ||
| 1350 | window = selected_window; | ||
| 1351 | return Fassq (parameter, decode_window (window)->window_parameters); | ||
| 1352 | } | ||
| 1353 | |||
| 1354 | |||
| 1355 | DEFUN ("set-window-parameter", Fset_window_parameter, | ||
| 1356 | Sset_window_parameter, 3, 3, 0, | ||
| 1357 | doc: /* Set window parameter PARAMETER to VALUE on WINDOW. | ||
| 1358 | Return the parameters-alist of WINDOW. */) | ||
| 1359 | (window, parameter, value) | ||
| 1360 | Lisp_Object window, parameter, value; | ||
| 1361 | { | ||
| 1362 | register struct window *w = decode_window (window); | ||
| 1363 | Lisp_Object old_alist_elt; | ||
| 1364 | |||
| 1365 | old_alist_elt = Fassq (parameter, w->window_parameters); | ||
| 1366 | if (EQ (old_alist_elt, Qnil)) | ||
| 1367 | w->window_parameters = Fcons (Fcons (parameter, value), w->window_parameters); | ||
| 1368 | else | ||
| 1369 | Fsetcdr (old_alist_elt, value); | ||
| 1370 | return w->window_parameters; | ||
| 1371 | } | ||
| 1372 | |||
| 1373 | |||
| 1327 | DEFUN ("window-display-table", Fwindow_display_table, Swindow_display_table, | 1374 | DEFUN ("window-display-table", Fwindow_display_table, Swindow_display_table, |
| 1328 | 0, 1, 0, | 1375 | 0, 1, 0, |
| 1329 | doc: /* Return the display-table that WINDOW is using. | 1376 | doc: /* Return the display-table that WINDOW is using. |
| @@ -7687,6 +7734,10 @@ with the relevant frame selected. */); | |||
| 7687 | defsubr (&Sset_window_vscroll); | 7734 | defsubr (&Sset_window_vscroll); |
| 7688 | defsubr (&Scompare_window_configurations); | 7735 | defsubr (&Scompare_window_configurations); |
| 7689 | defsubr (&Swindow_list); | 7736 | defsubr (&Swindow_list); |
| 7737 | defsubr (&Swindow_parameters); | ||
| 7738 | defsubr (&Swindow_parameter); | ||
| 7739 | defsubr (&Sset_window_parameter); | ||
| 7740 | |||
| 7690 | } | 7741 | } |
| 7691 | 7742 | ||
| 7692 | void | 7743 | void |