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

Diff of /emacs/src/indent.c

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

revision 1.161 by monnier, Sun May 2 16:57:32 2004 UTC revision 1.162 by kfstorm, Mon Aug 2 15:06:06 2004 UTC
# Line 1131  struct position val_compute_motion; Line 1131  struct position val_compute_motion;
1131    
1132     WIDTH is the number of columns available to display text;     WIDTH is the number of columns available to display text;
1133     compute_motion uses this to handle continuation lines and such.     compute_motion uses this to handle continuation lines and such.
1134       If WIDTH is -1, use width of window's text area adjusted for
1135       continuation glyph when needed.
1136    
1137     HSCROLL is the number of columns not being displayed at the left     HSCROLL is the number of columns not being displayed at the left
1138     margin; this is usually taken from a window's hscroll member.     margin; this is usually taken from a window's hscroll member.
1139     TAB_OFFSET is the number of columns of the first tab that aren't     TAB_OFFSET is the number of columns of the first tab that aren't
# Line 1245  compute_motion (from, fromvpos, fromhpos Line 1248  compute_motion (from, fromvpos, fromhpos
1248    if (tab_width <= 0 || tab_width > 1000)    if (tab_width <= 0 || tab_width > 1000)
1249      tab_width = 8;      tab_width = 8;
1250    
1251      /* Negative width means use all available text columns.  */
1252      if (width < 0)
1253        {
1254          width = window_box_text_cols (win);
1255          /* We must make room for continuation marks if we don't have fringes.  */
1256    #ifdef HAVE_WINDOW_SYSTEM
1257          if (!FRAME_WINDOW_P (XFRAME (win->frame)))
1258    #endif
1259            width -= 1;
1260        }
1261    
1262    immediate_quit = 1;    immediate_quit = 1;
1263    QUIT;    QUIT;
1264    
# Line 1368  compute_motion (from, fromvpos, fromhpos Line 1382  compute_motion (from, fromvpos, fromhpos
1382          {          {
1383            if (hscroll            if (hscroll
1384                || (truncate_partial_width_windows                || (truncate_partial_width_windows
1385                    && width + 1 < FRAME_COLS (XFRAME (WINDOW_FRAME (win))))                    && width < FRAME_COLS (XFRAME (WINDOW_FRAME (win))))
1386                || !NILP (current_buffer->truncate_lines))                || !NILP (current_buffer->truncate_lines))
1387              {              {
1388                /* Truncating: skip to newline, unless we are already past                /* Truncating: skip to newline, unless we are already past
# Line 1737  assuming it is at position FROMPOS--a co Line 1751  assuming it is at position FROMPOS--a co
1751  to position TO or position TOPOS--another cons of the form (HPOS . VPOS)--  to position TO or position TOPOS--another cons of the form (HPOS . VPOS)--
1752  and return the ending buffer position and screen location.  and return the ending buffer position and screen location.
1753    
1754    If TOPOS is nil, the actual width and height of the window's
1755    text area are used.
1756    
1757  There are three additional arguments:  There are three additional arguments:
1758    
1759  WIDTH is the number of columns available to display text;  WIDTH is the number of columns available to display text;
1760  this affects handling of continuation lines.  this affects handling of continuation lines.  A value of nil
1761  This is usually the value returned by `window-width', less one (to allow  corresponds to the actual number of available text columns.
 for the continuation glyph).  
1762    
1763  OFFSETS is either nil or a cons cell (HSCROLL . TAB-OFFSET).  OFFSETS is either nil or a cons cell (HSCROLL . TAB-OFFSET).
1764  HSCROLL is the number of columns not being displayed at the left  HSCROLL is the number of columns not being displayed at the left
# Line 1774  visible section of the buffer, and pass Line 1790  visible section of the buffer, and pass
1790       Lisp_Object from, frompos, to, topos;       Lisp_Object from, frompos, to, topos;
1791       Lisp_Object width, offsets, window;       Lisp_Object width, offsets, window;
1792  {  {
1793      struct window *w;
1794    Lisp_Object bufpos, hpos, vpos, prevhpos;    Lisp_Object bufpos, hpos, vpos, prevhpos;
1795    struct position *pos;    struct position *pos;
1796    int hscroll, tab_offset;    int hscroll, tab_offset;
# Line 1783  visible section of the buffer, and pass Line 1800  visible section of the buffer, and pass
1800    CHECK_NUMBER_CAR (frompos);    CHECK_NUMBER_CAR (frompos);
1801    CHECK_NUMBER_CDR (frompos);    CHECK_NUMBER_CDR (frompos);
1802    CHECK_NUMBER_COERCE_MARKER (to);    CHECK_NUMBER_COERCE_MARKER (to);
1803    CHECK_CONS (topos);    if (!NILP (topos))
1804    CHECK_NUMBER_CAR (topos);      {
1805    CHECK_NUMBER_CDR (topos);        CHECK_CONS (topos);
1806    CHECK_NUMBER (width);        CHECK_NUMBER_CAR (topos);
1807          CHECK_NUMBER_CDR (topos);
1808        }
1809      if (!NILP (width))
1810        CHECK_NUMBER (width);
1811    
1812    if (!NILP (offsets))    if (!NILP (offsets))
1813      {      {
1814        CHECK_CONS (offsets);        CHECK_CONS (offsets);
# Line 1802  visible section of the buffer, and pass Line 1824  visible section of the buffer, and pass
1824      window = Fselected_window ();      window = Fselected_window ();
1825    else    else
1826      CHECK_LIVE_WINDOW (window);      CHECK_LIVE_WINDOW (window);
1827      w = XWINDOW (window);
1828    
1829    if (XINT (from) < BEGV || XINT (from) > ZV)    if (XINT (from) < BEGV || XINT (from) > ZV)
1830      args_out_of_range_3 (from, make_number (BEGV), make_number (ZV));      args_out_of_range_3 (from, make_number (BEGV), make_number (ZV));
# Line 1810  visible section of the buffer, and pass Line 1833  visible section of the buffer, and pass
1833    
1834    pos = compute_motion (XINT (from), XINT (XCDR (frompos)),    pos = compute_motion (XINT (from), XINT (XCDR (frompos)),
1835                          XINT (XCAR (frompos)), 0,                          XINT (XCAR (frompos)), 0,
1836                          XINT (to), XINT (XCDR (topos)),                          XINT (to),
1837                          XINT (XCAR (topos)),                          (NILP (topos)
1838                          XINT (width), hscroll, tab_offset,                           ? window_internal_height (w)
1839                             : XINT (XCDR (topos))),
1840                            (NILP (topos)
1841                             ? (window_box_text_cols (w)
1842                                - (
1843    #ifdef HAVE_WINDOW_SYSTEM
1844                                   FRAME_WINDOW_P (XFRAME (w->frame)) ? 0 :
1845    #endif
1846                                   1))
1847                             : XINT (XCAR (topos))),
1848                            (NILP (width) ? -1 : XINT (width)),
1849                            hscroll, tab_offset,
1850                          XWINDOW (window));                          XWINDOW (window));
1851    
1852    XSETFASTINT (bufpos, pos->bufpos);    XSETFASTINT (bufpos, pos->bufpos);
# Line 1837  vmotion (from, vtarget, w) Line 1871  vmotion (from, vtarget, w)
1871       register int from, vtarget;       register int from, vtarget;
1872       struct window *w;       struct window *w;
1873  {  {
   int width = window_box_text_cols (w);  
1874    int hscroll = XINT (w->hscroll);    int hscroll = XINT (w->hscroll);
1875    struct position pos;    struct position pos;
1876    /* vpos is cumulative vertical position, changed as from is changed */    /* vpos is cumulative vertical position, changed as from is changed */
# Line 1858  vmotion (from, vtarget, w) Line 1891  vmotion (from, vtarget, w)
1891    
1892    XSETWINDOW (window, w);    XSETWINDOW (window, w);
1893    
   /* We must make room for continuation marks if we don't have fringes.  */  
 #ifdef HAVE_WINDOW_SYSTEM  
   if (!FRAME_WINDOW_P (XFRAME (w->frame)))  
 #endif  
     width -= 1;  
   
1894    /* If the window contains this buffer, use it for getting text properties.    /* If the window contains this buffer, use it for getting text properties.
1895       Otherwise use the current buffer as arg for doing that.  */       Otherwise use the current buffer as arg for doing that.  */
1896    if (EQ (w->buffer, Fcurrent_buffer ()))    if (EQ (w->buffer, Fcurrent_buffer ()))
# Line 1905  vmotion (from, vtarget, w) Line 1932  vmotion (from, vtarget, w)
1932                                   1 << (BITS_PER_SHORT - 1),                                   1 << (BITS_PER_SHORT - 1),
1933                                   /* ... nor HPOS.  */                                   /* ... nor HPOS.  */
1934                                   1 << (BITS_PER_SHORT - 1),                                   1 << (BITS_PER_SHORT - 1),
1935                                   width, hscroll,                                   -1, hscroll,
1936                                   /* This compensates for start_hpos                                   /* This compensates for start_hpos
1937                                      so that a tab as first character                                      so that a tab as first character
1938                                      still occupies 8 columns.  */                                      still occupies 8 columns.  */
# Line 1964  vmotion (from, vtarget, w) Line 1991  vmotion (from, vtarget, w)
1991                               1 << (BITS_PER_SHORT - 1),                               1 << (BITS_PER_SHORT - 1),
1992                               /* ... nor HPOS.  */                               /* ... nor HPOS.  */
1993                               1 << (BITS_PER_SHORT - 1),                               1 << (BITS_PER_SHORT - 1),
1994                               width, hscroll,                               -1, hscroll,
1995                               (XFASTINT (prevline) == BEG ? -start_hpos : 0),                               (XFASTINT (prevline) == BEG ? -start_hpos : 0),
1996                               w);                               w);
1997        did_motion = 1;        did_motion = 1;
# Line 1978  vmotion (from, vtarget, w) Line 2005  vmotion (from, vtarget, w)
2005      }      }
2006    return compute_motion (from, vpos, pos.hpos, did_motion,    return compute_motion (from, vpos, pos.hpos, did_motion,
2007                           ZV, vtarget, - (1 << (BITS_PER_SHORT - 1)),                           ZV, vtarget, - (1 << (BITS_PER_SHORT - 1)),
2008                           width, hscroll,                           -1, hscroll,
2009                           pos.tab_offset - (from == BEG ? start_hpos : 0),                           pos.tab_offset - (from == BEG ? start_hpos : 0),
2010                           w);                           w);
2011  }  }

Legend:
Removed from v.1.161  
changed lines
  Added in v.1.162

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