aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2004-01-16 18:47:20 +0000
committerKim F. Storm2004-01-16 18:47:20 +0000
commit88e6b646f55d848aca98e295cde3dcfb4b9f5101 (patch)
tree2a2a34e9bcc906eb2cfe54234d4b05ad9615b3e2 /src
parent5fbcdd1927bb028befcb6a8ad25abb598bb9a2b3 (diff)
downloademacs-88e6b646f55d848aca98e295cde3dcfb4b9f5101.tar.gz
emacs-88e6b646f55d848aca98e295cde3dcfb4b9f5101.zip
(Voverflow_newline_into_fringe): New variable.
(IT_OVERFLOW_NEWLINE_INTO_FRINGE): New macro. (move_it_in_display_line_to): Overflow newline into fringe for rows that are exactly as wide as the window. (up_arrow_bits, down_arrow_bits, first_line_bits, last_line_bits) (filled_box_cursor_bits, hollow_box_cursor_bits, bar_cursor_bits) (hbar_cursor_bits, hollow_square_bits): New fringe bitmaps. (fringe_bitmaps): Add new bitmaps. (draw_fringe_bitmap): Make extern. Remove WHICH arg. Select proper bitmap for cursor in fringe when appropriate. Handle alignment of bitmap to top or bottom of row. (draw_row_fringe_bitmaps): Don't select bitmaps here; that is now done by update_window_fringes. (update_window_fringes, draw_window_fringes): New functions. (redisplay_internal): Call update_window_fringes in case only cursor row is updated. (redisplay_window): Call update_window_fringes. Explicitly call draw_window_fringes if redisplay was done using the current matrix or the overlay arrow is in the window. (try_window_reusing_current_matrix): Mark scrolled rows for fringe update (to update buffer-boundaries / scrolling icons). (find_last_unchanged_at_beg_row): Handle exact width lines line continued lines. (display_line): Overflow newline into fringe for rows that are exactly as wide as the window. Don't append space for newline in this case. (notice_overwritten_cursor): Explicitly clear cursor bitmap in fringe as if it had been overwritten. (erase_phys_cursor): Erase cursor bitmap in fringe. (syms_of_xdisp): Mark show-trailing-whitespace and void-text-area-pointer as user options. DEFVAR_LISP Voverflow_newline_into_fringe. Enable by default.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c622
1 files changed, 550 insertions, 72 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 20ec887bd60..11d48c90ea0 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -310,6 +310,19 @@ extern Lisp_Object Qscroll_bar;
310 310
311Lisp_Object Vshow_trailing_whitespace; 311Lisp_Object Vshow_trailing_whitespace;
312 312
313/* Non-nil means that newline may flow into the right fringe. */
314
315Lisp_Object Voverflow_newline_into_fringe;
316
317/* Test if overflow newline into fringe. Called with iterator IT
318 at or past right window margin, and with IT->current_x set. */
319
320#define IT_OVERFLOW_NEWLINE_INTO_FRINGE(it) \
321 (!NILP (Voverflow_newline_into_fringe) \
322 && FRAME_WINDOW_P (it->f) \
323 && WINDOW_RIGHT_FRINGE_WIDTH (it->w) > 0 \
324 && it->current_x == it->last_visible_x)
325
313/* Non-nil means show the text cursor in void text areas 326/* Non-nil means show the text cursor in void text areas
314 i.e. in blank areas after eol and eob. This used to be 327 i.e. in blank areas after eol and eob. This used to be
315 the default in 21.3. */ 328 the default in 21.3. */
@@ -5594,7 +5607,18 @@ move_it_in_display_line_to (it, to_charpos, to_x, op)
5594 ++it->hpos; 5607 ++it->hpos;
5595 it->current_x = new_x; 5608 it->current_x = new_x;
5596 if (i == it->nglyphs - 1) 5609 if (i == it->nglyphs - 1)
5597 set_iterator_to_next (it, 1); 5610 {
5611 set_iterator_to_next (it, 1);
5612 if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it))
5613 {
5614 get_next_display_element (it);
5615 if (ITERATOR_AT_END_OF_LINE_P (it))
5616 {
5617 result = MOVE_NEWLINE_OR_CR;
5618 break;
5619 }
5620 }
5621 }
5598 } 5622 }
5599 else 5623 else
5600 { 5624 {
@@ -5651,6 +5675,15 @@ move_it_in_display_line_to (it, to_charpos, to_x, op)
5651 if (it->truncate_lines_p 5675 if (it->truncate_lines_p
5652 && it->current_x >= it->last_visible_x) 5676 && it->current_x >= it->last_visible_x)
5653 { 5677 {
5678 if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it))
5679 {
5680 get_next_display_element (it);
5681 if (ITERATOR_AT_END_OF_LINE_P (it))
5682 {
5683 result = MOVE_NEWLINE_OR_CR;
5684 break;
5685 }
5686 }
5654 result = MOVE_LINE_TRUNCATED; 5687 result = MOVE_LINE_TRUNCATED;
5655 break; 5688 break;
5656 } 5689 }
@@ -8899,26 +8932,205 @@ note_tool_bar_highlight (f, x, y)
8899 8932
8900#ifdef HAVE_WINDOW_SYSTEM 8933#ifdef HAVE_WINDOW_SYSTEM
8901 8934
8935/* Notice that all bitmaps bits are "mirrored". */
8936
8902/* An arrow like this: `<-'. */ 8937/* An arrow like this: `<-'. */
8938/*
8939 ...xx...
8940 ....xx..
8941 .....xx.
8942 ..xxxxxx
8943 ..xxxxxx
8944 .....xx.
8945 ....xx..
8946 ...xx...
8947*/
8903static unsigned char left_bits[] = { 8948static unsigned char left_bits[] = {
8904 0x18, 0x0c, 0x06, 0x3f, 0x3f, 0x06, 0x0c, 0x18}; 8949 0x18, 0x0c, 0x06, 0x3f, 0x3f, 0x06, 0x0c, 0x18};
8905 8950
8951
8906/* Right truncation arrow bitmap `->'. */ 8952/* Right truncation arrow bitmap `->'. */
8953/*
8954 ...xx...
8955 ..xx....
8956 .xx.....
8957 xxxxxx..
8958 xxxxxx..
8959 .xx.....
8960 ..xx....
8961 ...xx...
8962*/
8907static unsigned char right_bits[] = { 8963static unsigned char right_bits[] = {
8908 0x18, 0x30, 0x60, 0xfc, 0xfc, 0x60, 0x30, 0x18}; 8964 0x18, 0x30, 0x60, 0xfc, 0xfc, 0x60, 0x30, 0x18};
8909 8965
8966
8967/* Up arrow bitmap. */
8968/*
8969 ...xx...
8970 ..xxxx..
8971 .xxxxxx.
8972 xxxxxxxx
8973 ...xx...
8974 ...xx...
8975 ...xx...
8976 ...xx...
8977*/
8978static unsigned char up_arrow_bits[] = {
8979 0x18, 0x3c, 0x7e, 0xff, 0x18, 0x18, 0x18, 0x18};
8980
8981
8982/* Down arrow bitmap. */
8983/*
8984 ...xx...
8985 ...xx...
8986 ...xx...
8987 ...xx...
8988 xxxxxxxx
8989 .xxxxxx.
8990 ..xxxx..
8991 ...xx...
8992*/
8993static unsigned char down_arrow_bits[] = {
8994 0x18, 0x18, 0x18, 0x18, 0xff, 0x7e, 0x3c, 0x18};
8995
8910/* Marker for continued lines. */ 8996/* Marker for continued lines. */
8997/*
8998 ..xxxx..
8999 .xxxxx..
9000 xx......
9001 xxx..x..
9002 xxxxxx..
9003 .xxxxx..
9004 ..xxxx..
9005 .xxxxx..
9006*/
8911static unsigned char continued_bits[] = { 9007static unsigned char continued_bits[] = {
8912 0x3c, 0x7c, 0xc0, 0xe4, 0xfc, 0x7c, 0x3c, 0x7c}; 9008 0x3c, 0x7c, 0xc0, 0xe4, 0xfc, 0x7c, 0x3c, 0x7c};
8913 9009
8914/* Marker for continuation lines. */ 9010/* Marker for continuation lines. */
9011/*
9012 ..xxxx..
9013 ..xxxxx.
9014 ......xx
9015 ..x..xxx
9016 ..xxxxxx
9017 ..xxxxx.
9018 ..xxxx..
9019 ..xxxxx.
9020*/
8915static unsigned char continuation_bits[] = { 9021static unsigned char continuation_bits[] = {
8916 0x3c, 0x3e, 0x03, 0x27, 0x3f, 0x3e, 0x3c, 0x3e}; 9022 0x3c, 0x3e, 0x03, 0x27, 0x3f, 0x3e, 0x3c, 0x3e};
8917 9023
8918/* Overlay arrow bitmap. A triangular arrow. */ 9024/* Overlay arrow bitmap. A triangular arrow. */
9025/*
9026 ......xx
9027 ....xxxx
9028 ...xxxxx
9029 ..xxxxxx
9030 ..xxxxxx
9031 ...xxxxx
9032 ....xxxx
9033 ......xx
9034*/
8919static unsigned char ov_bits[] = { 9035static unsigned char ov_bits[] = {
8920 0x03, 0x0f, 0x1f, 0x3f, 0x3f, 0x1f, 0x0f, 0x03}; 9036 0x03, 0x0f, 0x1f, 0x3f, 0x3f, 0x1f, 0x0f, 0x03};
8921 9037
9038
9039/* First line bitmap. An left-up angle. */
9040/*
9041 ..xxxxxx
9042 ..xxxxxx
9043 ......xx
9044 ......xx
9045 ......xx
9046 ......xx
9047 ......xx
9048 ........
9049*/
9050static unsigned char first_line_bits[] = {
9051 0x3f, 0x3f, 0x03, 0x03, 0x03, 0x03, 0x03, 0x00};
9052
9053
9054/* Last line bitmap. An left-down angle. */
9055/*
9056 ........
9057 xx......
9058 xx......
9059 xx......
9060 xx......
9061 xx......
9062 xxxxxx..
9063 xxxxxx..
9064*/
9065static unsigned char last_line_bits[] = {
9066 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0xfc};
9067
9068/* Filled box cursor bitmap. A filled box; max 13 pixels high. */
9069/*
9070 .xxxxxxx
9071 .xxxxxxx
9072 .xxxxxxx
9073 .xxxxxxx
9074 .xxxxxxx
9075 .xxxxxxx
9076 .xxxxxxx
9077 .xxxxxxx
9078 .xxxxxxx
9079 .xxxxxxx
9080 .xxxxxxx
9081 .xxxxxxx
9082 .xxxxxxx
9083*/
9084static unsigned char filled_box_cursor_bits[] = {
9085 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f};
9086
9087/* Hollow box cursor bitmap. A hollow box; max 13 pixels high. */
9088/*
9089 .xxxxxxx
9090 .x.....x
9091 .x.....x
9092 .x.....x
9093 .x.....x
9094 .x.....x
9095 .x.....x
9096 .x.....x
9097 .x.....x
9098 .x.....x
9099 .x.....x
9100 .x.....x
9101 .xxxxxxx
9102*/
9103static unsigned char hollow_box_cursor_bits[] = {
9104 0x7f, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x7f};
9105
9106/* Bar cursor bitmap. A vertical bar; max 13 pixels high. */
9107/*
9108 ......xx
9109 ......xx
9110 ......xx
9111 ......xx
9112 ......xx
9113 ......xx
9114 ......xx
9115 ......xx
9116 ......xx
9117 ......xx
9118 ......xx
9119 ......xx
9120 ......xx
9121*/
9122static unsigned char bar_cursor_bits[] = {
9123 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
9124
9125/* HBar cursor bitmap. A horisontal bar; 2 pixels high. */
9126/*
9127 .xxxxxxx
9128 .xxxxxxx
9129*/
9130static unsigned char hbar_cursor_bits[] = {
9131 0x7f, 0x7f};
9132
9133
8922/* Bitmap drawn to indicate lines not displaying text if 9134/* Bitmap drawn to indicate lines not displaying text if
8923 `indicate-empty-lines' is non-nil. */ 9135 `indicate-empty-lines' is non-nil. */
8924static unsigned char zv_bits[] = { 9136static unsigned char zv_bits[] = {
@@ -8931,32 +9143,89 @@ static unsigned char zv_bits[] = {
8931 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 9143 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00,
8932 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00}; 9144 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00};
8933 9145
9146/* Hollow square bitmap. */
9147/*
9148 .xxxxxx.
9149 .x....x.
9150 .x....x.
9151 .x....x.
9152 .x....x.
9153 .xxxxxx.
9154*/
9155static unsigned char hollow_square_bits[] = {
9156 0x7e, 0x42, 0x42, 0x42, 0x42, 0x7e};
9157
9158
8934struct fringe_bitmap fringe_bitmaps[MAX_FRINGE_BITMAPS] = 9159struct fringe_bitmap fringe_bitmaps[MAX_FRINGE_BITMAPS] =
8935{ 9160{
8936 { 0, 0, 0, NULL /* NO_FRINGE_BITMAP */ }, 9161 { 0, 0, 0, NULL /* NO_FRINGE_BITMAP */ },
8937 { 8, sizeof (left_bits), 0, left_bits }, 9162 { 8, sizeof (left_bits), 0, left_bits },
8938 { 8, sizeof (right_bits), 0, right_bits }, 9163 { 8, sizeof (right_bits), 0, right_bits },
9164 { 8, sizeof (up_arrow_bits), -1, up_arrow_bits },
9165 { 8, sizeof (down_arrow_bits), -2, down_arrow_bits },
8939 { 8, sizeof (continued_bits), 0, continued_bits }, 9166 { 8, sizeof (continued_bits), 0, continued_bits },
8940 { 8, sizeof (continuation_bits), 0, continuation_bits }, 9167 { 8, sizeof (continuation_bits), 0, continuation_bits },
8941 { 8, sizeof (ov_bits), 0, ov_bits }, 9168 { 8, sizeof (ov_bits), 0, ov_bits },
8942 { 8, sizeof (zv_bits), 3, zv_bits } 9169 { 8, sizeof (first_line_bits), -1, first_line_bits },
9170 { 8, sizeof (last_line_bits), -2, last_line_bits },
9171 { 8, sizeof (filled_box_cursor_bits), 0, filled_box_cursor_bits },
9172 { 8, sizeof (hollow_box_cursor_bits), 0, hollow_box_cursor_bits },
9173 { 8, sizeof (bar_cursor_bits), 0, bar_cursor_bits },
9174 { 8, sizeof (hbar_cursor_bits), -2, hbar_cursor_bits },
9175 { 8, sizeof (zv_bits), 3, zv_bits },
9176 { 8, sizeof (hollow_square_bits), 0, hollow_square_bits },
8943}; 9177};
8944 9178
8945 9179
8946/* Draw the bitmap WHICH in one of the left or right fringes of 9180/* Draw the bitmap WHICH in one of the left or right fringes of
8947 window W. ROW is the glyph row for which to display the bitmap; it 9181 window W. ROW is the glyph row for which to display the bitmap; it
8948 determines the vertical position at which the bitmap has to be 9182 determines the vertical position at which the bitmap has to be
8949 drawn. */ 9183 drawn.
9184 LEFT_P is 1 for left fringe, 0 for right fringe.
9185*/
8950 9186
8951static void 9187void
8952draw_fringe_bitmap (w, row, which, left_p) 9188draw_fringe_bitmap (w, row, left_p)
8953 struct window *w; 9189 struct window *w;
8954 struct glyph_row *row; 9190 struct glyph_row *row;
8955 enum fringe_bitmap_type which;
8956 int left_p; 9191 int left_p;
8957{ 9192{
8958 struct frame *f = XFRAME (WINDOW_FRAME (w)); 9193 struct frame *f = XFRAME (WINDOW_FRAME (w));
8959 struct draw_fringe_bitmap_params p; 9194 struct draw_fringe_bitmap_params p;
9195 enum fringe_bitmap_type which;
9196 int period;
9197
9198 if (left_p)
9199 which = row->left_fringe_bitmap;
9200 else if (!row->cursor_in_fringe_p)
9201 which = row->right_fringe_bitmap;
9202 else
9203 switch (w->phys_cursor_type)
9204 {
9205 case HOLLOW_BOX_CURSOR:
9206 if (row->visible_height >= sizeof(hollow_box_cursor_bits))
9207 which = HOLLOW_BOX_CURSOR_BITMAP;
9208 else
9209 which = HOLLOW_SQUARE_BITMAP;
9210 break;
9211 case FILLED_BOX_CURSOR:
9212 which = FILLED_BOX_CURSOR_BITMAP;
9213 break;
9214 case BAR_CURSOR:
9215 which = BAR_CURSOR_BITMAP;
9216 break;
9217 case HBAR_CURSOR:
9218 which = HBAR_CURSOR_BITMAP;
9219 break;
9220 case NO_CURSOR:
9221 default:
9222 w->phys_cursor_on_p = 0;
9223 row->cursor_in_fringe_p = 0;
9224 which = row->right_fringe_bitmap;
9225 break;
9226 }
9227
9228 period = fringe_bitmaps[which].period;
8960 9229
8961 /* Convert row to frame coordinates. */ 9230 /* Convert row to frame coordinates. */
8962 p.y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); 9231 p.y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
@@ -8965,9 +9234,7 @@ draw_fringe_bitmap (w, row, which, left_p)
8965 p.wd = fringe_bitmaps[which].width; 9234 p.wd = fringe_bitmaps[which].width;
8966 9235
8967 p.h = fringe_bitmaps[which].height; 9236 p.h = fringe_bitmaps[which].height;
8968 p.dh = (fringe_bitmaps[which].period 9237 p.dh = (period > 0 ? (p.y % period) : 0);
8969 ? (p.y % fringe_bitmaps[which].period)
8970 : 0);
8971 p.h -= p.dh; 9238 p.h -= p.dh;
8972 /* Clip bitmap if too high. */ 9239 /* Clip bitmap if too high. */
8973 if (p.h > row->height) 9240 if (p.h > row->height)
@@ -9027,7 +9294,13 @@ draw_fringe_bitmap (w, row, which, left_p)
9027 } 9294 }
9028 9295
9029 /* Adjust y to the offset in the row to start drawing the bitmap. */ 9296 /* Adjust y to the offset in the row to start drawing the bitmap. */
9030 p.y += (row->height - p.h) / 2; 9297 if (period == 0)
9298 p.y += (row->height - p.h) / 2;
9299 else if (period == -2)
9300 {
9301 p.h = fringe_bitmaps[which].height;
9302 p.y += (row->visible_height - p.h);
9303 }
9031 9304
9032 rif->draw_fringe_bitmap (w, row, &p); 9305 rif->draw_fringe_bitmap (w, row, &p);
9033} 9306}
@@ -9040,8 +9313,6 @@ draw_row_fringe_bitmaps (w, row)
9040 struct window *w; 9313 struct window *w;
9041 struct glyph_row *row; 9314 struct glyph_row *row;
9042{ 9315{
9043 enum fringe_bitmap_type bitmap;
9044
9045 xassert (interrupt_input_blocked); 9316 xassert (interrupt_input_blocked);
9046 9317
9047 /* If row is completely invisible, because of vscrolling, we 9318 /* If row is completely invisible, because of vscrolling, we
@@ -9050,35 +9321,35 @@ draw_row_fringe_bitmaps (w, row)
9050 return; 9321 return;
9051 9322
9052 if (WINDOW_LEFT_FRINGE_WIDTH (w) != 0) 9323 if (WINDOW_LEFT_FRINGE_WIDTH (w) != 0)
9053 { 9324 draw_fringe_bitmap (w, row, 1);
9054 /* Decide which bitmap to draw in the left fringe. */
9055 if (row->overlay_arrow_p)
9056 bitmap = OVERLAY_ARROW_BITMAP;
9057 else if (row->truncated_on_left_p)
9058 bitmap = LEFT_TRUNCATION_BITMAP;
9059 else if (MATRIX_ROW_CONTINUATION_LINE_P (row))
9060 bitmap = CONTINUATION_LINE_BITMAP;
9061 else if (row->indicate_empty_line_p)
9062 bitmap = ZV_LINE_BITMAP;
9063 else
9064 bitmap = NO_FRINGE_BITMAP;
9065
9066 draw_fringe_bitmap (w, row, bitmap, 1);
9067 }
9068 9325
9069 if (WINDOW_RIGHT_FRINGE_WIDTH (w) != 0) 9326 if (WINDOW_RIGHT_FRINGE_WIDTH (w) != 0)
9070 { 9327 draw_fringe_bitmap (w, row, 0);
9071 /* Decide which bitmap to draw in the right fringe. */ 9328}
9072 if (row->truncated_on_right_p) 9329
9073 bitmap = RIGHT_TRUNCATION_BITMAP; 9330/* Draw the fringes of window W. Only fringes for rows marked for
9074 else if (row->continued_p) 9331 update in redraw_fringe_bitmaps_p are drawn. */
9075 bitmap = CONTINUED_LINE_BITMAP;
9076 else if (row->indicate_empty_line_p && WINDOW_LEFT_FRINGE_WIDTH (w) == 0)
9077 bitmap = ZV_LINE_BITMAP;
9078 else
9079 bitmap = NO_FRINGE_BITMAP;
9080 9332
9081 draw_fringe_bitmap (w, row, bitmap, 0); 9333void
9334draw_window_fringes (w)
9335 struct window *w;
9336{
9337 struct glyph_row *row;
9338 int yb = window_text_bottom_y (w);
9339 int nrows = w->current_matrix->nrows;
9340 int y = 0, rn;
9341
9342 if (w->pseudo_window_p)
9343 return;
9344
9345 for (y = 0, rn = 0, row = w->current_matrix->rows;
9346 y < yb && rn < nrows;
9347 y += row->height, ++row, ++rn)
9348 {
9349 if (!row->redraw_fringe_bitmaps_p)
9350 continue;
9351 draw_row_fringe_bitmaps (w, row);
9352 row->redraw_fringe_bitmaps_p = 0;
9082 } 9353 }
9083} 9354}
9084 9355
@@ -9986,6 +10257,7 @@ redisplay_internal (preserve_echo_area)
9986 *w->desired_matrix->method = 0; 10257 *w->desired_matrix->method = 0;
9987 debug_method_add (w, "optimization 1"); 10258 debug_method_add (w, "optimization 1");
9988#endif 10259#endif
10260 update_window_fringes (w, 0);
9989 goto update; 10261 goto update;
9990 } 10262 }
9991 else 10263 else
@@ -11396,6 +11668,135 @@ set_vertical_scroll_bar (w)
11396 set_vertical_scroll_bar_hook (w, end - start, whole, start); 11668 set_vertical_scroll_bar_hook (w, end - start, whole, start);
11397} 11669}
11398 11670
11671
11672/* Recalculate the bitmaps to show in the fringes of window W.
11673 If FORCE_P is 0, only mark rows with modified bitmaps for update in
11674 redraw_fringe_bitmaps_p; else mark all rows for update. */
11675
11676int
11677update_window_fringes (w, force_p)
11678 struct window *w;
11679 int force_p;
11680{
11681 struct glyph_row *row, *cur = 0;
11682 int yb = window_text_bottom_y (w);
11683 int rn, nrows = w->current_matrix->nrows;
11684 int y;
11685 int redraw_p = 0;
11686 Lisp_Object ind;
11687
11688 if (w->pseudo_window_p)
11689 return 0;
11690
11691 if (!MINI_WINDOW_P (w)
11692 && (ind = XBUFFER (w->buffer)->indicate_buffer_boundaries, !NILP (ind)))
11693 {
11694 int do_eob = 1, do_bob = 1;
11695
11696 for (y = 0, rn = 0;
11697 y < yb && rn < nrows;
11698 y += row->height, ++rn)
11699 {
11700 unsigned indicate_bob_p, indicate_top_line_p;
11701 unsigned indicate_eob_p, indicate_bottom_line_p;
11702
11703 row = w->desired_matrix->rows + rn;
11704 if (!row->enabled_p)
11705 row = w->current_matrix->rows + rn;
11706
11707 indicate_bob_p = row->indicate_bob_p;
11708 indicate_top_line_p = row->indicate_top_line_p;
11709 indicate_eob_p = row->indicate_eob_p;
11710 indicate_bottom_line_p = row->indicate_bottom_line_p;
11711
11712 row->indicate_bob_p = row->indicate_top_line_p = 0;
11713 row->indicate_eob_p = row->indicate_bottom_line_p = 0;
11714
11715 if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer)))
11716 row->indicate_bob_p = do_bob, do_bob = 0;
11717 else if (EQ (ind, Qt)
11718 && (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0) == rn)
11719 row->indicate_top_line_p = 1;
11720
11721 if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer)))
11722 row->indicate_eob_p = do_eob, do_eob = 0;
11723 else if (EQ (ind, Qt)
11724 && y + row->height >= yb)
11725 row->indicate_bottom_line_p = 1;
11726
11727 if (indicate_bob_p != row->indicate_bob_p
11728 || indicate_top_line_p != row->indicate_top_line_p
11729 || indicate_eob_p != row->indicate_eob_p
11730 || indicate_bottom_line_p != row->indicate_bottom_line_p)
11731 row->redraw_fringe_bitmaps_p = 1;
11732 }
11733 }
11734
11735 for (y = 0, rn = 0;
11736 y < yb && rn < nrows;
11737 y += row->height, rn++)
11738 {
11739 enum fringe_bitmap_type left, right;
11740
11741 row = w->desired_matrix->rows + rn;
11742 cur = w->current_matrix->rows + rn;
11743 if (!row->enabled_p)
11744 row = cur;
11745
11746 /* Decide which bitmap to draw in the left fringe. */
11747 if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0)
11748 left = NO_FRINGE_BITMAP;
11749 else if (row->overlay_arrow_p)
11750 left = OVERLAY_ARROW_BITMAP;
11751 else if (row->truncated_on_left_p)
11752 left = LEFT_TRUNCATION_BITMAP;
11753 else if (MATRIX_ROW_CONTINUATION_LINE_P (row))
11754 left = CONTINUATION_LINE_BITMAP;
11755 else if (row->indicate_empty_line_p)
11756 left = ZV_LINE_BITMAP;
11757 else if (row->indicate_bob_p)
11758 left = FIRST_LINE_BITMAP;
11759 else
11760 left = NO_FRINGE_BITMAP;
11761
11762 /* Decide which bitmap to draw in the right fringe. */
11763 if (WINDOW_RIGHT_FRINGE_WIDTH (w) == 0)
11764 right = NO_FRINGE_BITMAP;
11765 else if (row->truncated_on_right_p)
11766 right = RIGHT_TRUNCATION_BITMAP;
11767 else if (row->continued_p)
11768 right = CONTINUED_LINE_BITMAP;
11769 else if (row->indicate_eob_p)
11770 right = LAST_LINE_BITMAP;
11771 else if (row->indicate_top_line_p)
11772 right = UP_ARROW_BITMAP;
11773 else if (row->indicate_bottom_line_p)
11774 right = DOWN_ARROW_BITMAP;
11775 else if (row->indicate_empty_line_p && WINDOW_LEFT_FRINGE_WIDTH (w) == 0)
11776 right = ZV_LINE_BITMAP;
11777 else
11778 right = NO_FRINGE_BITMAP;
11779
11780 if (force_p
11781 || row->y != cur->y
11782 || row->visible_height != cur->visible_height
11783 || left != cur->left_fringe_bitmap
11784 || right != cur->right_fringe_bitmap
11785 || cur->redraw_fringe_bitmaps_p)
11786 {
11787 redraw_p = row->redraw_fringe_bitmaps_p = cur->redraw_fringe_bitmaps_p = 1;
11788 cur->left_fringe_bitmap = left;
11789 cur->right_fringe_bitmap = right;
11790 }
11791
11792 row->left_fringe_bitmap = left;
11793 row->right_fringe_bitmap = right;
11794 }
11795
11796 return redraw_p;
11797}
11798
11799
11399/* Redisplay leaf window WINDOW. JUST_THIS_ONE_P non-zero means only 11800/* Redisplay leaf window WINDOW. JUST_THIS_ONE_P non-zero means only
11400 selected_window is redisplayed. 11801 selected_window is redisplayed.
11401 11802
@@ -11418,6 +11819,7 @@ redisplay_window (window, just_this_one_p)
11418 struct it it; 11819 struct it it;
11419 /* Record it now because it's overwritten. */ 11820 /* Record it now because it's overwritten. */
11420 int current_matrix_up_to_date_p = 0; 11821 int current_matrix_up_to_date_p = 0;
11822 int used_current_matrix_p = 0;
11421 /* This is less strict than current_matrix_up_to_date_p. 11823 /* This is less strict than current_matrix_up_to_date_p.
11422 It indictes that the buffer contents and narrowing are unchanged. */ 11824 It indictes that the buffer contents and narrowing are unchanged. */
11423 int buffer_unchanged_p = 0; 11825 int buffer_unchanged_p = 0;
@@ -11724,6 +12126,7 @@ redisplay_window (window, just_this_one_p)
11724 switch (rc) 12126 switch (rc)
11725 { 12127 {
11726 case CURSOR_MOVEMENT_SUCCESS: 12128 case CURSOR_MOVEMENT_SUCCESS:
12129 used_current_matrix_p = 1;
11727 goto done; 12130 goto done;
11728 12131
11729#if 0 /* try_cursor_movement never returns this value. */ 12132#if 0 /* try_cursor_movement never returns this value. */
@@ -11788,7 +12191,8 @@ redisplay_window (window, just_this_one_p)
11788 buffer. */ 12191 buffer. */
11789 || !NILP (Vwindow_scroll_functions) 12192 || !NILP (Vwindow_scroll_functions)
11790 || MINI_WINDOW_P (w) 12193 || MINI_WINDOW_P (w)
11791 || !try_window_reusing_current_matrix (w)) 12194 || !(used_current_matrix_p =
12195 try_window_reusing_current_matrix (w)))
11792 { 12196 {
11793 IF_DEBUG (debug_method_add (w, "1")); 12197 IF_DEBUG (debug_method_add (w, "1"));
11794 try_window (window, startp); 12198 try_window (window, startp);
@@ -11917,7 +12321,8 @@ redisplay_window (window, just_this_one_p)
11917 || !NILP (Vwindow_scroll_functions) 12321 || !NILP (Vwindow_scroll_functions)
11918 || !just_this_one_p 12322 || !just_this_one_p
11919 || MINI_WINDOW_P (w) 12323 || MINI_WINDOW_P (w)
11920 || !try_window_reusing_current_matrix (w)) 12324 || !(used_current_matrix_p =
12325 try_window_reusing_current_matrix (w)))
11921 try_window (window, startp); 12326 try_window (window, startp);
11922 12327
11923 /* If new fonts have been loaded (due to fontsets), give up. We 12328 /* If new fonts have been loaded (due to fontsets), give up. We
@@ -12079,6 +12484,17 @@ redisplay_window (window, just_this_one_p)
12079#endif 12484#endif
12080 } 12485 }
12081 12486
12487 if (update_window_fringes (w, 0)
12488 && (used_current_matrix_p || overlay_arrow_seen)
12489 && !w->pseudo_window_p)
12490 {
12491 update_begin (f);
12492 BLOCK_INPUT;
12493 draw_window_fringes (w);
12494 UNBLOCK_INPUT;
12495 update_end (f);
12496 }
12497
12082 /* We go to this label, with fonts_changed_p nonzero, 12498 /* We go to this label, with fonts_changed_p nonzero,
12083 if it is necessary to try again using larger glyph matrices. 12499 if it is necessary to try again using larger glyph matrices.
12084 We have to redeem the scroll bar even in this case, 12500 We have to redeem the scroll bar even in this case,
@@ -12335,6 +12751,7 @@ try_window_reusing_current_matrix (w)
12335 row->visible_height -= min_y - row->y; 12751 row->visible_height -= min_y - row->y;
12336 if (row->y + row->height > max_y) 12752 if (row->y + row->height > max_y)
12337 row->visible_height -= row->y + row->height - max_y; 12753 row->visible_height -= row->y + row->height - max_y;
12754 row->redraw_fringe_bitmaps_p = 1;
12338 12755
12339 it.current_y += row->height; 12756 it.current_y += row->height;
12340 12757
@@ -12474,7 +12891,6 @@ try_window_reusing_current_matrix (w)
12474 12891
12475 if (run.height) 12892 if (run.height)
12476 { 12893 {
12477 struct frame *f = XFRAME (WINDOW_FRAME (w));
12478 update_begin (f); 12894 update_begin (f);
12479 rif->update_window_begin_hook (w); 12895 rif->update_window_begin_hook (w);
12480 rif->clear_window_mouse_face (w); 12896 rif->clear_window_mouse_face (w);
@@ -12495,6 +12911,7 @@ try_window_reusing_current_matrix (w)
12495 row->visible_height -= min_y - row->y; 12911 row->visible_height -= min_y - row->y;
12496 if (row->y + row->height > max_y) 12912 if (row->y + row->height > max_y)
12497 row->visible_height -= row->y + row->height - max_y; 12913 row->visible_height -= row->y + row->height - max_y;
12914 row->redraw_fringe_bitmaps_p = 1;
12498 } 12915 }
12499 12916
12500 /* Scroll the current matrix. */ 12917 /* Scroll the current matrix. */
@@ -12617,7 +13034,8 @@ find_last_unchanged_at_beg_row (w)
12617 row is not unchanged because it may be no longer 13034 row is not unchanged because it may be no longer
12618 continued. */ 13035 continued. */
12619 && !(MATRIX_ROW_END_CHARPOS (row) == first_changed_pos 13036 && !(MATRIX_ROW_END_CHARPOS (row) == first_changed_pos
12620 && row->continued_p)) 13037 && (row->continued_p
13038 || row->exact_window_width_line_p)))
12621 row_found = row; 13039 row_found = row;
12622 13040
12623 /* Stop if last visible row. */ 13041 /* Stop if last visible row. */
@@ -14513,7 +14931,18 @@ display_line (it)
14513 it->continuation_lines_width += new_x; 14931 it->continuation_lines_width += new_x;
14514 ++it->hpos; 14932 ++it->hpos;
14515 if (i == nglyphs - 1) 14933 if (i == nglyphs - 1)
14516 set_iterator_to_next (it, 1); 14934 {
14935 set_iterator_to_next (it, 1);
14936 if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it))
14937 {
14938 get_next_display_element (it);
14939 if (ITERATOR_AT_END_OF_LINE_P (it))
14940 {
14941 row->continued_p = 0;
14942 row->exact_window_width_line_p = 1;
14943 }
14944 }
14945 }
14517 } 14946 }
14518 else if (CHAR_GLYPH_PADDING_P (*glyph) 14947 else if (CHAR_GLYPH_PADDING_P (*glyph)
14519 && !FRAME_WINDOW_P (it->f)) 14948 && !FRAME_WINDOW_P (it->f))
@@ -14615,6 +15044,7 @@ display_line (it)
14615 break; 15044 break;
14616 } 15045 }
14617 15046
15047 at_end_of_line:
14618 /* Is this a line end? If yes, we're also done, after making 15048 /* Is this a line end? If yes, we're also done, after making
14619 sure that a non-default face is extended up to the right 15049 sure that a non-default face is extended up to the right
14620 margin of the window. */ 15050 margin of the window. */
@@ -14626,7 +15056,8 @@ display_line (it)
14626 15056
14627 /* Add a space at the end of the line that is used to 15057 /* Add a space at the end of the line that is used to
14628 display the cursor there. */ 15058 display the cursor there. */
14629 append_space (it, 0); 15059 if (!IT_OVERFLOW_NEWLINE_INTO_FRINGE (it))
15060 append_space (it, 0);
14630 15061
14631 /* Extend the face to the end of the line. */ 15062 /* Extend the face to the end of the line. */
14632 extend_face_to_end_of_line (it); 15063 extend_face_to_end_of_line (it);
@@ -14667,6 +15098,19 @@ display_line (it)
14667 produce_special_glyphs (it, IT_TRUNCATION); 15098 produce_special_glyphs (it, IT_TRUNCATION);
14668 } 15099 }
14669 } 15100 }
15101 else
15102 {
15103 /* Don't truncate if we can overflow newline into fringe. */
15104 if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it))
15105 {
15106 get_next_display_element (it);
15107 if (ITERATOR_AT_END_OF_LINE_P (it))
15108 {
15109 row->exact_window_width_line_p = 1;
15110 goto at_end_of_line;
15111 }
15112 }
15113 }
14670 15114
14671 row->truncated_on_right_p = 1; 15115 row->truncated_on_right_p = 1;
14672 it->continuation_lines_width = 0; 15116 it->continuation_lines_width = 0;
@@ -19206,36 +19650,53 @@ notice_overwritten_cursor (w, area, x0, x1, y0, y1)
19206 enum glyph_row_area area; 19650 enum glyph_row_area area;
19207 int x0, y0, x1, y1; 19651 int x0, y0, x1, y1;
19208{ 19652{
19209 if (area == TEXT_AREA && w->phys_cursor_on_p) 19653 int cx0, cx1, cy0, cy1;
19210 { 19654 struct glyph_row *row;
19211 int cx0 = w->phys_cursor.x;
19212 int cx1 = cx0 + w->phys_cursor_width;
19213 int cy0 = w->phys_cursor.y;
19214 int cy1 = cy0 + w->phys_cursor_height;
19215 19655
19216 if (x0 <= cx0 && (x1 < 0 || x1 >= cx1)) 19656 if (!w->phys_cursor_on_p)
19217 { 19657 return;
19218 /* The cursor image will be completely removed from the 19658 if (area != TEXT_AREA)
19219 screen if the output area intersects the cursor area in 19659 return;
19220 y-direction. When we draw in [y0 y1[, and some part of
19221 the cursor is at y < y0, that part must have been drawn
19222 before. When scrolling, the cursor is erased before
19223 actually scrolling, so we don't come here. When not
19224 scrolling, the rows above the old cursor row must have
19225 changed, and in this case these rows must have written
19226 over the cursor image.
19227 19660
19228 Likewise if part of the cursor is below y1, with the 19661 row = w->current_matrix->rows + w->phys_cursor.vpos;
19229 exception of the cursor being in the first blank row at 19662 if (!row->displays_text_p)
19230 the buffer and window end because update_text_area 19663 return;
19231 doesn't draw that row. (Except when it does, but
19232 that's handled in update_text_area.) */
19233 19664
19234 if (((y0 >= cy0 && y0 < cy1) || (y1 > cy0 && y1 < cy1)) 19665 if (row->cursor_in_fringe_p)
19235 && w->current_matrix->rows[w->phys_cursor.vpos].displays_text_p) 19666 {
19236 w->phys_cursor_on_p = 0; 19667 row->cursor_in_fringe_p = 0;
19237 } 19668 draw_fringe_bitmap (w, row, 0);
19669 w->phys_cursor_on_p = 0;
19670 return;
19238 } 19671 }
19672
19673 cx0 = w->phys_cursor.x;
19674 cx1 = cx0 + w->phys_cursor_width;
19675 if (x0 > cx0 || (x1 >= 0 && x1 < cx1))
19676 return;
19677
19678 /* The cursor image will be completely removed from the
19679 screen if the output area intersects the cursor area in
19680 y-direction. When we draw in [y0 y1[, and some part of
19681 the cursor is at y < y0, that part must have been drawn
19682 before. When scrolling, the cursor is erased before
19683 actually scrolling, so we don't come here. When not
19684 scrolling, the rows above the old cursor row must have
19685 changed, and in this case these rows must have written
19686 over the cursor image.
19687
19688 Likewise if part of the cursor is below y1, with the
19689 exception of the cursor being in the first blank row at
19690 the buffer and window end because update_text_area
19691 doesn't draw that row. (Except when it does, but
19692 that's handled in update_text_area.) */
19693
19694 cy0 = w->phys_cursor.y;
19695 cy1 = cy0 + w->phys_cursor_height;
19696 if ((y0 < cy0 || y0 >= cy1) && (y1 <= cy0 || y1 >= cy1))
19697 return;
19698
19699 w->phys_cursor_on_p = 0;
19239} 19700}
19240 19701
19241#endif /* HAVE_WINDOW_SYSTEM */ 19702#endif /* HAVE_WINDOW_SYSTEM */
@@ -19370,6 +19831,14 @@ erase_phys_cursor (w)
19370 if (cursor_row->visible_height <= 0) 19831 if (cursor_row->visible_height <= 0)
19371 goto mark_cursor_off; 19832 goto mark_cursor_off;
19372 19833
19834 /* If cursor is in the fringe, erase by drawing actual bitmap there. */
19835 if (cursor_row->cursor_in_fringe_p)
19836 {
19837 cursor_row->cursor_in_fringe_p = 0;
19838 draw_fringe_bitmap (w, cursor_row, 0);
19839 goto mark_cursor_off;
19840 }
19841
19373 /* This can happen when the new row is shorter than the old one. 19842 /* This can happen when the new row is shorter than the old one.
19374 In this case, either draw_glyphs or clear_end_of_line 19843 In this case, either draw_glyphs or clear_end_of_line
19375 should have cleared the cursor. Note that we wouldn't be 19844 should have cleared the cursor. Note that we wouldn't be
@@ -21524,12 +21993,21 @@ wide as that tab on the display. */);
21524#endif 21993#endif
21525 21994
21526 DEFVAR_LISP ("show-trailing-whitespace", &Vshow_trailing_whitespace, 21995 DEFVAR_LISP ("show-trailing-whitespace", &Vshow_trailing_whitespace,
21527 doc: /* Non-nil means highlight trailing whitespace. 21996 doc: /* *Non-nil means highlight trailing whitespace.
21528The face used for trailing whitespace is `trailing-whitespace'. */); 21997The face used for trailing whitespace is `trailing-whitespace'. */);
21529 Vshow_trailing_whitespace = Qnil; 21998 Vshow_trailing_whitespace = Qnil;
21530 21999
22000 DEFVAR_LISP ("overflow-newline-into-fringe", &Voverflow_newline_into_fringe,
22001 doc: /* *Non-nil means that newline may flow into the right fringe.
22002This means that display lines which are exactly as wide as the window
22003(not counting the final newline) will only occupy one screen line, by
22004showing (or hiding) the final newline in the right fringe; when point
22005is at the final newline, the cursor is shown in the right fringe.
22006If nil, also continue lines which are exactly as wide as the window. */);
22007 Voverflow_newline_into_fringe = Qt;
22008
21531 DEFVAR_LISP ("void-text-area-pointer", &Vvoid_text_area_pointer, 22009 DEFVAR_LISP ("void-text-area-pointer", &Vvoid_text_area_pointer,
21532 doc: /* The pointer shape to show in void text areas. 22010 doc: /* *The pointer shape to show in void text areas.
21533Nil means to show the text pointer. Other options are `arrow', `text', 22011Nil means to show the text pointer. Other options are `arrow', `text',
21534`hand', `vdrag', `hdrag', `modeline', and `hourglass'. */); 22012`hand', `vdrag', `hdrag', `modeline', and `hourglass'. */);
21535 Vvoid_text_area_pointer = Qarrow; 22013 Vvoid_text_area_pointer = Qarrow;