diff options
| author | Richard M. Stallman | 1993-05-13 00:19:20 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-05-13 00:19:20 +0000 |
| commit | 68a37fa8c726ccf2745d226bd6346767c8ef108c (patch) | |
| tree | 39001eec8ec1c9188c90beb30c0dc57c45b9cfa7 /src | |
| parent | 8693344e1fbe8403616c3df8510a17168fa4ca0e (diff) | |
| download | emacs-68a37fa8c726ccf2745d226bd6346767c8ef108c.tar.gz emacs-68a37fa8c726ccf2745d226bd6346767c8ef108c.zip | |
(display_text_line): Use break; to exit loop at eol.
Duplicate the short MAKE_GLYPH loop after the main loop.
If no display table, do obey selective_display_ellipses.
(copy_part_of_rope): Arg FROM is now Lisp_Object *.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 68 |
1 files changed, 46 insertions, 22 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 5e19209b105..f2680580aa1 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -1563,20 +1563,18 @@ copy_rope (t, s, from) | |||
| 1563 | return t; | 1563 | return t; |
| 1564 | } | 1564 | } |
| 1565 | 1565 | ||
| 1566 | /* Similar but copy at most LEN glyphs. */ | 1566 | /* Copy exactly LEN glyphs from FROM into data at T. |
| 1567 | But don't alter words before S. */ | ||
| 1567 | 1568 | ||
| 1568 | GLYPH * | 1569 | GLYPH * |
| 1569 | copy_part_of_rope (t, s, from, len) | 1570 | copy_part_of_rope (t, s, from, len) |
| 1570 | register GLYPH *t; /* Copy to here. */ | 1571 | register GLYPH *t; /* Copy to here. */ |
| 1571 | register GLYPH *s; /* Starting point. */ | 1572 | register GLYPH *s; /* Starting point. */ |
| 1572 | Lisp_Object from; /* Data to copy; known to be a vector. */ | 1573 | Lisp_Object *from; /* Data to copy; known to be a vector. */ |
| 1573 | int len; | 1574 | int len; |
| 1574 | { | 1575 | { |
| 1575 | register int n = XVECTOR (from)->size; | 1576 | int n = len; |
| 1576 | register Lisp_Object *f = XVECTOR (from)->contents; | 1577 | register Lisp_Object *f = from; |
| 1577 | |||
| 1578 | if (n > len) | ||
| 1579 | n = len; | ||
| 1580 | 1578 | ||
| 1581 | while (n--) | 1579 | while (n--) |
| 1582 | { | 1580 | { |
| @@ -1636,14 +1634,24 @@ display_text_line (w, start, vpos, hpos, taboffset) | |||
| 1636 | = XTYPE (current_buffer->selective_display) == Lisp_Int | 1634 | = XTYPE (current_buffer->selective_display) == Lisp_Int |
| 1637 | ? XINT (current_buffer->selective_display) | 1635 | ? XINT (current_buffer->selective_display) |
| 1638 | : !NILP (current_buffer->selective_display) ? -1 : 0; | 1636 | : !NILP (current_buffer->selective_display) ? -1 : 0; |
| 1639 | #ifndef old | ||
| 1640 | int selective_e = selective && !NILP (current_buffer->selective_display_ellipses); | ||
| 1641 | #endif | ||
| 1642 | register struct frame_glyphs *desired_glyphs = FRAME_DESIRED_GLYPHS (f); | 1637 | register struct frame_glyphs *desired_glyphs = FRAME_DESIRED_GLYPHS (f); |
| 1643 | register struct Lisp_Vector *dp = window_display_table (w); | 1638 | register struct Lisp_Vector *dp = window_display_table (w); |
| 1639 | |||
| 1640 | Lisp_Object default_invis_vector[3]; | ||
| 1641 | /* Nonzero means display something where there are invisible lines. | ||
| 1642 | The precise value is the number of glyphs to display. */ | ||
| 1644 | int selective_rlen | 1643 | int selective_rlen |
| 1645 | = (selective && dp && XTYPE (DISP_INVIS_VECTOR (dp)) == Lisp_Vector | 1644 | = (selective && dp && XTYPE (DISP_INVIS_VECTOR (dp)) == Lisp_Vector |
| 1646 | ? XVECTOR (DISP_INVIS_VECTOR (dp))->size : 0); | 1645 | ? XVECTOR (DISP_INVIS_VECTOR (dp))->size |
| 1646 | : selective && !NILP (current_buffer->selective_display_ellipses) | ||
| 1647 | ? 3 : 0); | ||
| 1648 | /* This is the sequence of Lisp objects to display | ||
| 1649 | when there are invisible lines. */ | ||
| 1650 | Lisp_Object *invis_vector_contents | ||
| 1651 | = (dp && XTYPE (DISP_INVIS_VECTOR (dp)) == Lisp_Vector | ||
| 1652 | ? XVECTOR (DISP_INVIS_VECTOR (dp))->contents | ||
| 1653 | : default_invis_vector); | ||
| 1654 | |||
| 1647 | GLYPH truncator = (dp == 0 || XTYPE (DISP_TRUNC_GLYPH (dp)) != Lisp_Int | 1655 | GLYPH truncator = (dp == 0 || XTYPE (DISP_TRUNC_GLYPH (dp)) != Lisp_Int |
| 1648 | ? '$' : XINT (DISP_TRUNC_GLYPH (dp))); | 1656 | ? '$' : XINT (DISP_TRUNC_GLYPH (dp))); |
| 1649 | GLYPH continuer = (dp == 0 || XTYPE (DISP_CONTINUE_GLYPH (dp)) != Lisp_Int | 1657 | GLYPH continuer = (dp == 0 || XTYPE (DISP_CONTINUE_GLYPH (dp)) != Lisp_Int |
| @@ -1656,6 +1664,9 @@ display_text_line (w, start, vpos, hpos, taboffset) | |||
| 1656 | /* The face we're currently using. */ | 1664 | /* The face we're currently using. */ |
| 1657 | int current_face; | 1665 | int current_face; |
| 1658 | 1666 | ||
| 1667 | XFASTINT (default_invis_vector[2]) = '.'; | ||
| 1668 | default_invis_vector[0] = default_invis_vector[1] = default_invis_vector[2]; | ||
| 1669 | |||
| 1659 | hpos += XFASTINT (w->left); | 1670 | hpos += XFASTINT (w->left); |
| 1660 | get_display_line (f, vpos, XFASTINT (w->left)); | 1671 | get_display_line (f, vpos, XFASTINT (w->left)); |
| 1661 | if (tab_width <= 0 || tab_width > 1000) tab_width = 8; | 1672 | if (tab_width <= 0 || tab_width > 1000) tab_width = 8; |
| @@ -1747,15 +1758,10 @@ display_text_line (w, start, vpos, hpos, taboffset) | |||
| 1747 | p1 += selective_rlen; | 1758 | p1 += selective_rlen; |
| 1748 | if (p1 - startp > width) | 1759 | if (p1 - startp > width) |
| 1749 | p1 = endp; | 1760 | p1 = endp; |
| 1750 | copy_part_of_rope (p1prev, p1prev, | 1761 | copy_part_of_rope (p1prev, p1prev, invis_vector_contents, |
| 1751 | XVECTOR (DISP_INVIS_VECTOR (dp))->contents, | ||
| 1752 | (p1 - p1prev)); | 1762 | (p1 - p1prev)); |
| 1753 | } | 1763 | } |
| 1754 | 1764 | break; | |
| 1755 | /* This assures we'll exit the loop, but still gives us a chance to | ||
| 1756 | apply current_face to the glyphs we've laid down. */ | ||
| 1757 | end = pos; | ||
| 1758 | pause = end; | ||
| 1759 | } | 1765 | } |
| 1760 | else if (c == '\t') | 1766 | else if (c == '\t') |
| 1761 | { | 1767 | { |
| @@ -1778,12 +1784,10 @@ display_text_line (w, start, vpos, hpos, taboffset) | |||
| 1778 | p1 += selective_rlen; | 1784 | p1 += selective_rlen; |
| 1779 | if (p1 - startp > width) | 1785 | if (p1 - startp > width) |
| 1780 | p1 = endp; | 1786 | p1 = endp; |
| 1781 | copy_part_of_rope (p1prev, p1prev, | 1787 | copy_part_of_rope (p1prev, p1prev, invis_vector_contents, |
| 1782 | XVECTOR(DISP_INVIS_VECTOR (dp))->contents, | ||
| 1783 | (p1 - p1prev)); | 1788 | (p1 - p1prev)); |
| 1784 | } | 1789 | } |
| 1785 | end = pos; | 1790 | break; |
| 1786 | pause = end; | ||
| 1787 | } | 1791 | } |
| 1788 | else if (dp != 0 && XTYPE (DISP_CHAR_VECTOR (dp, c)) == Lisp_Vector) | 1792 | else if (dp != 0 && XTYPE (DISP_CHAR_VECTOR (dp, c)) == Lisp_Vector) |
| 1789 | { | 1793 | { |
| @@ -1840,6 +1844,26 @@ display_text_line (w, start, vpos, hpos, taboffset) | |||
| 1840 | pos++; | 1844 | pos++; |
| 1841 | } | 1845 | } |
| 1842 | 1846 | ||
| 1847 | #ifdef HAVE_X_WINDOWS | ||
| 1848 | /* If we exited the above loop at end of line, | ||
| 1849 | we may have laid down some characters between p1prev and p1. | ||
| 1850 | If so, apply current_face to those who have a face of zero | ||
| 1851 | (the default), and apply Vglyph_table to the result. */ | ||
| 1852 | if (current_face) | ||
| 1853 | { | ||
| 1854 | GLYPH *gstart, *gp, *gend; | ||
| 1855 | |||
| 1856 | gstart = (p1prev > startp) ? p1prev : startp; | ||
| 1857 | gend = (p1 < endp) ? p1 : endp; | ||
| 1858 | |||
| 1859 | for (gp = gstart; gp < gend; gp++) | ||
| 1860 | *gp = MAKE_GLYPH (GLYPH_CHAR (*gp), | ||
| 1861 | (GLYPH_FACE (*gp) == 0 | ||
| 1862 | ? current_face | ||
| 1863 | : compute_glyph_face (f, GLYPH_FACE (*gp)))); | ||
| 1864 | } | ||
| 1865 | #endif | ||
| 1866 | |||
| 1843 | val.hpos = - XINT (w->hscroll); | 1867 | val.hpos = - XINT (w->hscroll); |
| 1844 | if (val.hpos) | 1868 | if (val.hpos) |
| 1845 | val.hpos++; | 1869 | val.hpos++; |