comparison src/xdisp.c @ 34225:b5cdf1bb6bb8

(next_element_from_ellipsis): Save face before selective display in saved_face_id, and set face_before_selective_p. (reseat_1): Reset face_before_selective_p. (append_space, extend_face_to_end_of_line): If iterator's face_before_selective_p is set, use the face from saved_face_id. (extend_face_to_end_of_line): For tty frames, make sure to use the right face id when producing spaces at the end of the line.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 05 Dec 2000 21:35:36 +0000
parents 4a200b2a343b
children fb271e34071c
comparison
equal deleted inserted replaced
34224:5a5d98ee4078 34225:b5cdf1bb6bb8
3645 IT_STRING_CHARPOS (*it) = -1; 3645 IT_STRING_CHARPOS (*it) = -1;
3646 IT_STRING_BYTEPOS (*it) = -1; 3646 IT_STRING_BYTEPOS (*it) = -1;
3647 it->string = Qnil; 3647 it->string = Qnil;
3648 it->method = next_element_from_buffer; 3648 it->method = next_element_from_buffer;
3649 it->sp = 0; 3649 it->sp = 0;
3650 it->face_before_selective_p = 0;
3650 3651
3651 if (set_stop_p) 3652 if (set_stop_p)
3652 it->stop_charpos = CHARPOS (pos); 3653 it->stop_charpos = CHARPOS (pos);
3653 } 3654 }
3654 3655
4301 it->method = next_element_from_display_vector; 4302 it->method = next_element_from_display_vector;
4302 } 4303 }
4303 } 4304 }
4304 else 4305 else
4305 { 4306 {
4307 /* The face at the current position may be different from the
4308 face we find after the invisible text. Remember what it
4309 was in IT->saved_face_id, and signal that it's there by
4310 setting face_before_selective_p. */
4311 it->saved_face_id = it->face_id;
4306 it->method = next_element_from_buffer; 4312 it->method = next_element_from_buffer;
4307 reseat_at_next_visible_line_start (it, 1); 4313 reseat_at_next_visible_line_start (it, 1);
4314 it->face_before_selective_p = 1;
4308 } 4315 }
4309 4316
4310 return get_next_display_element (it); 4317 return get_next_display_element (it);
4311 } 4318 }
4312 4319
11700 it->c = ' '; 11707 it->c = ' ';
11701 it->len = 1; 11708 it->len = 1;
11702 11709
11703 if (default_face_p) 11710 if (default_face_p)
11704 it->face_id = DEFAULT_FACE_ID; 11711 it->face_id = DEFAULT_FACE_ID;
11712 else if (it->face_before_selective_p)
11713 it->face_id = it->saved_face_id;
11705 face = FACE_FROM_ID (it->f, it->face_id); 11714 face = FACE_FROM_ID (it->f, it->face_id);
11706 it->face_id = FACE_FOR_CHAR (it->f, face, 0); 11715 it->face_id = FACE_FOR_CHAR (it->f, face, 0);
11707 11716
11708 PRODUCE_GLYPHS (it); 11717 PRODUCE_GLYPHS (it);
11709 11718
11738 if (it->current_x >= it->last_visible_x) 11747 if (it->current_x >= it->last_visible_x)
11739 return; 11748 return;
11740 11749
11741 /* Face extension extends the background and box of IT->face_id 11750 /* Face extension extends the background and box of IT->face_id
11742 to the end of the line. If the background equals the background 11751 to the end of the line. If the background equals the background
11743 of the frame, we haven't to do anything. */ 11752 of the frame, we don't have to do anything. */
11744 face = FACE_FROM_ID (f, it->face_id); 11753 if (it->face_before_selective_p)
11754 face = FACE_FROM_ID (it->f, it->saved_face_id);
11755 else
11756 face = FACE_FROM_ID (f, it->face_id);
11757
11745 if (FRAME_WINDOW_P (f) 11758 if (FRAME_WINDOW_P (f)
11746 && face->box == FACE_NO_BOX 11759 && face->box == FACE_NO_BOX
11747 && face->background == FRAME_BACKGROUND_PIXEL (f) 11760 && face->background == FRAME_BACKGROUND_PIXEL (f)
11748 && !face->stipple) 11761 && !face->stipple)
11749 return; 11762 return;
11777 /* Save some values that must not be changed. */ 11790 /* Save some values that must not be changed. */
11778 int saved_x = it->current_x; 11791 int saved_x = it->current_x;
11779 struct text_pos saved_pos; 11792 struct text_pos saved_pos;
11780 Lisp_Object saved_object; 11793 Lisp_Object saved_object;
11781 int saved_what = it->what; 11794 int saved_what = it->what;
11795 int saved_face_id = it->face_id;
11782 11796
11783 saved_object = it->object; 11797 saved_object = it->object;
11784 saved_pos = it->position; 11798 saved_pos = it->position;
11785 11799
11786 it->what = IT_CHARACTER; 11800 it->what = IT_CHARACTER;
11787 bzero (&it->position, sizeof it->position); 11801 bzero (&it->position, sizeof it->position);
11788 it->object = make_number (0); 11802 it->object = make_number (0);
11789 it->c = ' '; 11803 it->c = ' ';
11790 it->len = 1; 11804 it->len = 1;
11805 it->face_id = face->id;
11791 11806
11792 PRODUCE_GLYPHS (it); 11807 PRODUCE_GLYPHS (it);
11793 11808
11794 while (it->current_x <= it->last_visible_x) 11809 while (it->current_x <= it->last_visible_x)
11795 PRODUCE_GLYPHS (it); 11810 PRODUCE_GLYPHS (it);
11798 truncation glyph below and make us set the cursor on them, maybe. */ 11813 truncation glyph below and make us set the cursor on them, maybe. */
11799 it->current_x = saved_x; 11814 it->current_x = saved_x;
11800 it->object = saved_object; 11815 it->object = saved_object;
11801 it->position = saved_pos; 11816 it->position = saved_pos;
11802 it->what = saved_what; 11817 it->what = saved_what;
11818 it->face_id = saved_face_id;
11803 } 11819 }
11804 } 11820 }
11805 11821
11806 11822
11807 /* Value is non-zero if text starting at CHARPOS in current_buffer is 11823 /* Value is non-zero if text starting at CHARPOS in current_buffer is