summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/indent.c5
-rw-r--r--src/xdisp.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/src/indent.c b/src/indent.c
index d4ef075f001..e90e3fde203 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -306,6 +306,8 @@ 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).
+In a buffer with very long lines, the value can be zero, because calculating
+the exact number is very expensive.
Whether the line is visible (if `selective-display' is t) has no effect;
however, ^M is treated as end of line when `selective-display' is t.
Text that has an invisible property is considered as having width 0, unless
@@ -313,6 +315,9 @@ Text that has an invisible property is considered as having width 0, unless
(void)
{
Lisp_Object temp;
+
+ if (current_buffer->long_line_optimizations_p)
+ return make_fixnum (0);
XSETFASTINT (temp, current_column ());
return temp;
}
diff --git a/src/xdisp.c b/src/xdisp.c
index 690f10b8403..c507d0caf20 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -12998,7 +12998,8 @@ mode_line_update_needed (struct window *w)
{
return (w->column_number_displayed != -1
&& !(PT == w->last_point && !window_outdated (w))
- && (w->column_number_displayed != current_column ()));
+ && (!current_buffer->long_line_optimizations_p
+ && w->column_number_displayed != current_column ()));
}
/* True if window start of W is frozen and may not be changed during
@@ -20116,6 +20117,7 @@ redisplay_window (Lisp_Object window, bool just_this_one_p)
|| w->base_line_pos > 0
/* Column number is displayed and different from the one displayed. */
|| (w->column_number_displayed != -1
+ && !current_buffer->long_line_optimizations_p
&& (w->column_number_displayed != current_column ())))
/* This means that the window has a mode line. */
&& (window_wants_mode_line (w)
@@ -27619,7 +27621,8 @@ decode_mode_spec (struct window *w, register int c, int field_width,
return "";
else
{
- ptrdiff_t col = current_column ();
+ ptrdiff_t col =
+ b->long_line_optimizations_p ? 0 : current_column ();
int disp_col = (c == 'C') ? col + 1 : col;
w->column_number_displayed = col;
pint2str (decode_mode_spec_buf, width, disp_col);