diff options
| author | Joakim Verona | 2011-02-05 11:23:09 +0100 |
|---|---|---|
| committer | Joakim Verona | 2011-02-05 11:23:09 +0100 |
| commit | 4bd51ad5c3445b644dfb017d5b57b10a90aa325f (patch) | |
| tree | 894801e7308ce4ecc34933f959e28f4b9cff9533 /src/textprop.c | |
| parent | 13cfe8df462ab8da9f0028e16cc84dcaceaca3d1 (diff) | |
| parent | 9bcaafce5351d270ac514e23cb69ff1a5fd35229 (diff) | |
| download | emacs-4bd51ad5c3445b644dfb017d5b57b10a90aa325f.tar.gz emacs-4bd51ad5c3445b644dfb017d5b57b10a90aa325f.zip | |
merge from upstream. currently seems to have bitroted and i get segfaults
Diffstat (limited to 'src/textprop.c')
| -rw-r--r-- | src/textprop.c | 71 |
1 files changed, 32 insertions, 39 deletions
diff --git a/src/textprop.c b/src/textprop.c index 88e869b13e9..5db6033670b 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | /* Interface code for dealing with text properties. | 1 | /* Interface code for dealing with text properties. |
| 2 | Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, | 2 | Copyright (C) 1993-1995, 1997, 1999-2011 Free Software Foundation, Inc. |
| 3 | 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. | ||
| 4 | 3 | ||
| 5 | This file is part of GNU Emacs. | 4 | This file is part of GNU Emacs. |
| 6 | 5 | ||
| @@ -68,11 +67,6 @@ Lisp_Object Qfront_sticky, Qrear_nonsticky; | |||
| 68 | traversing plists. */ | 67 | traversing plists. */ |
| 69 | #define PLIST_ELT_P(o1, o2) (CONSP (o1) && ((o2)=XCDR (o1), CONSP (o2))) | 68 | #define PLIST_ELT_P(o1, o2) (CONSP (o1) && ((o2)=XCDR (o1), CONSP (o2))) |
| 70 | 69 | ||
| 71 | Lisp_Object Vinhibit_point_motion_hooks; | ||
| 72 | Lisp_Object Vdefault_text_properties; | ||
| 73 | Lisp_Object Vchar_property_alias_alist; | ||
| 74 | Lisp_Object Vtext_property_default_nonsticky; | ||
| 75 | |||
| 76 | /* verify_interval_modification saves insertion hooks here | 70 | /* verify_interval_modification saves insertion hooks here |
| 77 | to be run later by report_interval_modification. */ | 71 | to be run later by report_interval_modification. */ |
| 78 | Lisp_Object interval_insert_behind_hooks; | 72 | Lisp_Object interval_insert_behind_hooks; |
| @@ -501,8 +495,7 @@ remove_properties (Lisp_Object plist, Lisp_Object list, INTERVAL i, Lisp_Object | |||
| 501 | if this changes the interval. */ | 495 | if this changes the interval. */ |
| 502 | 496 | ||
| 503 | static INLINE int | 497 | static INLINE int |
| 504 | erase_properties (i) | 498 | erase_properties (INTERVAL i) |
| 505 | INTERVAL i; | ||
| 506 | { | 499 | { |
| 507 | if (NILP (i->plist)) | 500 | if (NILP (i->plist)) |
| 508 | return 0; | 501 | return 0; |
| @@ -1604,17 +1597,19 @@ Return t if any property was actually removed, nil otherwise. */) | |||
| 1604 | if (LENGTH (i) >= len) | 1597 | if (LENGTH (i) >= len) |
| 1605 | { | 1598 | { |
| 1606 | if (! interval_has_some_properties_list (properties, i)) | 1599 | if (! interval_has_some_properties_list (properties, i)) |
| 1607 | if (modified) | 1600 | { |
| 1608 | { | 1601 | if (modified) |
| 1609 | if (BUFFERP (object)) | 1602 | { |
| 1610 | signal_after_change (XINT (start), XINT (end) - XINT (start), | 1603 | if (BUFFERP (object)) |
| 1611 | XINT (end) - XINT (start)); | 1604 | signal_after_change (XINT (start), |
| 1612 | return Qt; | 1605 | XINT (end) - XINT (start), |
| 1613 | } | 1606 | XINT (end) - XINT (start)); |
| 1614 | else | 1607 | return Qt; |
| 1615 | return Qnil; | 1608 | } |
| 1616 | 1609 | else | |
| 1617 | if (LENGTH (i) == len) | 1610 | return Qnil; |
| 1611 | } | ||
| 1612 | else if (LENGTH (i) == len) | ||
| 1618 | { | 1613 | { |
| 1619 | if (!modified && BUFFERP (object)) | 1614 | if (!modified && BUFFERP (object)) |
| 1620 | modify_region (XBUFFER (object), XINT (start), XINT (end), 1); | 1615 | modify_region (XBUFFER (object), XINT (start), XINT (end), 1); |
| @@ -1624,20 +1619,20 @@ Return t if any property was actually removed, nil otherwise. */) | |||
| 1624 | XINT (end) - XINT (start)); | 1619 | XINT (end) - XINT (start)); |
| 1625 | return Qt; | 1620 | return Qt; |
| 1626 | } | 1621 | } |
| 1627 | 1622 | else | |
| 1628 | /* i has the properties, and goes past the change limit */ | 1623 | { /* i has the properties, and goes past the change limit. */ |
| 1629 | unchanged = i; | 1624 | unchanged = i; |
| 1630 | i = split_interval_left (i, len); | 1625 | i = split_interval_left (i, len); |
| 1631 | copy_properties (unchanged, i); | 1626 | copy_properties (unchanged, i); |
| 1632 | if (!modified && BUFFERP (object)) | 1627 | if (!modified && BUFFERP (object)) |
| 1633 | modify_region (XBUFFER (object), XINT (start), XINT (end), 1); | 1628 | modify_region (XBUFFER (object), XINT (start), XINT (end), 1); |
| 1634 | remove_properties (Qnil, properties, i, object); | 1629 | remove_properties (Qnil, properties, i, object); |
| 1635 | if (BUFFERP (object)) | 1630 | if (BUFFERP (object)) |
| 1636 | signal_after_change (XINT (start), XINT (end) - XINT (start), | 1631 | signal_after_change (XINT (start), XINT (end) - XINT (start), |
| 1637 | XINT (end) - XINT (start)); | 1632 | XINT (end) - XINT (start)); |
| 1638 | return Qt; | 1633 | return Qt; |
| 1634 | } | ||
| 1639 | } | 1635 | } |
| 1640 | |||
| 1641 | if (interval_has_some_properties_list (properties, i)) | 1636 | if (interval_has_some_properties_list (properties, i)) |
| 1642 | { | 1637 | { |
| 1643 | if (!modified && BUFFERP (object)) | 1638 | if (!modified && BUFFERP (object)) |
| @@ -2233,13 +2228,13 @@ report_interval_modification (Lisp_Object start, Lisp_Object end) | |||
| 2233 | void | 2228 | void |
| 2234 | syms_of_textprop (void) | 2229 | syms_of_textprop (void) |
| 2235 | { | 2230 | { |
| 2236 | DEFVAR_LISP ("default-text-properties", &Vdefault_text_properties, | 2231 | DEFVAR_LISP ("default-text-properties", Vdefault_text_properties, |
| 2237 | doc: /* Property-list used as default values. | 2232 | doc: /* Property-list used as default values. |
| 2238 | The value of a property in this list is seen as the value for every | 2233 | The value of a property in this list is seen as the value for every |
| 2239 | character that does not have its own value for that property. */); | 2234 | character that does not have its own value for that property. */); |
| 2240 | Vdefault_text_properties = Qnil; | 2235 | Vdefault_text_properties = Qnil; |
| 2241 | 2236 | ||
| 2242 | DEFVAR_LISP ("char-property-alias-alist", &Vchar_property_alias_alist, | 2237 | DEFVAR_LISP ("char-property-alias-alist", Vchar_property_alias_alist, |
| 2243 | doc: /* Alist of alternative properties for properties without a value. | 2238 | doc: /* Alist of alternative properties for properties without a value. |
| 2244 | Each element should look like (PROPERTY ALTERNATIVE1 ALTERNATIVE2...). | 2239 | Each element should look like (PROPERTY ALTERNATIVE1 ALTERNATIVE2...). |
| 2245 | If a piece of text has no direct value for a particular property, then | 2240 | If a piece of text has no direct value for a particular property, then |
| @@ -2248,13 +2243,13 @@ the first non-nil value from the associated alternative properties is | |||
| 2248 | returned. */); | 2243 | returned. */); |
| 2249 | Vchar_property_alias_alist = Qnil; | 2244 | Vchar_property_alias_alist = Qnil; |
| 2250 | 2245 | ||
| 2251 | DEFVAR_LISP ("inhibit-point-motion-hooks", &Vinhibit_point_motion_hooks, | 2246 | DEFVAR_LISP ("inhibit-point-motion-hooks", Vinhibit_point_motion_hooks, |
| 2252 | doc: /* If non-nil, don't run `point-left' and `point-entered' text properties. | 2247 | doc: /* If non-nil, don't run `point-left' and `point-entered' text properties. |
| 2253 | This also inhibits the use of the `intangible' text property. */); | 2248 | This also inhibits the use of the `intangible' text property. */); |
| 2254 | Vinhibit_point_motion_hooks = Qnil; | 2249 | Vinhibit_point_motion_hooks = Qnil; |
| 2255 | 2250 | ||
| 2256 | DEFVAR_LISP ("text-property-default-nonsticky", | 2251 | DEFVAR_LISP ("text-property-default-nonsticky", |
| 2257 | &Vtext_property_default_nonsticky, | 2252 | Vtext_property_default_nonsticky, |
| 2258 | doc: /* Alist of properties vs the corresponding non-stickinesses. | 2253 | doc: /* Alist of properties vs the corresponding non-stickinesses. |
| 2259 | Each element has the form (PROPERTY . NONSTICKINESS). | 2254 | Each element has the form (PROPERTY . NONSTICKINESS). |
| 2260 | 2255 | ||
| @@ -2337,5 +2332,3 @@ inherits it if NONSTICKINESS is nil. The `front-sticky' and | |||
| 2337 | /* defsubr (&Scopy_text_properties); */ | 2332 | /* defsubr (&Scopy_text_properties); */ |
| 2338 | } | 2333 | } |
| 2339 | 2334 | ||
| 2340 | /* arch-tag: 454cdde8-5f86-4faa-a078-101e3625d479 | ||
| 2341 | (do not change this comment) */ | ||