Mercurial > hg > xemacs-beta
comparison src/extents.c @ 404:2f8bb876ab1d r21-2-32
Import from CVS: tag r21-2-32
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:16:07 +0200 |
parents | a86b2b5e0111 |
children | b8cc9ab3f761 |
comparison
equal
deleted
inserted
replaced
403:9f011ab08d48 | 404:2f8bb876ab1d |
---|---|
225 #include "insdel.h" | 225 #include "insdel.h" |
226 #include "keymap.h" | 226 #include "keymap.h" |
227 #include "opaque.h" | 227 #include "opaque.h" |
228 #include "process.h" | 228 #include "process.h" |
229 #include "redisplay.h" | 229 #include "redisplay.h" |
230 #include "gutter.h" | |
230 | 231 |
231 /* ------------------------------- */ | 232 /* ------------------------------- */ |
232 /* gap array */ | 233 /* gap array */ |
233 /* ------------------------------- */ | 234 /* ------------------------------- */ |
234 | 235 |
459 Lisp_Object Vextent_face_reverse_memoize_hash_table; | 460 Lisp_Object Vextent_face_reverse_memoize_hash_table; |
460 Lisp_Object Vextent_face_reusable_list; | 461 Lisp_Object Vextent_face_reusable_list; |
461 /* FSFmacs bogosity */ | 462 /* FSFmacs bogosity */ |
462 Lisp_Object Vdefault_text_properties; | 463 Lisp_Object Vdefault_text_properties; |
463 | 464 |
464 | |
465 EXFUN (Fextent_properties, 1); | 465 EXFUN (Fextent_properties, 1); |
466 EXFUN (Fset_extent_property, 3); | 466 EXFUN (Fset_extent_property, 3); |
467 | 467 |
468 | 468 |
469 /************************************************************************/ | 469 /************************************************************************/ |
1587 | 1587 |
1588 /* now mark the extent itself. */ | 1588 /* now mark the extent itself. */ |
1589 | 1589 |
1590 object = extent_object (extent); | 1590 object = extent_object (extent); |
1591 | 1591 |
1592 if (!BUFFERP (object) || extent_detached_p (extent)) | 1592 if (extent_detached_p (extent)) |
1593 /* #### Can changes to string extents affect redisplay? | |
1594 I will have to think about this. What about string glyphs? | |
1595 Things in the modeline? etc. */ | |
1596 /* #### changes to string extents can certainly affect redisplay | |
1597 if the extent is in some generated-modeline-string: when | |
1598 we change an extent in generated-modeline-string, this changes | |
1599 its parent, which is in `modeline-format', so we should | |
1600 force the modeline to be updated. But how to determine whether | |
1601 a string is a `generated-modeline-string'? Looping through | |
1602 all buffers is not very efficient. Should we add all | |
1603 `generated-modeline-string' strings to a hash table? | |
1604 Maybe efficiency is not the greatest concern here and there's | |
1605 no big loss in looping over the buffers. */ | |
1606 return; | 1593 return; |
1607 | 1594 |
1608 { | 1595 else if (STRINGP (object)) |
1609 struct buffer *b; | 1596 { |
1610 b = XBUFFER (object); | 1597 /* #### Changes to string extents can affect redisplay if they are |
1611 BUF_FACECHANGE (b)++; | 1598 in the modeline or in the gutters. |
1612 MARK_EXTENTS_CHANGED; | 1599 |
1613 if (invisibility_change) | 1600 If the extent is in some generated-modeline-string: when we |
1614 MARK_CLIP_CHANGED; | 1601 change an extent in generated-modeline-string, this changes its |
1615 buffer_extent_signal_changed_region (b, | 1602 parent, which is in `modeline-format', so we should force the |
1616 extent_endpoint_bufpos (extent, 0), | 1603 modeline to be updated. But how to determine whether a string |
1617 extent_endpoint_bufpos (extent, 1)); | 1604 is a `generated-modeline-string'? Looping through all buffers |
1618 } | 1605 is not very efficient. Should we add all |
1606 `generated-modeline-string' strings to a hash table? Maybe | |
1607 efficiency is not the greatest concern here and there's no big | |
1608 loss in looping over the buffers. | |
1609 | |
1610 If the extent is in a gutter we mark the gutter as | |
1611 changed. This means (a) we can update extents in the gutters | |
1612 when we need it. (b) we don't have to update the gutters when | |
1613 only extents attached to buffers have changed. */ | |
1614 | |
1615 MARK_EXTENTS_CHANGED; | |
1616 gutter_extent_signal_changed_region_maybe (object, | |
1617 extent_endpoint_bufpos (extent, 0), | |
1618 extent_endpoint_bufpos (extent, 1)); | |
1619 } | |
1620 else if (BUFFERP (object)) | |
1621 { | |
1622 struct buffer *b; | |
1623 b = XBUFFER (object); | |
1624 BUF_FACECHANGE (b)++; | |
1625 MARK_EXTENTS_CHANGED; | |
1626 if (invisibility_change) | |
1627 MARK_CLIP_CHANGED; | |
1628 buffer_extent_signal_changed_region (b, | |
1629 extent_endpoint_bufpos (extent, 0), | |
1630 extent_endpoint_bufpos (extent, 1)); | |
1631 } | |
1619 } | 1632 } |
1620 | 1633 |
1621 /* A change to an extent occurred that might affect redisplay. | 1634 /* A change to an extent occurred that might affect redisplay. |
1622 This is called when properties such as the endpoints, the layout, | 1635 This is called when properties such as the endpoints, the layout, |
1623 or the priority changes. Redisplay will be affected only if | 1636 or the priority changes. Redisplay will be affected only if |
4987 | 5000 |
4988 static Lisp_Object | 5001 static Lisp_Object |
4989 set_extent_glyph_1 (Lisp_Object extent_obj, Lisp_Object glyph, int endp, | 5002 set_extent_glyph_1 (Lisp_Object extent_obj, Lisp_Object glyph, int endp, |
4990 Lisp_Object layout_obj) | 5003 Lisp_Object layout_obj) |
4991 { | 5004 { |
4992 EXTENT extent = decode_extent (extent_obj, DE_MUST_HAVE_BUFFER); | 5005 EXTENT extent = decode_extent (extent_obj, 0); |
4993 glyph_layout layout = symbol_to_glyph_layout (layout_obj); | 5006 glyph_layout layout = symbol_to_glyph_layout (layout_obj); |
4994 | 5007 |
4995 /* Make sure we've actually been given a valid glyph or it's nil | 5008 /* Make sure we've actually been given a valid glyph or it's nil |
4996 (meaning we're deleting a glyph from an extent). */ | 5009 (meaning we're deleting a glyph from an extent). */ |
4997 if (!NILP (glyph)) | 5010 if (!NILP (glyph)) |