diff options
| author | Karl Heuer | 1994-09-27 00:51:55 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-09-27 00:51:55 +0000 |
| commit | 017b2badf8c9aff8fcc52ae560324167c3d027c3 (patch) | |
| tree | 0556f12e64454f6a421169e7ec6892b7d2f19a0c /src | |
| parent | e24c997dd3fad26308be1631ee6371cd33dacebd (diff) | |
| download | emacs-017b2badf8c9aff8fcc52ae560324167c3d027c3.tar.gz emacs-017b2badf8c9aff8fcc52ae560324167c3d027c3.zip | |
(Fwindowp, Fwindow_live_p, window_display_table, window_loop,
Fget_buffer_window, Fscroll_other_window, Frecenter, Fwindow_configuration_p,
Fset_window_configuration): Use type test macros.
Diffstat (limited to 'src')
| -rw-r--r-- | src/window.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/window.c b/src/window.c index 95a51c3ecb9..35140f239a9 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -105,7 +105,7 @@ DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0, | |||
| 105 | (obj) | 105 | (obj) |
| 106 | Lisp_Object obj; | 106 | Lisp_Object obj; |
| 107 | { | 107 | { |
| 108 | return XTYPE (obj) == Lisp_Window ? Qt : Qnil; | 108 | return WINDOWP (obj) ? Qt : Qnil; |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | DEFUN ("window-live-p", Fwindow_live_p, Swindow_live_p, 1, 1, 0, | 111 | DEFUN ("window-live-p", Fwindow_live_p, Swindow_live_p, 1, 1, 0, |
| @@ -113,9 +113,7 @@ DEFUN ("window-live-p", Fwindow_live_p, Swindow_live_p, 1, 1, 0, | |||
| 113 | (obj) | 113 | (obj) |
| 114 | Lisp_Object obj; | 114 | Lisp_Object obj; |
| 115 | { | 115 | { |
| 116 | return ((XTYPE (obj) == Lisp_Window | 116 | return (WINDOWP (obj) && ! NILP (XWINDOW (obj)->buffer) ? Qt : Qnil); |
| 117 | && ! NILP (XWINDOW (obj)->buffer)) | ||
| 118 | ? Qt : Qnil); | ||
| 119 | } | 117 | } |
| 120 | 118 | ||
| 121 | Lisp_Object | 119 | Lisp_Object |
| @@ -618,13 +616,13 @@ window_display_table (w) | |||
| 618 | { | 616 | { |
| 619 | Lisp_Object tem; | 617 | Lisp_Object tem; |
| 620 | tem = w->display_table; | 618 | tem = w->display_table; |
| 621 | if (XTYPE (tem) == Lisp_Vector && XVECTOR (tem)->size == DISP_TABLE_SIZE) | 619 | if (VECTORP (tem) && XVECTOR (tem)->size == DISP_TABLE_SIZE) |
| 622 | return XVECTOR (tem); | 620 | return XVECTOR (tem); |
| 623 | tem = XBUFFER (w->buffer)->display_table; | 621 | tem = XBUFFER (w->buffer)->display_table; |
| 624 | if (XTYPE (tem) == Lisp_Vector && XVECTOR (tem)->size == DISP_TABLE_SIZE) | 622 | if (VECTORP (tem) && XVECTOR (tem)->size == DISP_TABLE_SIZE) |
| 625 | return XVECTOR (tem); | 623 | return XVECTOR (tem); |
| 626 | tem = Vstandard_display_table; | 624 | tem = Vstandard_display_table; |
| 627 | if (XTYPE (tem) == Lisp_Vector && XVECTOR (tem)->size == DISP_TABLE_SIZE) | 625 | if (VECTORP (tem) && XVECTOR (tem)->size == DISP_TABLE_SIZE) |
| 628 | return XVECTOR (tem); | 626 | return XVECTOR (tem); |
| 629 | return 0; | 627 | return 0; |
| 630 | } | 628 | } |
| @@ -1227,7 +1225,7 @@ window_loop (type, obj, mini, frames) | |||
| 1227 | or Qt otherwise. */ | 1225 | or Qt otherwise. */ |
| 1228 | 1226 | ||
| 1229 | /* Pick a window to start with. */ | 1227 | /* Pick a window to start with. */ |
| 1230 | if (XTYPE (obj) == Lisp_Window) | 1228 | if (WINDOWP (obj)) |
| 1231 | w = obj; | 1229 | w = obj; |
| 1232 | else if (frame) | 1230 | else if (frame) |
| 1233 | w = FRAME_SELECTED_WINDOW (frame); | 1231 | w = FRAME_SELECTED_WINDOW (frame); |
| @@ -1423,7 +1421,7 @@ If FRAME is a frame, search only that frame.") | |||
| 1423 | Lisp_Object buffer, frame; | 1421 | Lisp_Object buffer, frame; |
| 1424 | { | 1422 | { |
| 1425 | buffer = Fget_buffer (buffer); | 1423 | buffer = Fget_buffer (buffer); |
| 1426 | if (XTYPE (buffer) == Lisp_Buffer) | 1424 | if (BUFFERP (buffer)) |
| 1427 | return window_loop (GET_BUFFER_WINDOW, buffer, 1, frame); | 1425 | return window_loop (GET_BUFFER_WINDOW, buffer, 1, frame); |
| 1428 | else | 1426 | else |
| 1429 | return Qnil; | 1427 | return Qnil; |
| @@ -2573,7 +2571,7 @@ showing that buffer, popping the buffer up if necessary.") | |||
| 2573 | window_scroll (window, next_screen_context_lines - ht, 1); | 2571 | window_scroll (window, next_screen_context_lines - ht, 1); |
| 2574 | else | 2572 | else |
| 2575 | { | 2573 | { |
| 2576 | if (XTYPE (n) == Lisp_Cons) | 2574 | if (CONSP (n)) |
| 2577 | n = Fcar (n); | 2575 | n = Fcar (n); |
| 2578 | CHECK_NUMBER (n, 0); | 2576 | CHECK_NUMBER (n, 0); |
| 2579 | window_scroll (window, XINT (n), 1); | 2577 | window_scroll (window, XINT (n), 1); |
| @@ -2641,7 +2639,7 @@ redraws with point in the center of the current window.") | |||
| 2641 | SET_FRAME_GARBAGED (XFRAME (WINDOW_FRAME (w))); | 2639 | SET_FRAME_GARBAGED (XFRAME (WINDOW_FRAME (w))); |
| 2642 | XFASTINT (n) = ht / 2; | 2640 | XFASTINT (n) = ht / 2; |
| 2643 | } | 2641 | } |
| 2644 | else if (XTYPE (n) == Lisp_Cons) /* Just C-u. */ | 2642 | else if (CONSP (n)) /* Just C-u. */ |
| 2645 | { | 2643 | { |
| 2646 | XFASTINT (n) = ht / 2; | 2644 | XFASTINT (n) = ht / 2; |
| 2647 | } | 2645 | } |
| @@ -2755,7 +2753,7 @@ DEFUN ("window-configuration-p", Fwindow_configuration_p, Swindow_configuration_ | |||
| 2755 | (obj) | 2753 | (obj) |
| 2756 | Lisp_Object obj; | 2754 | Lisp_Object obj; |
| 2757 | { | 2755 | { |
| 2758 | if (XTYPE (obj) == Lisp_Window_Configuration) | 2756 | if (WINDOW_CONFIGURATIONP (obj)) |
| 2759 | return Qt; | 2757 | return Qt; |
| 2760 | return Qnil; | 2758 | return Qnil; |
| 2761 | } | 2759 | } |
| @@ -2775,7 +2773,7 @@ by `current-window-configuration' (which see).") | |||
| 2775 | Lisp_Object frame; | 2773 | Lisp_Object frame; |
| 2776 | FRAME_PTR f; | 2774 | FRAME_PTR f; |
| 2777 | 2775 | ||
| 2778 | while (XTYPE (configuration) != Lisp_Window_Configuration) | 2776 | while (!WINDOW_CONFIGURATIONP (configuration)) |
| 2779 | { | 2777 | { |
| 2780 | configuration = wrong_type_argument (intern ("window-configuration-p"), | 2778 | configuration = wrong_type_argument (intern ("window-configuration-p"), |
| 2781 | configuration); | 2779 | configuration); |
| @@ -2870,7 +2868,7 @@ by `current-window-configuration' (which see).") | |||
| 2870 | 2868 | ||
| 2871 | /* If we squirreled away the buffer in the window's height, | 2869 | /* If we squirreled away the buffer in the window's height, |
| 2872 | restore it now. */ | 2870 | restore it now. */ |
| 2873 | if (XTYPE (w->height) == Lisp_Buffer) | 2871 | if (BUFFERP (w->height)) |
| 2874 | w->buffer = w->height; | 2872 | w->buffer = w->height; |
| 2875 | w->left = p->left; | 2873 | w->left = p->left; |
| 2876 | w->top = p->top; | 2874 | w->top = p->top; |
| @@ -2939,7 +2937,7 @@ by `current-window-configuration' (which see).") | |||
| 2939 | 2937 | ||
| 2940 | #ifdef MULTI_FRAME | 2938 | #ifdef MULTI_FRAME |
| 2941 | if (NILP (data->focus_frame) | 2939 | if (NILP (data->focus_frame) |
| 2942 | || (XTYPE (data->focus_frame) == Lisp_Frame | 2940 | || (FRAMEP (data->focus_frame) |
| 2943 | && FRAME_LIVE_P (XFRAME (data->focus_frame)))) | 2941 | && FRAME_LIVE_P (XFRAME (data->focus_frame)))) |
| 2944 | Fredirect_frame_focus (frame, data->focus_frame); | 2942 | Fredirect_frame_focus (frame, data->focus_frame); |
| 2945 | #endif | 2943 | #endif |