#include "lisp.h"
#include "buffer.h"
#include "indent.h"
-#include "screen.h"
+#include "frame.h"
#include "window.h"
#include "termchar.h"
#include "termopts.h"
representations of the character between the start of the previous line\n\
and point. (eg control characters will have a width of 2 or 4, tabs\n\
will have a variable width)\n\
-Ignores finite width of screen, which means that this function may return\n\
-values greater than (screen-width).\n\
+Ignores finite width of frame, which means that this function may return\n\
+values greater than (frame-width).\n\
Whether the line is visible (if `selective-display' is t) has no effect;\n\
however, ^M is treated as end of line when `selective-display' is t.")
()
else
stop = GAP_END_ADDR;
- if (tab_width <= 0 || tab_width > 20) tab_width = 8;
+ if (tab_width <= 0 || tab_width > 1000) tab_width = 8;
col = 0, tab_seen = 0, post_tab = 0;
c = *--ptr;
if (c >= 040 && c < 0177
- && (dp == 0 || XTYPE (DISP_CHAR_ROPE (dp, c)) != Lisp_String))
+ && (dp == 0 || XTYPE (DISP_CHAR_VECTOR (dp, c)) != Lisp_Vector))
{
col++;
}
col = 0;
tab_seen = 1;
}
- else if (dp != 0 && XTYPE (DISP_CHAR_ROPE (dp, c)) == Lisp_String)
- col += XSTRING (DISP_CHAR_ROPE (dp, c))->size / sizeof (GLYPH);
+ else if (dp != 0 && XTYPE (DISP_CHAR_VECTOR (dp, c)) == Lisp_Vector)
+ col += XVECTOR (DISP_CHAR_VECTOR (dp, c))->size;
else
col += (ctl_arrow && c < 0200) ? 2 : 4;
}
if (fromcol == mincol)
return make_number (mincol);
- if (tab_width <= 0 || tab_width > 20) tab_width = 8;
+ if (tab_width <= 0 || tab_width > 1000) tab_width = 8;
if (indent_tabs_mode)
{
register unsigned char *p;
register unsigned char *stop;
- if (tab_width <= 0 || tab_width > 20) tab_width = 8;
+ if (tab_width <= 0 || tab_width > 1000) tab_width = 8;
stop = &FETCH_CHAR (BUFFER_CEILING_OF (pos)) + 1;
p = &FETCH_CHAR (pos);
as displayed of the previous characters in the line.\n\
This function ignores line-continuation;\n\
there is no upper limit on the column number a character can have\n\
-and horizontal scrolling has no effect.\n\n\
+and horizontal scrolling has no effect.\n\
+\n\
If specified column is within a character, point goes after that character.\n\
If it's past end of line, point goes to end of line.\n\n\
A non-nil second (optional) argument FORCE means, if the line\n\
int prev_col;
int c;
- if (tab_width <= 0 || tab_width > 20) tab_width = 8;
+ if (tab_width <= 0 || tab_width > 1000) tab_width = 8;
CHECK_NATNUM (column, 0);
goal = XINT (column);
col += tab_width;
col = col / tab_width * tab_width;
}
- else if (dp != 0 && XTYPE (DISP_CHAR_ROPE (dp, c)) == Lisp_String)
- col += XSTRING (DISP_CHAR_ROPE (dp, c))->size / sizeof (GLYPH);
+ else if (dp != 0 && XTYPE (DISP_CHAR_VECTOR (dp, c)) == Lisp_Vector)
+ col += XVECTOR (DISP_CHAR_VECTOR (dp, c))->size;
else if (ctl_arrow && (c < 040 || c == 0177))
col++;
else if (c < 040 || c >= 0177)
/* If line ends prematurely, add space to the end. */
if (col < goal && !NILP (force))
- Findent_to (make_number (col = goal));
+ Findent_to (make_number (col = goal), Qnil);
last_known_column = col;
last_known_column_point = point;
When displaying in window w, a typical formula for WIDTH is:
window_width - 1
- - (window_width + window_left != screen_width)
+ - (has_vertical_scroll_bars
+ ? VERTICAL_SCROLL_BAR_WIDTH
+ : (window_width + window_left != frame_width))
where
window_width is XFASTINT (w->width),
window_left is XFASTINT (w->left),
- and screen_width = SCREEN_WIDTH (XSCREEN (window->screen))
+ has_vertical_scroll_bars is
+ FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (WINDOW_FRAME (window)))
+ and frame_width = FRAME_WIDTH (XFRAME (window->frame))
- This accounts for the continuation-line backslashes, and the window
- borders if the window is split vertically. */
+ Or,
+ window_internal_width (w) - 1
+
+ The `-1' accounts for the continuation-line backslashes; the rest
+ accounts for window borders if the window is split vertically, and
+ the scroll bars if the frame supports them. */
struct position *
compute_motion (from, fromvpos, fromhpos, to, tovpos, tohpos, width, hscroll, tab_offset)
: !NILP (current_buffer->selective_display) ? -1 : 0;
int prev_vpos, prev_hpos;
int selective_rlen
- = (selective && dp && XTYPE (DISP_INVIS_ROPE (dp)) == Lisp_String
- ? XSTRING (DISP_INVIS_ROPE (dp))->size / sizeof (GLYPH) : 0);
+ = (selective && dp && XTYPE (DISP_INVIS_VECTOR (dp)) == Lisp_Vector
+ ? XVECTOR (DISP_INVIS_VECTOR (dp))->size : 0);
- if (tab_width <= 0 || tab_width > 20) tab_width = 8;
+ if (tab_width <= 0 || tab_width > 1000) tab_width = 8;
for (pos = from; pos < to; pos++)
{
/* Stop if past the target screen position. */
c = FETCH_CHAR (pos);
if (c >= 040 && c < 0177
- && (dp == 0 || XTYPE (DISP_CHAR_ROPE (dp, c)) != Lisp_String))
+ && (dp == 0 || XTYPE (DISP_CHAR_VECTOR (dp, c)) != Lisp_Vector))
hpos++;
else if (c == '\t')
{
hpos = width;
}
}
- else if (dp != 0 && XTYPE (DISP_CHAR_ROPE (dp, c)) == Lisp_String)
- hpos += XSTRING (DISP_CHAR_ROPE (dp, c))->size / sizeof (GLYPH);
+ else if (dp != 0 && XTYPE (DISP_CHAR_VECTOR (dp, c)) == Lisp_Vector)
+ hpos += XVECTOR (DISP_CHAR_VECTOR (dp, c))->size;
else
hpos += (ctl_arrow && c < 0200) ? 2 : 4;
break;
if (hscroll
|| (truncate_partial_width_windows
- && width + 1 < SCREEN_WIDTH (selected_screen))
+ && width + 1 < FRAME_WIDTH (selected_frame))
|| !NILP (current_buffer->truncate_lines))
{
/* Truncating: skip to newline. */
{
int opoint = point;
int col;
- int width = XFASTINT (w->width) - 1
- - (XFASTINT (w->width) + XFASTINT (w->left)
- != SCREEN_WIDTH (XSCREEN (w->screen)));
+ int width = window_internal_width (w) - 1;
if (pos == BEGV || FETCH_CHAR (pos - 1) == '\n')
return 0;
{
struct position pos;
register struct window *w = XWINDOW (selected_window);
- int width = XFASTINT (w->width) - 1
- - (XFASTINT (w->width) + XFASTINT (w->left)
- != SCREEN_WIDTH (XSCREEN (w->screen)));
+ int width = window_internal_width (w) - 1;
CHECK_NUMBER (lines, 0);