[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/indent.c
From: |
Thien-Thi Nguyen |
Subject: |
[Emacs-diffs] Changes to emacs/src/indent.c |
Date: |
Sun, 02 Jun 2002 21:52:02 -0400 |
Index: emacs/src/indent.c
diff -c emacs/src/indent.c:1.151 emacs/src/indent.c:1.152
*** emacs/src/indent.c:1.151 Thu Apr 25 08:13:58 2002
--- emacs/src/indent.c Sun Jun 2 21:52:02 2002
***************
*** 47,53 ****
Some things in set last_known_column_point to -1
to mark the memorized value as invalid. */
! int last_known_column;
/* Value of point when current_column was called. */
--- 47,53 ----
Some things in set last_known_column_point to -1
to mark the memorized value as invalid. */
! float last_known_column;
/* Value of point when current_column was called. */
***************
*** 57,64 ****
int last_known_column_modified;
! static int current_column_1 P_ ((void));
! static int position_indentation P_ ((int));
/* Cache of beginning of line found by the last call of
current_column. */
--- 57,64 ----
int last_known_column_modified;
! static float current_column_1 P_ ((void));
! static float position_indentation P_ ((int));
/* Cache of beginning of line found by the last call of
current_column. */
***************
*** 329,334 ****
--- 329,335 ----
}
\
} while (0)
+
DEFUN ("current-column", Fcurrent_column, Scurrent_column, 0, 0, 0,
doc: /* Return the horizontal position of point. Beginning of line is
column 0.
This is calculated by adding together the widths of all the displayed
***************
*** 342,348 ****
()
{
Lisp_Object temp;
! XSETFASTINT (temp, current_column ());
return temp;
}
--- 343,349 ----
()
{
Lisp_Object temp;
! XSETFASTINT (temp, (int) current_column ()); /* iftc */
return temp;
}
***************
*** 354,360 ****
last_known_column_point = 0;
}
! int
current_column ()
{
register int col;
--- 355,361 ----
last_known_column_point = 0;
}
! float
current_column ()
{
register int col;
***************
*** 401,425 ****
{
EMACS_INT i, n;
Lisp_Object charvec;
!
if (ptr == stop)
{
/* We stopped either for the beginning of the buffer
or for the gap. */
if (ptr == BEGV_ADDR)
break;
!
/* It was the gap. Jump back over it. */
stop = BEGV_ADDR;
ptr = GPT_ADDR;
!
/* Check whether that brings us to beginning of buffer. */
if (BEGV >= GPT)
break;
}
c = *--ptr;
!
if (dp && VECTORP (DISP_CHAR_VECTOR (dp, c)))
{
charvec = DISP_CHAR_VECTOR (dp, c);
--- 402,426 ----
{
EMACS_INT i, n;
Lisp_Object charvec;
!
if (ptr == stop)
{
/* We stopped either for the beginning of the buffer
or for the gap. */
if (ptr == BEGV_ADDR)
break;
!
/* It was the gap. Jump back over it. */
stop = BEGV_ADDR;
ptr = GPT_ADDR;
!
/* Check whether that brings us to beginning of buffer. */
if (BEGV >= GPT)
break;
}
c = *--ptr;
!
if (dp && VECTORP (DISP_CHAR_VECTOR (dp, c)))
{
charvec = DISP_CHAR_VECTOR (dp, c);
***************
*** 430,436 ****
charvec = Qnil;
n = 1;
}
!
for (i = n - 1; i >= 0; --i)
{
if (VECTORP (charvec))
--- 431,437 ----
charvec = Qnil;
n = 1;
}
!
for (i = n - 1; i >= 0; --i)
{
if (VECTORP (charvec))
***************
*** 438,451 ****
/* This should be handled the same as
next_element_from_display_vector does it. */
Lisp_Object entry = AREF (charvec, i);
!
if (INTEGERP (entry)
&& GLYPH_CHAR_VALID_P (XFASTINT (entry)))
c = FAST_GLYPH_CHAR (XFASTINT (entry));
else
c = ' ';
}
!
if (c >= 040 && c < 0177)
col++;
else if (c == '\n'
--- 439,452 ----
/* This should be handled the same as
next_element_from_display_vector does it. */
Lisp_Object entry = AREF (charvec, i);
!
if (INTEGERP (entry)
&& GLYPH_CHAR_VALID_P (XFASTINT (entry)))
c = FAST_GLYPH_CHAR (XFASTINT (entry));
else
c = ' ';
}
!
if (c >= 040 && c < 0177)
col++;
else if (c == '\n'
***************
*** 459,465 ****
{
if (tab_seen)
col = ((col + tab_width) / tab_width) * tab_width;
!
post_tab += col;
col = 0;
tab_seen = 1;
--- 460,466 ----
{
if (tab_seen)
col = ((col + tab_width) / tab_width) * tab_width;
!
post_tab += col;
col = 0;
tab_seen = 1;
***************
*** 501,507 ****
This function handles characters that are invisible
due to text properties or overlays. */
! static int
current_column_1 ()
{
register int tab_width = XINT (current_buffer->tab_width);
--- 502,508 ----
This function handles characters that are invisible
due to text properties or overlays. */
! static float
current_column_1 ()
{
register int tab_width = XINT (current_buffer->tab_width);
***************
*** 615,621 ****
{
unsigned char *ptr;
int bytes, width, wide_column;
!
ptr = BYTE_POS_ADDR (scan_byte);
MULTIBYTE_BYTES_WIDTH (ptr, dp);
scan_byte += bytes;
--- 616,622 ----
{
unsigned char *ptr;
int bytes, width, wide_column;
!
ptr = BYTE_POS_ADDR (scan_byte);
MULTIBYTE_BYTES_WIDTH (ptr, dp);
scan_byte += bytes;
***************
*** 651,657 ****
If BEG is nil, that stands for the beginning of STRING.
If END is nil, that stands for the end of STRING. */
! static int
string_display_width (string, beg, end)
Lisp_Object string, beg, end;
{
--- 652,658 ----
If BEG is nil, that stands for the beginning of STRING.
If END is nil, that stands for the end of STRING. */
! static float
string_display_width (string, beg, end)
Lisp_Object string, beg, end;
{
***************
*** 777,783 ****
}
! static int position_indentation P_ ((int));
DEFUN ("current-indentation", Fcurrent_indentation, Scurrent_indentation,
0, 0, 0,
--- 778,784 ----
}
! static float position_indentation P_ ((int));
DEFUN ("current-indentation", Fcurrent_indentation, Scurrent_indentation,
0, 0, 0,
***************
*** 791,802 ****
scan_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, -1, 1);
! XSETFASTINT (val, position_indentation (PT_BYTE));
SET_PT_BOTH (opoint, opoint_byte);
return val;
}
! static int
position_indentation (pos_byte)
register int pos_byte;
{
--- 792,803 ----
scan_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, -1, 1);
! XSETFASTINT (val, (int) position_indentation (PT_BYTE)); /* iftc */
SET_PT_BOTH (opoint, opoint_byte);
return val;
}
! static float
position_indentation (pos_byte)
register int pos_byte;
{
***************
*** 846,852 ****
/* The -1 and +1 arrange to point at the first byte of gap
(if STOP_POS_BYTE is the position of the gap)
rather than at the data after the gap. */
!
stop = BYTE_POS_ADDR (stop_pos_byte - 1) + 1;
p = BYTE_POS_ADDR (pos_byte);
}
--- 847,853 ----
/* The -1 and +1 arrange to point at the first byte of gap
(if STOP_POS_BYTE is the position of the gap)
rather than at the data after the gap. */
!
stop = BYTE_POS_ADDR (stop_pos_byte - 1) + 1;
p = BYTE_POS_ADDR (pos_byte);
}
***************
*** 888,896 ****
int
indented_beyond_p (pos, pos_byte, column)
! int pos, pos_byte, column;
{
! int val;
int opoint = PT, opoint_byte = PT_BYTE;
SET_PT_BOTH (pos, pos_byte);
--- 889,898 ----
int
indented_beyond_p (pos, pos_byte, column)
! int pos, pos_byte;
! float column;
{
! float val;
int opoint = PT, opoint_byte = PT_BYTE;
SET_PT_BOTH (pos, pos_byte);
***************
*** 899,905 ****
val = position_indentation (PT_BYTE);
SET_PT_BOTH (opoint, opoint_byte);
! return val >= column;
}
DEFUN ("move-to-column", Fmove_to_column, Smove_to_column, 1, 2, "p",
--- 901,907 ----
val = position_indentation (PT_BYTE);
SET_PT_BOTH (opoint, opoint_byte);
! return val >= column; /* hmm, float comparison */
}
DEFUN ("move-to-column", Fmove_to_column, Smove_to_column, 1, 2, "p",
***************
*** 1093,1099 ****
goal_pt_byte = PT_BYTE;
Findent_to (make_number (col), Qnil);
SET_PT_BOTH (goal_pt, goal_pt_byte);
!
/* Set the last_known... vars consistently. */
col = goal;
}
--- 1095,1101 ----
goal_pt_byte = PT_BYTE;
Findent_to (make_number (col), Qnil);
SET_PT_BOTH (goal_pt, goal_pt_byte);
!
/* Set the last_known... vars consistently. */
col = goal;
}
***************
*** 1352,1358 ****
W_ ^---- next after the point
^---- next char. after the point.
----------
! In case of wide-column character
The problem here is continuation at a wide-column character.
In this case, the line may shorter less than WIDTH.
--- 1354,1360 ----
W_ ^---- next after the point
^---- next char. after the point.
----------
! In case of wide-column character
The problem here is continuation at a wide-column character.
In this case, the line may shorter less than WIDTH.
***************
*** 1522,1528 ****
{
EMACS_INT i, n;
Lisp_Object charvec;
!
c = FETCH_BYTE (pos_byte);
/* Check composition sequence. */
--- 1524,1530 ----
{
EMACS_INT i, n;
Lisp_Object charvec;
!
c = FETCH_BYTE (pos_byte);
/* Check composition sequence. */
***************
*** 1588,1601 ****
/* This should be handled the same as
next_element_from_display_vector does it. */
Lisp_Object entry = AREF (charvec, i);
!
if (INTEGERP (entry)
&& GLYPH_CHAR_VALID_P (XFASTINT (entry)))
c = FAST_GLYPH_CHAR (XFASTINT (entry));
else
c = ' ';
}
!
if (c >= 040 && c < 0177)
hpos++;
else if (c == '\t')
--- 1590,1603 ----
/* This should be handled the same as
next_element_from_display_vector does it. */
Lisp_Object entry = AREF (charvec, i);
!
if (INTEGERP (entry)
&& GLYPH_CHAR_VALID_P (XFASTINT (entry)))
c = FAST_GLYPH_CHAR (XFASTINT (entry));
else
c = ' ';
}
!
if (c >= 040 && c < 0177)
hpos++;
else if (c == '\t')
***************
*** 1609,1615 ****
else if (c == '\n')
{
if (selective > 0
! && indented_beyond_p (pos, pos_byte, selective))
{
/* If (pos == to), we don't have to take care of
selective display. */
--- 1611,1618 ----
else if (c == '\n')
{
if (selective > 0
! && indented_beyond_p (pos, pos_byte,
! (float) selective)) /* iftc */
{
/* If (pos == to), we don't have to take care of
selective display. */
***************
*** 1624,1630 ****
pos_byte = CHAR_TO_BYTE (pos);
}
while (pos < to
! && indented_beyond_p (pos, pos_byte,
selective));
/* Allow for the " ..." that is displayed for them. */
if (selective_rlen)
{
--- 1627,1634 ----
pos_byte = CHAR_TO_BYTE (pos);
}
while (pos < to
! && indented_beyond_p (pos, pos_byte,
! (float) selective));
/* iftc */
/* Allow for the " ..." that is displayed for them. */
if (selective_rlen)
{
***************
*** 1874,1880 ****
&& ((selective > 0
&& indented_beyond_p (XFASTINT (prevline),
CHAR_TO_BYTE (XFASTINT (prevline)),
! selective))
/* watch out for newlines with `invisible' property */
|| (propval = Fget_char_property (prevline,
Qinvisible,
--- 1878,1884 ----
&& ((selective > 0
&& indented_beyond_p (XFASTINT (prevline),
CHAR_TO_BYTE (XFASTINT (prevline)),
! (float) selective)) /* iftc */
/* watch out for newlines with `invisible' property */
|| (propval = Fget_char_property (prevline,
Qinvisible,
***************
*** 1887,1893 ****
lmargin + (XFASTINT (prevline) == BEG
? start_hpos : 0),
0,
! from,
/* Don't care for VPOS... */
1 << (BITS_PER_SHORT - 1),
/* ... nor HPOS. */
--- 1891,1897 ----
lmargin + (XFASTINT (prevline) == BEG
? start_hpos : 0),
0,
! from,
/* Don't care for VPOS... */
1 << (BITS_PER_SHORT - 1),
/* ... nor HPOS. */
***************
*** 1934,1940 ****
&& ((selective > 0
&& indented_beyond_p (XFASTINT (prevline),
CHAR_TO_BYTE (XFASTINT (prevline)),
! selective))
/* watch out for newlines with `invisible' property */
|| (propval = Fget_char_property (prevline, Qinvisible,
text_prop_object),
--- 1938,1944 ----
&& ((selective > 0
&& indented_beyond_p (XFASTINT (prevline),
CHAR_TO_BYTE (XFASTINT (prevline)),
! (float) selective)) /* iftc */
/* watch out for newlines with `invisible' property */
|| (propval = Fget_char_property (prevline, Qinvisible,
text_prop_object),
***************
*** 1946,1952 ****
lmargin + (XFASTINT (prevline) == BEG
? start_hpos : 0),
0,
! from,
/* Don't care for VPOS... */
1 << (BITS_PER_SHORT - 1),
/* ... nor HPOS. */
--- 1950,1956 ----
lmargin + (XFASTINT (prevline) == BEG
? start_hpos : 0),
0,
! from,
/* Don't care for VPOS... */
1 << (BITS_PER_SHORT - 1),
/* ... nor HPOS. */
***************
*** 2015,2021 ****
old_buffer = w->buffer;
XSETBUFFER (w->buffer, current_buffer);
}
!
SET_TEXT_POS (pt, PT, PT_BYTE);
start_display (&it, w, pt);
--- 2019,2025 ----
old_buffer = w->buffer;
XSETBUFFER (w->buffer, current_buffer);
}
!
SET_TEXT_POS (pt, PT, PT_BYTE);
start_display (&it, w, pt);
***************
*** 2028,2039 ****
if (XINT (lines) != 0)
move_it_by_lines (&it, XINT (lines), 0);
!
SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
if (BUFFERP (old_buffer))
w->buffer = old_buffer;
!
RETURN_UNGCPRO (make_number (it.vpos));
}
--- 2032,2043 ----
if (XINT (lines) != 0)
move_it_by_lines (&it, XINT (lines), 0);
!
SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
if (BUFFERP (old_buffer))
w->buffer = old_buffer;
!
RETURN_UNGCPRO (make_number (it.vpos));
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/src/indent.c,
Thien-Thi Nguyen <=