struct Lisp_Vector *widthtab;
if (!VECTORP (BVAR (buf, width_table)))
- bset_width_table (buf, Fmake_vector (make_number (256), make_number (0)));
+ bset_width_table (buf, make_uninit_vector (256));
widthtab = XVECTOR (BVAR (buf, width_table));
eassert (widthtab->header.size == 256);
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
representations of the character between the start of the previous line
-and point (eg. control characters will have a width of 2 or 4, tabs
+and point (e.g., control characters will have a width of 2 or 4, tabs
will have a variable width).
Ignores finite width of frame, which means that this function may return
values greater than (frame-width).
TO (we need to go back below). */
if (pos <= to)
{
- pos = find_before_next_newline (pos, to, 1);
- pos_byte = CHAR_TO_BYTE (pos);
+ pos = find_before_next_newline (pos, to, 1, &pos_byte);
hpos = width;
/* If we just skipped next_boundary,
loop around in the main while
/* Skip any number of invisible lines all at once */
do
{
- pos = find_before_next_newline (pos, to, 1);
+ pos = find_before_next_newline (pos, to, 1, &pos_byte);
if (pos < to)
- pos++;
- pos_byte = CHAR_TO_BYTE (pos);
+ INC_BOTH (pos, pos_byte);
}
while (pos < to
&& indented_beyond_p (pos, pos_byte,
everything from a ^M to the end of the line is invisible.
Stop *before* the real newline. */
if (pos < to)
- {
- pos = find_before_next_newline (pos, to, 1);
- pos_byte = CHAR_TO_BYTE (pos);
- }
+ pos = find_before_next_newline (pos, to, 1, &pos_byte);
/* If we just skipped next_boundary,
loop around in the main while
and handle it. */
while ((vpos > vtarget || first) && from > BEGV)
{
+ ptrdiff_t bytepos;
Lisp_Object propval;
- prevline = find_next_newline_no_quit (from - 1, -1);
+ prevline = find_next_newline_no_quit (from - 1, -1, &bytepos);
while (prevline > BEGV
&& ((selective > 0
- && indented_beyond_p (prevline,
- CHAR_TO_BYTE (prevline),
- selective))
+ && indented_beyond_p (prevline, bytepos, selective))
/* Watch out for newlines with `invisible' property.
When moving upward, check the newline before. */
|| (propval = Fget_char_property (make_number (prevline - 1),
Qinvisible,
text_prop_object),
TEXT_PROP_MEANS_INVISIBLE (propval))))
- prevline = find_next_newline_no_quit (prevline - 1, -1);
+ prevline = find_next_newline_no_quit (prevline - 1, -1, &bytepos);
pos = *compute_motion (prevline, 0,
lmargin,
0,
from_byte = CHAR_TO_BYTE (from);
if (from > BEGV && FETCH_BYTE (from_byte - 1) != '\n')
{
+ ptrdiff_t bytepos;
Lisp_Object propval;
- prevline = find_next_newline_no_quit (from, -1);
+ prevline = find_next_newline_no_quit (from, -1, &bytepos);
while (prevline > BEGV
&& ((selective > 0
- && indented_beyond_p (prevline,
- CHAR_TO_BYTE (prevline),
- selective))
+ && indented_beyond_p (prevline, bytepos, selective))
/* Watch out for newlines with `invisible' property.
When moving downward, check the newline after. */
|| (propval = Fget_char_property (make_number (prevline),
Qinvisible,
text_prop_object),
TEXT_PROP_MEANS_INVISIBLE (propval))))
- prevline = find_next_newline_no_quit (prevline - 1, -1);
+ prevline = find_next_newline_no_quit (prevline - 1, -1, &bytepos);
pos = *compute_motion (prevline, 0,
lmargin,
0,
struct window *w;
Lisp_Object old_buffer;
EMACS_INT old_charpos IF_LINT (= 0), old_bytepos IF_LINT (= 0);
- struct gcpro gcpro1, gcpro2, gcpro3;
+ struct gcpro gcpro1;
Lisp_Object lcols = Qnil;
double cols IF_LINT (= 0);
void *itdata = NULL;
w = decode_live_window (window);
old_buffer = Qnil;
- GCPRO3 (old_buffer, old_charpos, old_bytepos);
+ GCPRO1 (old_buffer);
if (XBUFFER (w->buffer) != current_buffer)
{
/* Set the window's buffer temporarily to the current buffer. */