/* Indentation functions.
- Copyright (C) 1985,86,87,88,93,94,95,98, 2000, 2001, 2002
+ Copyright (C) 1985,86,87,88,93,94,95,98,2000,01,02,03,2004
Free Software Foundation, Inc.
This file is part of GNU Emacs.
/* If the buffer has overlays, text properties,
or multibyte characters, use a more general algorithm. */
if (BUF_INTERVALS (current_buffer)
- || !NILP (current_buffer->overlays_before)
- || !NILP (current_buffer->overlays_after)
+ || current_buffer->overlays_before
+ || current_buffer->overlays_after
|| Z != Z_BYTE)
return current_column_1 ();
window_width - 1
- (has_vertical_scroll_bars
- ? FRAME_SCROLL_BAR_COLS (XFRAME (window->frame))
- : (window_width + window_left != frame_width))
+ ? WINDOW_CONFIG_SCROLL_BAR_COLS (window)
+ : (window_width + window_left != frame_cols))
where
- window_width is XFASTINT (w->width),
- window_left is XFASTINT (w->left),
+ window_width is XFASTINT (w->total_cols),
+ window_left is XFASTINT (w->left_col),
has_vertical_scroll_bars is
- FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (WINDOW_FRAME (window)))
- and frame_width = FRAME_WIDTH (XFRAME (window->frame))
+ WINDOW_HAS_VERTICAL_SCROLL_BAR (window)
+ and frame_cols = FRAME_COLS (XFRAME (window->frame))
- Or you can let window_internal_width do this all for you, and write:
- window_internal_width (w) - 1
+ Or you can let window_box_text_cols do this all for you, and write:
+ window_box_text_cols (w) - 1
The `-1' accounts for the continuation-line backslashes; the rest
accounts for window borders if the window is split horizontally, and
= (INTEGERP (current_buffer->selective_display)
? XINT (current_buffer->selective_display)
: !NILP (current_buffer->selective_display) ? -1 : 0);
- int prev_hpos = 0;
int selective_rlen
= (selective && dp && VECTORP (DISP_INVIS_VECTOR (dp))
? XVECTOR (DISP_INVIS_VECTOR (dp))->size : 0);
int wide_column_end_hpos = 0;
int prev_pos; /* Previous buffer position. */
int prev_pos_byte; /* Previous buffer position. */
+ int prev_hpos = 0;
+ int prev_vpos = 0;
int contin_hpos; /* HPOS of last column of continued line. */
int prev_tab_offset; /* Previous tab offset. */
pos = prev_pos;
pos_byte = prev_pos_byte;
hpos = prev_hpos;
+ vpos = prev_vpos;
tab_offset = prev_tab_offset;
}
break;
{
if (hscroll
|| (truncate_partial_width_windows
- && width + 1 < FRAME_WIDTH (XFRAME (WINDOW_FRAME (win))))
+ && width + 1 < FRAME_COLS (XFRAME (WINDOW_FRAME (win))))
|| !NILP (current_buffer->truncate_lines))
{
/* Truncating: skip to newline, unless we are already past
if (pos >= next_boundary)
next_boundary = pos + 1;
prev_hpos = width;
+ prev_vpos = vpos;
prev_tab_offset = tab_offset;
}
}
vpos++;
contin_hpos = prev_hpos;
prev_hpos = 0;
+ prev_vpos = vpos;
}
}
pos = prev_pos;
pos_byte = prev_pos_byte;
hpos = prev_hpos;
+ vpos = prev_vpos;
tab_offset = prev_tab_offset;
/* NOTE on contin_hpos, hpos, and prev_hpos.
hpos = contin_hpos;
vpos = vpos - 1;
}
- else if (c == '\n')
- /* If previous character is NEWLINE,
- set VPOS back to previous line */
- vpos = vpos - 1;
break;
}
pos = prev_pos;
pos_byte = prev_pos_byte;
hpos = prev_hpos;
+ vpos = prev_vpos;
tab_offset = prev_tab_offset;
}
break;
break;
prev_hpos = hpos;
+ prev_vpos = vpos;
prev_pos = pos;
prev_pos_byte = pos_byte;
wide_column_end_hpos = 0;
register int from, vtarget;
struct window *w;
{
- int width = window_internal_width (w) - 1;
+ int width = window_box_text_cols (w);
int hscroll = XINT (w->hscroll);
struct position pos;
/* vpos is cumulative vertical position, changed as from is changed */
XSETWINDOW (window, w);
+ /* 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;
+
/* If the window contains this buffer, use it for getting text properties.
Otherwise use the current buffer as arg for doing that. */
if (EQ (w->buffer, Fcurrent_buffer ()))
defsubr (&Svertical_motion);
defsubr (&Scompute_motion);
}
+
+/* arch-tag: 9adfea44-71f7-4988-8ee3-96da15c502cc
+ (do not change this comment) */