aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann1999-08-17 00:46:09 +0000
committerGerd Moellmann1999-08-17 00:46:09 +0000
commit8f897821fc638b71f264fcf1a6feffb15dc34af1 (patch)
tree5dcae3766abf18288cc0c204cbb3f7b319b8eca4 /src
parentf1f134908aa6958e614e2a405ba7d6d7b2716da6 (diff)
downloademacs-8f897821fc638b71f264fcf1a6feffb15dc34af1.tar.gz
emacs-8f897821fc638b71f264fcf1a6feffb15dc34af1.zip
(Qshow_trailing_whitespace): Removed.
(Vshow_trailing_whitespace): Added. (init_iterator): Remove initialization code for show_trailing_whitespace_p. (redisplay_internal): Don't try cursor movement in this_line if showing trailing whitespace. (redisplay_window): Likewise for cursor movement in current matrix and try_window_id. (try_window_reusing_current_matrix): Likewise. (trailing_whitespace_p): Return 0 if trailing whitespace is in front of point. (display_line): Use Vshow_trailing_whitespace instead of former iterator member show_trailing_whitespace_p. (syms_of_xdisp): Add DEFVAR_LISP for show-trailing-whitespace.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index f418bd2321c..764f7f33bff 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -259,11 +259,9 @@ extern Lisp_Object Qface, Qinvisible, Qimage;
259Lisp_Object Qspace, QCalign_to, QCrelative_width, QCrelative_height; 259Lisp_Object Qspace, QCalign_to, QCrelative_width, QCrelative_height;
260Lisp_Object Qleft_margin, Qright_margin, Qspace_width, Qheight, Qraise; 260Lisp_Object Qleft_margin, Qright_margin, Qspace_width, Qheight, Qraise;
261 261
262/* Name of the variable controlling the highlighting of trailing 262/* Non-nil means highlight trailing whitespace. */
263 whitespace. The implementation uses find_symbol_value to get its
264 value. */
265 263
266Lisp_Object Qshow_trailing_whitespace; 264Lisp_Object Vshow_trailing_whitespace;
267 265
268/* Name of the face used to highlight trailing whitespace. */ 266/* Name of the face used to highlight trailing whitespace. */
269 267
@@ -1224,11 +1222,6 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id)
1224 if (FRAME_FACE_CACHE (it->f)->used == 0) 1222 if (FRAME_FACE_CACHE (it->f)->used == 0)
1225 recompute_basic_faces (it->f); 1223 recompute_basic_faces (it->f);
1226 1224
1227 /* Should we highlight trailing whitespace? */
1228 value = find_symbol_value (Qshow_trailing_whitespace);
1229 it->show_trailing_whitespace_p
1230 = EQ (value, Qunbound) ? 0 : !NILP (value);
1231
1232 /* Current value of the `space-width', and 'height' properties. */ 1225 /* Current value of the `space-width', and 'height' properties. */
1233 it->space_width = Qnil; 1226 it->space_width = Qnil;
1234 it->font_height = Qnil; 1227 it->font_height = Qnil;
@@ -6697,6 +6690,7 @@ redisplay_internal (preserve_echo_area)
6697 && (w == XWINDOW (current_buffer->last_selected_window) 6690 && (w == XWINDOW (current_buffer->last_selected_window)
6698 || highlight_nonselected_windows) 6691 || highlight_nonselected_windows)
6699 && NILP (w->region_showing) 6692 && NILP (w->region_showing)
6693 && NILP (Vshow_trailing_whitespace)
6700 && !cursor_in_echo_area) 6694 && !cursor_in_echo_area)
6701 { 6695 {
6702 struct it it; 6696 struct it it;
@@ -7890,6 +7884,7 @@ redisplay_window (window, just_this_one_p)
7890 && !(!NILP (Vtransient_mark_mode) 7884 && !(!NILP (Vtransient_mark_mode)
7891 && !NILP (current_buffer->mark_active)) 7885 && !NILP (current_buffer->mark_active))
7892 && NILP (w->region_showing) 7886 && NILP (w->region_showing)
7887 && NILP (Vshow_trailing_whitespace)
7893 /* Right after splitting windows, last_point may be nil. */ 7888 /* Right after splitting windows, last_point may be nil. */
7894 && INTEGERP (w->last_point) 7889 && INTEGERP (w->last_point)
7895 /* This code is not used for mini-buffer for the sake of the case 7890 /* This code is not used for mini-buffer for the sake of the case
@@ -8063,6 +8058,7 @@ redisplay_window (window, just_this_one_p)
8063 && !(!NILP (Vtransient_mark_mode) 8058 && !(!NILP (Vtransient_mark_mode)
8064 && !NILP (current_buffer->mark_active)) 8059 && !NILP (current_buffer->mark_active))
8065 && NILP (w->region_showing) 8060 && NILP (w->region_showing)
8061 && NILP (Vshow_trailing_whitespace)
8066 /* Overlay arrow position and string not changed. */ 8062 /* Overlay arrow position and string not changed. */
8067 && EQ (last_arrow_position, COERCE_MARKER (Voverlay_arrow_position)) 8063 && EQ (last_arrow_position, COERCE_MARKER (Voverlay_arrow_position))
8068 && EQ (last_arrow_string, Voverlay_arrow_string) 8064 && EQ (last_arrow_string, Voverlay_arrow_string)
@@ -8506,7 +8502,8 @@ try_window_reusing_current_matrix (w)
8506 /* Can't do this if region may have changed. */ 8502 /* Can't do this if region may have changed. */
8507 if ((!NILP (Vtransient_mark_mode) 8503 if ((!NILP (Vtransient_mark_mode)
8508 && !NILP (current_buffer->mark_active)) 8504 && !NILP (current_buffer->mark_active))
8509 || !NILP (w->region_showing)) 8505 || !NILP (w->region_showing)
8506 || !NILP (Vshow_trailing_whitespace))
8510 return 0; 8507 return 0;
8511 8508
8512 /* If top-line visibility has changed, give up. */ 8509 /* If top-line visibility has changed, give up. */
@@ -10159,7 +10156,12 @@ trailing_whitespace_p (charpos)
10159 c == ' ' || c == '\t')) 10156 c == ' ' || c == '\t'))
10160 ++bytepos; 10157 ++bytepos;
10161 10158
10162 return bytepos >= ZV_BYTE || c == '\n' || c == '\r'; 10159 if (bytepos >= ZV_BYTE || c == '\n' || c == '\r')
10160 {
10161 if (bytepos != PT_BYTE)
10162 return 1;
10163 }
10164 return 0;
10163} 10165}
10164 10166
10165 10167
@@ -10214,7 +10216,6 @@ highlight_trailing_whitespace (f, row)
10214} 10216}
10215 10217
10216 10218
10217
10218/* Construct the glyph row IT->glyph_row in the desired matrix of 10219/* Construct the glyph row IT->glyph_row in the desired matrix of
10219 IT->w from text at the current position of IT. See dispextern.h 10220 IT->w from text at the current position of IT. See dispextern.h
10220 for an overview of struct it. Value is non-zero if 10221 for an overview of struct it. Value is non-zero if
@@ -10586,7 +10587,7 @@ display_line (it)
10586 set_cursor_from_row (it->w, row, it->w->desired_matrix, 0, 0, 0, 0); 10587 set_cursor_from_row (it->w, row, it->w->desired_matrix, 0, 0, 0, 0);
10587 10588
10588 /* Highlight trailing whitespace. */ 10589 /* Highlight trailing whitespace. */
10589 if (it->show_trailing_whitespace_p) 10590 if (!NILP (Vshow_trailing_whitespace))
10590 highlight_trailing_whitespace (it->f, it->glyph_row); 10591 highlight_trailing_whitespace (it->f, it->glyph_row);
10591 10592
10592 /* Prepare for the next line. This line starts horizontally at (X 10593 /* Prepare for the next line. This line starts horizontally at (X
@@ -11981,8 +11982,6 @@ syms_of_xdisp ()
11981 staticpro (&Qfontified); 11982 staticpro (&Qfontified);
11982 Qfontification_functions = intern ("fontification-functions"); 11983 Qfontification_functions = intern ("fontification-functions");
11983 staticpro (&Qfontification_functions); 11984 staticpro (&Qfontification_functions);
11984 Qshow_trailing_whitespace = intern ("show-trailing-whitespace");
11985 staticpro (&Qshow_trailing_whitespace);
11986 Qtrailing_whitespace = intern ("trailing-whitespace"); 11985 Qtrailing_whitespace = intern ("trailing-whitespace");
11987 staticpro (&Qtrailing_whitespace); 11986 staticpro (&Qtrailing_whitespace);
11988 Qimage = intern ("image"); 11987 Qimage = intern ("image");
@@ -11993,6 +11992,11 @@ syms_of_xdisp ()
11993 last_arrow_position = Qnil; 11992 last_arrow_position = Qnil;
11994 last_arrow_string = Qnil; 11993 last_arrow_string = Qnil;
11995 11994
11995 DEFVAR_LISP ("show-trailing-whitespace", &Vshow_trailing_whitespace,
11996 "Non-nil means highlight trailing whitespace.\n\
11997The face used for trailing whitespace is `trailing-whitespace'.");
11998 Vshow_trailing_whitespace = Qnil;
11999
11996 DEFVAR_LISP ("inhibit-redisplay", &Vinhibit_redisplay, 12000 DEFVAR_LISP ("inhibit-redisplay", &Vinhibit_redisplay,
11997 "Non-nil means don't actually do any redisplay.\n\ 12001 "Non-nil means don't actually do any redisplay.\n\
11998This is used for internal purposes."); 12002This is used for internal purposes.");