/[emacs]/emacs/src/window.c
ViewVC logotype

Diff of /emacs/src/window.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.387 by pj, Thu Nov 1 14:23:38 2001 UTC revision 1.388 by pj, Fri Nov 2 20:36:19 2001 UTC
# Line 294  used by that frame.  */) Line 294  used by that frame.  */)
294  {  {
295    if (NILP (frame))    if (NILP (frame))
296      frame = selected_frame;      frame = selected_frame;
297    CHECK_LIVE_FRAME (frame, 0);    CHECK_LIVE_FRAME (frame);
298    return FRAME_MINIBUF_WINDOW (XFRAME (frame));    return FRAME_MINIBUF_WINDOW (XFRAME (frame));
299  }  }
300    
# Line 331  POS defaults to point in WINDOW; WINDOW Line 331  POS defaults to point in WINDOW; WINDOW
331    
332    if (!NILP (pos))    if (!NILP (pos))
333      {      {
334        CHECK_NUMBER_COERCE_MARKER (pos, 0);        CHECK_NUMBER_COERCE_MARKER (pos);
335        posint = XINT (pos);        posint = XINT (pos);
336      }      }
337    else if (w == XWINDOW (selected_window))    else if (w == XWINDOW (selected_window))
# Line 382  decode_window (window) Line 382  decode_window (window)
382    if (NILP (window))    if (NILP (window))
383      return XWINDOW (selected_window);      return XWINDOW (selected_window);
384    
385    CHECK_LIVE_WINDOW (window, 0);    CHECK_LIVE_WINDOW (window);
386    return XWINDOW (window);    return XWINDOW (window);
387  }  }
388    
# Line 430  NCOL should be zero or positive.  */) Line 430  NCOL should be zero or positive.  */)
430    struct window *w = decode_window (window);    struct window *w = decode_window (window);
431    int hscroll;    int hscroll;
432    
433    CHECK_NUMBER (ncol, 1);    CHECK_NUMBER (ncol);
434    hscroll = max (0, XINT (ncol));    hscroll = max (0, XINT (ncol));
435        
436    /* Prevent redisplay shortcuts when changing the hscroll.  */    /* Prevent redisplay shortcuts when changing the hscroll.  */
# Line 678  If they are on the border between WINDOW Line 678  If they are on the border between WINDOW
678    int x, y;    int x, y;
679    Lisp_Object lx, ly;    Lisp_Object lx, ly;
680    
681    CHECK_LIVE_WINDOW (window, 0);    CHECK_LIVE_WINDOW (window);
682    w = XWINDOW (window);    w = XWINDOW (window);
683    f = XFRAME (w->frame);    f = XFRAME (w->frame);
684    CHECK_CONS (coordinates, 1);    CHECK_CONS (coordinates);
685    lx = Fcar (coordinates);    lx = Fcar (coordinates);
686    ly = Fcdr (coordinates);    ly = Fcdr (coordinates);
687    CHECK_NUMBER_OR_FLOAT (lx, 1);    CHECK_NUMBER_OR_FLOAT (lx);
688    CHECK_NUMBER_OR_FLOAT (ly, 1);    CHECK_NUMBER_OR_FLOAT (ly);
689    x = PIXEL_X_FROM_CANON_X (f, lx);    x = PIXEL_X_FROM_CANON_X (f, lx);
690    y = PIXEL_Y_FROM_CANON_Y (f, ly);    y = PIXEL_Y_FROM_CANON_Y (f, ly);
691    
# Line 816  column 0.  */) Line 816  column 0.  */)
816    
817    if (NILP (frame))    if (NILP (frame))
818      frame = selected_frame;      frame = selected_frame;
819    CHECK_LIVE_FRAME (frame, 2);    CHECK_LIVE_FRAME (frame);
820    f = XFRAME (frame);    f = XFRAME (frame);
821    
822    /* Check that arguments are integers or floats.  */    /* Check that arguments are integers or floats.  */
823    CHECK_NUMBER_OR_FLOAT (x, 0);    CHECK_NUMBER_OR_FLOAT (x);
824    CHECK_NUMBER_OR_FLOAT (y, 1);    CHECK_NUMBER_OR_FLOAT (y);
825    
826    return window_from_coordinates (f,    return window_from_coordinates (f,
827                                    PIXEL_X_FROM_CANON_X (f, x),                                    PIXEL_X_FROM_CANON_X (f, x),
# Line 885  if it isn't already recorded.  */) Line 885  if it isn't already recorded.  */)
885    Lisp_Object buf;    Lisp_Object buf;
886    
887    buf = w->buffer;    buf = w->buffer;
888    CHECK_BUFFER (buf, 0);    CHECK_BUFFER (buf);
889    
890  #if 0 /* This change broke some things.  We should make it later.  */  #if 0 /* This change broke some things.  We should make it later.  */
891    /* If we don't know the end position, return nil.    /* If we don't know the end position, return nil.
# Line 946  DEFUN ("set-window-point", Fset_window_p Line 946  DEFUN ("set-window-point", Fset_window_p
946  {  {
947    register struct window *w = decode_window (window);    register struct window *w = decode_window (window);
948    
949    CHECK_NUMBER_COERCE_MARKER (pos, 1);    CHECK_NUMBER_COERCE_MARKER (pos);
950    if (w == XWINDOW (selected_window)    if (w == XWINDOW (selected_window)
951        && XBUFFER (w->buffer) == current_buffer)        && XBUFFER (w->buffer) == current_buffer)
952      Fgoto_char (pos);      Fgoto_char (pos);
# Line 970  from overriding motion of point in order Line 970  from overriding motion of point in order
970  {  {
971    register struct window *w = decode_window (window);    register struct window *w = decode_window (window);
972    
973    CHECK_NUMBER_COERCE_MARKER (pos, 1);    CHECK_NUMBER_COERCE_MARKER (pos);
974    set_marker_restricted (w->start, pos, w->buffer);    set_marker_restricted (w->start, pos, w->buffer);
975    /* this is not right, but much easier than doing what is right. */    /* this is not right, but much easier than doing what is right. */
976    w->start_at_line_beg = Qnil;    w->start_at_line_beg = Qnil;
# Line 1195  delete_window (window) Line 1195  delete_window (window)
1195    if (NILP (window))    if (NILP (window))
1196      window = selected_window;      window = selected_window;
1197    else    else
1198      CHECK_WINDOW (window, 0);      CHECK_WINDOW (window);
1199    p = XWINDOW (window);    p = XWINDOW (window);
1200    
1201    /* It's okay to delete an already-deleted window.  */    /* It's okay to delete an already-deleted window.  */
# Line 1448  decode_next_window_args (window, minibuf Line 1448  decode_next_window_args (window, minibuf
1448    if (NILP (*window))    if (NILP (*window))
1449      *window = selected_window;      *window = selected_window;
1450    else    else
1451      CHECK_LIVE_WINDOW (*window, 0);      CHECK_LIVE_WINDOW (*window);
1452        
1453    /* MINIBUF nil may or may not include minibuffers.  Decide if it    /* MINIBUF nil may or may not include minibuffers.  Decide if it
1454       does.  */       does.  */
# Line 1632  argument ALL_FRAMES is non-nil, cycle th Line 1632  argument ALL_FRAMES is non-nil, cycle th
1632    Lisp_Object window;    Lisp_Object window;
1633    int i;    int i;
1634    
1635    CHECK_NUMBER (arg, 0);    CHECK_NUMBER (arg);
1636    window = selected_window;    window = selected_window;
1637        
1638    for (i = XINT (arg); i > 0; --i)    for (i = XINT (arg); i > 0; --i)
# Line 1990  value is reasonable when this function i Line 1990  value is reasonable when this function i
1990    if (NILP (window))    if (NILP (window))
1991      window = selected_window;      window = selected_window;
1992    else    else
1993      CHECK_LIVE_WINDOW (window, 0);      CHECK_LIVE_WINDOW (window);
1994    w = XWINDOW (window);    w = XWINDOW (window);
1995    
1996    startpos = marker_position (w->start);    startpos = marker_position (w->start);
# Line 2056  If FRAME is a frame, search only that fr Line 2056  If FRAME is a frame, search only that fr
2056    if (!NILP (buffer))    if (!NILP (buffer))
2057      {      {
2058        buffer = Fget_buffer (buffer);        buffer = Fget_buffer (buffer);
2059        CHECK_BUFFER (buffer, 0);        CHECK_BUFFER (buffer);
2060        window_loop (DELETE_BUFFER_WINDOWS, buffer, 0, frame);        window_loop (DELETE_BUFFER_WINDOWS, buffer, 0, frame);
2061      }      }
2062        
# Line 2073  DEFUN ("replace-buffer-in-windows", Frep Line 2073  DEFUN ("replace-buffer-in-windows", Frep
2073    if (!NILP (buffer))    if (!NILP (buffer))
2074      {      {
2075        buffer = Fget_buffer (buffer);        buffer = Fget_buffer (buffer);
2076        CHECK_BUFFER (buffer, 0);        CHECK_BUFFER (buffer);
2077        window_loop (UNSHOW_BUFFER, buffer, 0, Qt);        window_loop (UNSHOW_BUFFER, buffer, 0, Qt);
2078      }      }
2079    return Qnil;    return Qnil;
# Line 2660  BUFFER can be a buffer or buffer name. Line 2660  BUFFER can be a buffer or buffer name.
2660    
2661    XSETWINDOW (window, w);    XSETWINDOW (window, w);
2662    buffer = Fget_buffer (buffer);    buffer = Fget_buffer (buffer);
2663    CHECK_BUFFER (buffer, 1);    CHECK_BUFFER (buffer);
2664    
2665    if (NILP (XBUFFER (buffer)->name))    if (NILP (XBUFFER (buffer)->name))
2666      error ("Attempt to display deleted buffer");      error ("Attempt to display deleted buffer");
# Line 2705  select_window_1 (window, recordflag) Line 2705  select_window_1 (window, recordflag)
2705    register struct window *ow;    register struct window *ow;
2706    struct frame *sf;    struct frame *sf;
2707    
2708    CHECK_LIVE_WINDOW (window, 0);    CHECK_LIVE_WINDOW (window);
2709    
2710    w = XWINDOW (window);    w = XWINDOW (window);
2711    w->frozen_window_start_p = 0;    w->frozen_window_start_p = 0;
# Line 2802  See `special-display-buffer-names', and Line 2802  See `special-display-buffer-names', and
2802  {  {
2803    Lisp_Object tem;    Lisp_Object tem;
2804    
2805    CHECK_STRING (buffer_name, 1);    CHECK_STRING (buffer_name);
2806    
2807    tem = Fmember (buffer_name, Vspecial_display_buffer_names);    tem = Fmember (buffer_name, Vspecial_display_buffer_names);
2808    if (!NILP (tem))    if (!NILP (tem))
# Line 2834  See `same-window-buffer-names' and `same Line 2834  See `same-window-buffer-names' and `same
2834  {  {
2835    Lisp_Object tem;    Lisp_Object tem;
2836    
2837    CHECK_STRING (buffer_name, 1);    CHECK_STRING (buffer_name);
2838    
2839    tem = Fmember (buffer_name, Vsame_window_buffer_names);    tem = Fmember (buffer_name, Vsame_window_buffer_names);
2840    if (!NILP (tem))    if (!NILP (tem))
# Line 2895  displayed.  */) Line 2895  displayed.  */)
2895    
2896    swp = Qnil;    swp = Qnil;
2897    buffer = Fget_buffer (buffer);    buffer = Fget_buffer (buffer);
2898    CHECK_BUFFER (buffer, 0);    CHECK_BUFFER (buffer);
2899    
2900    if (!NILP (Vdisplay_buffer_function))    if (!NILP (Vdisplay_buffer_function))
2901      return call2 (Vdisplay_buffer_function, buffer, not_this_window);      return call2 (Vdisplay_buffer_function, buffer, not_this_window);
# Line 3165  SIZE includes that window's scroll bar, Line 3165  SIZE includes that window's scroll bar,
3165    if (NILP (window))    if (NILP (window))
3166      window = selected_window;      window = selected_window;
3167    else    else
3168      CHECK_LIVE_WINDOW (window, 0);      CHECK_LIVE_WINDOW (window);
3169    
3170    o = XWINDOW (window);    o = XWINDOW (window);
3171    fo = XFRAME (WINDOW_FRAME (o));    fo = XFRAME (WINDOW_FRAME (o));
# Line 3183  SIZE includes that window's scroll bar, Line 3183  SIZE includes that window's scroll bar,
3183      }      }
3184    else    else
3185      {      {
3186        CHECK_NUMBER (size, 1);        CHECK_NUMBER (size);
3187        size_int = XINT (size);        size_int = XINT (size);
3188      }      }
3189    
# Line 3278  Interactively, if an argument is not giv Line 3278  Interactively, if an argument is not giv
3278       (arg, side)       (arg, side)
3279       register Lisp_Object arg, side;       register Lisp_Object arg, side;
3280  {  {
3281    CHECK_NUMBER (arg, 0);    CHECK_NUMBER (arg);
3282    enlarge_window (selected_window, XINT (arg), !NILP (side));    enlarge_window (selected_window, XINT (arg), !NILP (side));
3283    
3284    if (! NILP (Vwindow_configuration_change_hook))    if (! NILP (Vwindow_configuration_change_hook))
# Line 3294  Interactively, if an argument is not giv Line 3294  Interactively, if an argument is not giv
3294       (arg, side)       (arg, side)
3295       register Lisp_Object arg, side;       register Lisp_Object arg, side;
3296  {  {
3297    CHECK_NUMBER (arg, 0);    CHECK_NUMBER (arg);
3298    enlarge_window (selected_window, -XINT (arg), !NILP (side));    enlarge_window (selected_window, -XINT (arg), !NILP (side));
3299    
3300    if (! NILP (Vwindow_configuration_change_hook))    if (! NILP (Vwindow_configuration_change_hook))
# Line 4349  showing that buffer is used.  */) Line 4349  showing that buffer is used.  */)
4349                 && ! EQ (window, selected_window));                 && ! EQ (window, selected_window));
4350      }      }
4351    
4352    CHECK_LIVE_WINDOW (window, 0);    CHECK_LIVE_WINDOW (window);
4353    
4354    if (EQ (window, selected_window))    if (EQ (window, selected_window))
4355      error ("There is no other window");      error ("There is no other window");
# Line 4394  showing that buffer, popping the buffer Line 4394  showing that buffer, popping the buffer
4394      {      {
4395        if (CONSP (arg))        if (CONSP (arg))
4396          arg = Fcar (arg);          arg = Fcar (arg);
4397        CHECK_NUMBER (arg, 0);        CHECK_NUMBER (arg);
4398        window_scroll (window, XINT (arg), 0, 1);        window_scroll (window, XINT (arg), 0, 1);
4399      }      }
4400    
# Line 4549  and redisplay normally--don't erase and Line 4549  and redisplay normally--don't erase and
4549    else    else
4550      {      {
4551        arg = Fprefix_numeric_value (arg);        arg = Fprefix_numeric_value (arg);
4552        CHECK_NUMBER (arg, 0);        CHECK_NUMBER (arg);
4553      }      }
4554    
4555    set_buffer_internal (buf);    set_buffer_internal (buf);
# Line 5271  redirection (see `redirect-frame-focus') Line 5271  redirection (see `redirect-frame-focus')
5271    
5272    if (NILP (frame))    if (NILP (frame))
5273      frame = selected_frame;      frame = selected_frame;
5274    CHECK_LIVE_FRAME (frame, 0);    CHECK_LIVE_FRAME (frame);
5275    f = XFRAME (frame);    f = XFRAME (frame);
5276    
5277    n_windows = count_windows (XWINDOW (FRAME_ROOT_WINDOW (f)));    n_windows = count_windows (XWINDOW (FRAME_ROOT_WINDOW (f)));
# Line 5340  A nil width parameter means no margin. Line 5340  A nil width parameter means no margin.
5340    struct window *w = decode_window (window);    struct window *w = decode_window (window);
5341    
5342    if (!NILP (left))    if (!NILP (left))
5343      CHECK_NUMBER_OR_FLOAT (left, 1);      CHECK_NUMBER_OR_FLOAT (left);
5344    if (!NILP (right))    if (!NILP (right))
5345      CHECK_NUMBER_OR_FLOAT (right, 2);      CHECK_NUMBER_OR_FLOAT (right);
5346    
5347    /* Check widths < 0 and translate a zero width to nil.    /* Check widths < 0 and translate a zero width to nil.
5348       Margins that are too wide have to be checked elsewhere.  */       Margins that are too wide have to be checked elsewhere.  */
# Line 5401  Value is a multiple of the canonical cha Line 5401  Value is a multiple of the canonical cha
5401    if (NILP (window))    if (NILP (window))
5402      window = selected_window;      window = selected_window;
5403    else    else
5404      CHECK_WINDOW (window, 0);      CHECK_WINDOW (window);
5405    w = XWINDOW (window);    w = XWINDOW (window);
5406    f = XFRAME (w->frame);    f = XFRAME (w->frame);
5407        
# Line 5427  non-negative multiple of the canonical c Line 5427  non-negative multiple of the canonical c
5427    if (NILP (window))    if (NILP (window))
5428      window = selected_window;      window = selected_window;
5429    else    else
5430      CHECK_WINDOW (window, 0);      CHECK_WINDOW (window);
5431    CHECK_NUMBER_OR_FLOAT (vscroll, 1);    CHECK_NUMBER_OR_FLOAT (vscroll);
5432        
5433    w = XWINDOW (window);    w = XWINDOW (window);
5434    f = XFRAME (w->frame);    f = XFRAME (w->frame);

Legend:
Removed from v.1.387  
changed lines
  Added in v.1.388

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26