Lisp_Object Qspace, QCalign_to, QCrelative_width, QCrelative_height;
Lisp_Object Qleft_margin, Qright_margin, Qspace_width, Qheight, Qraise;
-/* Name of the variable controlling the highlighting of trailing
- whitespace. The implementation uses find_symbol_value to get its
- value. */
+/* Non-nil means highlight trailing whitespace. */
-Lisp_Object Qshow_trailing_whitespace;
+Lisp_Object Vshow_trailing_whitespace;
/* Name of the face used to highlight trailing whitespace. */
if (FRAME_FACE_CACHE (it->f)->used == 0)
recompute_basic_faces (it->f);
- /* Should we highlight trailing whitespace? */
- value = find_symbol_value (Qshow_trailing_whitespace);
- it->show_trailing_whitespace_p
- = EQ (value, Qunbound) ? 0 : !NILP (value);
-
/* Current value of the `space-width', and 'height' properties. */
it->space_width = Qnil;
it->font_height = Qnil;
&& (w == XWINDOW (current_buffer->last_selected_window)
|| highlight_nonselected_windows)
&& NILP (w->region_showing)
+ && NILP (Vshow_trailing_whitespace)
&& !cursor_in_echo_area)
{
struct it it;
&& !(!NILP (Vtransient_mark_mode)
&& !NILP (current_buffer->mark_active))
&& NILP (w->region_showing)
+ && NILP (Vshow_trailing_whitespace)
/* Right after splitting windows, last_point may be nil. */
&& INTEGERP (w->last_point)
/* This code is not used for mini-buffer for the sake of the case
&& !(!NILP (Vtransient_mark_mode)
&& !NILP (current_buffer->mark_active))
&& NILP (w->region_showing)
+ && NILP (Vshow_trailing_whitespace)
/* Overlay arrow position and string not changed. */
&& EQ (last_arrow_position, COERCE_MARKER (Voverlay_arrow_position))
&& EQ (last_arrow_string, Voverlay_arrow_string)
/* Can't do this if region may have changed. */
if ((!NILP (Vtransient_mark_mode)
&& !NILP (current_buffer->mark_active))
- || !NILP (w->region_showing))
+ || !NILP (w->region_showing)
+ || !NILP (Vshow_trailing_whitespace))
return 0;
/* If top-line visibility has changed, give up. */
c == ' ' || c == '\t'))
++bytepos;
- return bytepos >= ZV_BYTE || c == '\n' || c == '\r';
+ if (bytepos >= ZV_BYTE || c == '\n' || c == '\r')
+ {
+ if (bytepos != PT_BYTE)
+ return 1;
+ }
+ return 0;
}
}
-
/* Construct the glyph row IT->glyph_row in the desired matrix of
IT->w from text at the current position of IT. See dispextern.h
for an overview of struct it. Value is non-zero if
set_cursor_from_row (it->w, row, it->w->desired_matrix, 0, 0, 0, 0);
/* Highlight trailing whitespace. */
- if (it->show_trailing_whitespace_p)
+ if (!NILP (Vshow_trailing_whitespace))
highlight_trailing_whitespace (it->f, it->glyph_row);
/* Prepare for the next line. This line starts horizontally at (X
staticpro (&Qfontified);
Qfontification_functions = intern ("fontification-functions");
staticpro (&Qfontification_functions);
- Qshow_trailing_whitespace = intern ("show-trailing-whitespace");
- staticpro (&Qshow_trailing_whitespace);
Qtrailing_whitespace = intern ("trailing-whitespace");
staticpro (&Qtrailing_whitespace);
Qimage = intern ("image");
last_arrow_position = Qnil;
last_arrow_string = Qnil;
+ DEFVAR_LISP ("show-trailing-whitespace", &Vshow_trailing_whitespace,
+ "Non-nil means highlight trailing whitespace.\n\
+The face used for trailing whitespace is `trailing-whitespace'.");
+ Vshow_trailing_whitespace = Qnil;
+
DEFVAR_LISP ("inhibit-redisplay", &Vinhibit_redisplay,
"Non-nil means don't actually do any redisplay.\n\
This is used for internal purposes.");