/[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.152 by ttn, Mon Jun 3 01:52:02 2002 UTC revision 1.152.2.1 by miles, Fri Apr 4 06:20:58 2003 UTC
# Line 47  int indent_tabs_mode; Line 47  int indent_tabs_mode;
47     Some things in set last_known_column_point to -1     Some things in set last_known_column_point to -1
48     to mark the memorized value as invalid.  */     to mark the memorized value as invalid.  */
49    
50  float last_known_column;  double last_known_column;
51    
52  /* Value of point when current_column was called.  */  /* Value of point when current_column was called.  */
53    
# Line 57  int last_known_column_point; Line 57  int last_known_column_point;
57    
58  int last_known_column_modified;  int last_known_column_modified;
59    
60  static float current_column_1 P_ ((void));  static double current_column_1 P_ ((void));
61  static float position_indentation P_ ((int));  static double position_indentation P_ ((int));
62    
63  /* Cache of beginning of line found by the last call of  /* Cache of beginning of line found by the last call of
64     current_column. */     current_column. */
# Line 355  invalidate_current_column () Line 355  invalidate_current_column ()
355    last_known_column_point = 0;    last_known_column_point = 0;
356  }  }
357    
358  float  double
359  current_column ()  current_column ()
360  {  {
361    register int col;    register int col;
# Line 502  current_column () Line 502  current_column ()
502     This function handles characters that are invisible     This function handles characters that are invisible
503     due to text properties or overlays.  */     due to text properties or overlays.  */
504    
505  static float  static double
506  current_column_1 ()  current_column_1 ()
507  {  {
508    register int tab_width = XINT (current_buffer->tab_width);    register int tab_width = XINT (current_buffer->tab_width);
# Line 652  current_column_1 () Line 652  current_column_1 ()
652     If BEG is nil, that stands for the beginning of STRING.     If BEG is nil, that stands for the beginning of STRING.
653     If END is nil, that stands for the end of STRING.  */     If END is nil, that stands for the end of STRING.  */
654    
655  static float  static double
656  string_display_width (string, beg, end)  string_display_width (string, beg, end)
657       Lisp_Object string, beg, end;       Lisp_Object string, beg, end;
658  {  {
# Line 667  string_display_width (string, beg, end) Line 667  string_display_width (string, beg, end)
667    int b, e;    int b, e;
668    
669    if (NILP (end))    if (NILP (end))
670      e = XSTRING (string)->size;      e = SCHARS (string);
671    else    else
672      {      {
673        CHECK_NUMBER (end);        CHECK_NUMBER (end);
# Line 683  string_display_width (string, beg, end) Line 683  string_display_width (string, beg, end)
683      }      }
684    
685    /* Make a pointer for decrementing through the chars before point.  */    /* Make a pointer for decrementing through the chars before point.  */
686    ptr = XSTRING (string)->data + e;    ptr = SDATA (string) + e;
687    /* Make a pointer to where consecutive chars leave off,    /* Make a pointer to where consecutive chars leave off,
688       going backwards from point.  */       going backwards from point.  */
689    stop = XSTRING (string)->data + b;    stop = SDATA (string) + b;
690    
691    if (tab_width <= 0 || tab_width > 1000) tab_width = 8;    if (tab_width <= 0 || tab_width > 1000) tab_width = 8;
692    
# Line 778  even if that goes past COLUMN; by defaul Line 778  even if that goes past COLUMN; by defaul
778  }  }
779    
780    
781  static float position_indentation P_ ((int));  static double position_indentation P_ ((int));
782    
783  DEFUN ("current-indentation", Fcurrent_indentation, Scurrent_indentation,  DEFUN ("current-indentation", Fcurrent_indentation, Scurrent_indentation,
784         0, 0, 0,         0, 0, 0,
# Line 797  following any initial whitespace.  */) Line 797  following any initial whitespace.  */)
797    return val;    return val;
798  }  }
799    
800  static float  static double
801  position_indentation (pos_byte)  position_indentation (pos_byte)
802       register int pos_byte;       register int pos_byte;
803  {  {
# Line 890  position_indentation (pos_byte) Line 890  position_indentation (pos_byte)
890  int  int
891  indented_beyond_p (pos, pos_byte, column)  indented_beyond_p (pos, pos_byte, column)
892       int pos, pos_byte;       int pos, pos_byte;
893       float column;       double column;
894  {  {
895    float val;    double val;
896    int opoint = PT, opoint_byte = PT_BYTE;    int opoint = PT, opoint_byte = PT_BYTE;
897    
898    SET_PT_BOTH (pos, pos_byte);    SET_PT_BOTH (pos, pos_byte);
# Line 1612  compute_motion (from, fromvpos, fromhpos Line 1612  compute_motion (from, fromvpos, fromhpos
1612                  {                  {
1613                    if (selective > 0                    if (selective > 0
1614                        && indented_beyond_p (pos, pos_byte,                        && indented_beyond_p (pos, pos_byte,
1615                                              (float) selective)) /* iftc */                                              (double) selective)) /* iftc */
1616                      {                      {
1617                        /* If (pos == to), we don't have to take care of                        /* If (pos == to), we don't have to take care of
1618                           selective display.  */                           selective display.  */
# Line 1628  compute_motion (from, fromvpos, fromhpos Line 1628  compute_motion (from, fromvpos, fromhpos
1628                              }                              }
1629                            while (pos < to                            while (pos < to
1630                                   && indented_beyond_p (pos, pos_byte,                                   && indented_beyond_p (pos, pos_byte,
1631                                                         (float) selective)); /* iftc */                                                         (double) selective)); /* iftc */
1632                            /* Allow for the " ..." that is displayed for them. */                            /* Allow for the " ..." that is displayed for them. */
1633                            if (selective_rlen)                            if (selective_rlen)
1634                              {                              {
# Line 1878  vmotion (from, vtarget, w) Line 1878  vmotion (from, vtarget, w)
1878                   && ((selective > 0                   && ((selective > 0
1879                        && indented_beyond_p (XFASTINT (prevline),                        && indented_beyond_p (XFASTINT (prevline),
1880                                              CHAR_TO_BYTE (XFASTINT (prevline)),                                              CHAR_TO_BYTE (XFASTINT (prevline)),
1881                                              (float) selective)) /* iftc */                                              (double) selective)) /* iftc */
1882                       /* watch out for newlines with `invisible' property */                       /* watch out for newlines with `invisible' property */
1883                       || (propval = Fget_char_property (prevline,                       || (propval = Fget_char_property (prevline,
1884                                                         Qinvisible,                                                         Qinvisible,
# Line 1938  vmotion (from, vtarget, w) Line 1938  vmotion (from, vtarget, w)
1938               && ((selective > 0               && ((selective > 0
1939                    && indented_beyond_p (XFASTINT (prevline),                    && indented_beyond_p (XFASTINT (prevline),
1940                                          CHAR_TO_BYTE (XFASTINT (prevline)),                                          CHAR_TO_BYTE (XFASTINT (prevline)),
1941                                          (float) selective)) /* iftc */                                          (double) selective)) /* iftc */
1942                   /* watch out for newlines with `invisible' property */                   /* watch out for newlines with `invisible' property */
1943                   || (propval = Fget_char_property (prevline, Qinvisible,                   || (propval = Fget_char_property (prevline, Qinvisible,
1944                                                     text_prop_object),                                                     text_prop_object),
# Line 2023  whether or not it is currently displayed Line 2023  whether or not it is currently displayed
2023    SET_TEXT_POS (pt, PT, PT_BYTE);    SET_TEXT_POS (pt, PT, PT_BYTE);
2024    start_display (&it, w, pt);    start_display (&it, w, pt);
2025    
2026    /* Move to the start of the line containing PT.  If we don't do    /* Move to the start of the display line containing PT.  If we don't
2027       this, we start moving with IT->current_x == 0, while PT is really       do this, we start moving with IT->current_x == 0, while PT is
2028       at some x > 0.  The effect is, in continuation lines, that we end       really at some x > 0.  The effect is, in continuation lines, that
2029       up with the iterator placed at where it thinks X is 0, while the       we end up with the iterator placed at where it thinks X is 0,
2030       end position is really at some X > 0, the same X that PT had.  */       while the end position is really at some X > 0, the same X that
2031         PT had.  */
2032    move_it_by_lines (&it, 0, 0);    move_it_by_lines (&it, 0, 0);
2033    
2034    if (XINT (lines) != 0)    if (XINT (lines) != 0)

Legend:
Removed from v.1.152  
changed lines
  Added in v.1.152.2.1

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