aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1993-03-08 06:37:04 +0000
committerRichard M. Stallman1993-03-08 06:37:04 +0000
commitc581d7100cec3a2e8b8411155f822e6200139faa (patch)
tree41ab7af519c1585ee3b752d3c5d68bb480e5319d /src
parent10e6549c5f805d026a44988da71d3cc88226bee1 (diff)
downloademacs-c581d7100cec3a2e8b8411155f822e6200139faa.tar.gz
emacs-c581d7100cec3a2e8b8411155f822e6200139faa.zip
(copy_rope): Expect FROM to be a vector.
(copy_part_of_rope): New function. (display_string): Expect display table elts to be vectors.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c65
1 files changed, 44 insertions, 21 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 05ea6195c66..1ee9158fcd0 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1,5 +1,5 @@
1/* Display generation from window structure and buffer text. 1/* Display generation from window structure and buffer text.
2 Copyright (C) 1985, 1986, 1987, 1988, 1992, 1993 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1987, 1988, 1993 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
@@ -1433,21 +1433,42 @@ try_window_id (window)
1433 return 1; 1433 return 1;
1434} 1434}
1435 1435
1436/* Copy glyphs from the rope FROM to T. 1436/* Copy glyphs from the vector FROM to the rope T.
1437 But don't actually copy the parts that would come in before S. 1437 But don't actually copy the parts that would come in before S.
1438 Value is T, advanced past the copied data. 1438 Value is T, advanced past the copied data. */
1439
1440 Characters in FROM are grouped into units of `sizeof GLYPH' chars;
1441 any extra chars at the end of FROM are ignored. */
1442 1439
1443GLYPH * 1440GLYPH *
1444copy_rope (t, s, from) 1441copy_rope (t, s, from)
1445 register GLYPH *t; /* Copy to here. */ 1442 register GLYPH *t; /* Copy to here. */
1446 register GLYPH *s; /* Starting point. */ 1443 register GLYPH *s; /* Starting point. */
1447 Lisp_Object from; /* Data to copy; known to be a string. */ 1444 Lisp_Object from; /* Data to copy; known to be a vector. */
1448{ 1445{
1449 register int n = XSTRING (from)->size / sizeof (GLYPH); 1446 register int n = XVECTOR (from)->size;
1450 register GLYPH *f = (GLYPH *) XSTRING (from)->data; 1447 register Lisp_Object *f = XVECTOR (from)->contents;
1448
1449 while (n--)
1450 {
1451 if (t >= s) *t = *f;
1452 ++t;
1453 ++f;
1454 }
1455 return t;
1456}
1457
1458/* Similar but copy at most LEN glyphs. */
1459
1460GLYPH *
1461copy_part_of_rope (t, s, from, len)
1462 register GLYPH *t; /* Copy to here. */
1463 register GLYPH *s; /* Starting point. */
1464 Lisp_Object from; /* Data to copy; known to be a vector. */
1465 int len;
1466{
1467 register int n = XVECTOR (from)->size;
1468 register Lisp_Object *f = XVECTOR (from)->contents;
1469
1470 if (n > len)
1471 n = len;
1451 1472
1452 while (n--) 1473 while (n--)
1453 { 1474 {
@@ -1513,8 +1534,8 @@ display_text_line (w, start, vpos, hpos, taboffset)
1513 register struct frame_glyphs *desired_glyphs = FRAME_DESIRED_GLYPHS (f); 1534 register struct frame_glyphs *desired_glyphs = FRAME_DESIRED_GLYPHS (f);
1514 register struct Lisp_Vector *dp = window_display_table (w); 1535 register struct Lisp_Vector *dp = window_display_table (w);
1515 int selective_rlen 1536 int selective_rlen
1516 = (selective && dp && XTYPE (DISP_INVIS_ROPE (dp)) == Lisp_String 1537 = (selective && dp && XTYPE (DISP_INVIS_VECTOR (dp)) == Lisp_Vector
1517 ? XSTRING (DISP_INVIS_ROPE (dp))->size / sizeof (GLYPH) : 0); 1538 ? XVECTOR (DISP_INVIS_VECTOR (dp))->size : 0);
1518 GLYPH truncator = (dp == 0 || XTYPE (DISP_TRUNC_GLYPH (dp)) != Lisp_Int 1539 GLYPH truncator = (dp == 0 || XTYPE (DISP_TRUNC_GLYPH (dp)) != Lisp_Int
1519 ? '$' : XINT (DISP_TRUNC_GLYPH (dp))); 1540 ? '$' : XINT (DISP_TRUNC_GLYPH (dp)));
1520 GLYPH continuer = (dp == 0 || XTYPE (DISP_CONTINUE_GLYPH (dp)) != Lisp_Int 1541 GLYPH continuer = (dp == 0 || XTYPE (DISP_CONTINUE_GLYPH (dp)) != Lisp_Int
@@ -1568,7 +1589,7 @@ display_text_line (w, start, vpos, hpos, taboffset)
1568 } 1589 }
1569 c = *p++; 1590 c = *p++;
1570 if (c >= 040 && c < 0177 1591 if (c >= 040 && c < 0177
1571 && (dp == 0 || XTYPE (DISP_CHAR_ROPE (dp, c)) != Lisp_String)) 1592 && (dp == 0 || XTYPE (DISP_CHAR_VECTOR (dp, c)) != Lisp_Vector))
1572 { 1593 {
1573 if (p1 >= startp) 1594 if (p1 >= startp)
1574 *p1 = c; 1595 *p1 = c;
@@ -1591,8 +1612,9 @@ display_text_line (w, start, vpos, hpos, taboffset)
1591 p1 += selective_rlen; 1612 p1 += selective_rlen;
1592 if (p1 - startp > width) 1613 if (p1 - startp > width)
1593 p1 = endp; 1614 p1 = endp;
1594 bcopy (XSTRING (DISP_INVIS_ROPE (dp))->data, p1prev, 1615 copy_part_of_rope (p1prev, p1prev,
1595 (p1 - p1prev) * sizeof (GLYPH)); 1616 XVECTOR (DISP_INVIS_VECTOR (dp))->contents,
1617 (p1 - p1prev));
1596 } 1618 }
1597 break; 1619 break;
1598 } 1620 }
@@ -1617,14 +1639,15 @@ display_text_line (w, start, vpos, hpos, taboffset)
1617 p1 += selective_rlen; 1639 p1 += selective_rlen;
1618 if (p1 - startp > width) 1640 if (p1 - startp > width)
1619 p1 = endp; 1641 p1 = endp;
1620 bcopy (XSTRING (DISP_INVIS_ROPE (dp))->data, p1prev, 1642 copy_part_of_rope (p1prev, p1prev,
1621 (p1 - p1prev) * sizeof (GLYPH)); 1643 XVECTOR(DISP_INVIS_VECTOR (dp))->contents,
1644 (p1 - p1prev));
1622 } 1645 }
1623 break; 1646 break;
1624 } 1647 }
1625 else if (dp != 0 && XTYPE (DISP_CHAR_ROPE (dp, c)) == Lisp_String) 1648 else if (dp != 0 && XTYPE (DISP_CHAR_VECTOR (dp, c)) == Lisp_Vector)
1626 { 1649 {
1627 p1 = copy_rope (p1, startp, DISP_CHAR_ROPE (dp, c)); 1650 p1 = copy_rope (p1, startp, DISP_CHAR_VECTOR (dp, c));
1628 } 1651 }
1629 else if (c < 0200 && ctl_arrow) 1652 else if (c < 0200 && ctl_arrow)
1630 { 1653 {
@@ -2279,7 +2302,7 @@ display_string (w, vpos, string, hpos, truncate, mincol, maxcol)
2279 c = *string++; 2302 c = *string++;
2280 if (!c) break; 2303 if (!c) break;
2281 if (c >= 040 && c < 0177 2304 if (c >= 040 && c < 0177
2282 && (dp == 0 || XTYPE (DISP_CHAR_ROPE (dp, c)) != Lisp_String)) 2305 && (dp == 0 || XTYPE (DISP_CHAR_VECTOR (dp, c)) != Lisp_Vector))
2283 { 2306 {
2284 if (p1 >= start) 2307 if (p1 >= start)
2285 *p1 = c; 2308 *p1 = c;
@@ -2295,8 +2318,8 @@ display_string (w, vpos, string, hpos, truncate, mincol, maxcol)
2295 } 2318 }
2296 while ((p1 - start + hscroll - (hscroll > 0)) % tab_width); 2319 while ((p1 - start + hscroll - (hscroll > 0)) % tab_width);
2297 } 2320 }
2298 else if (dp != 0 && XTYPE (DISP_CHAR_ROPE (dp, c)) == Lisp_String) 2321 else if (dp != 0 && XTYPE (DISP_CHAR_VECTOR (dp, c)) == Lisp_Vector)
2299 p1 = copy_rope (p1, start, DISP_CHAR_ROPE (dp, c)); 2322 p1 = copy_rope (p1, start, DISP_CHAR_VECTOR (dp, c));
2300 else if (c < 0200 && ! NILP (buffer_defaults.ctl_arrow)) 2323 else if (c < 0200 && ! NILP (buffer_defaults.ctl_arrow))
2301 { 2324 {
2302 if (p1 >= start) 2325 if (p1 >= start)