diff options
| author | Richard M. Stallman | 1996-09-26 03:48:10 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-09-26 03:48:10 +0000 |
| commit | 2a631db1aec14c03cf1a56e5e8f036969d7f9912 (patch) | |
| tree | 33732814074136b2d0d6f6f31a97968bd853c10a /src | |
| parent | 524580a4ac7eff2a803cfce88a657fa67789ec52 (diff) | |
| download | emacs-2a631db1aec14c03cf1a56e5e8f036969d7f9912.tar.gz emacs-2a631db1aec14c03cf1a56e5e8f036969d7f9912.zip | |
(Fset_text_properties, Fadd_text_properties)
(Fremove_text_properties): Call modify_region and signal_after_change
only for buffers, not for strings.
Diffstat (limited to 'src')
| -rw-r--r-- | src/textprop.c | 57 |
1 files changed, 33 insertions, 24 deletions
diff --git a/src/textprop.c b/src/textprop.c index 27698f925e1..0fce55c0ad2 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -871,7 +871,8 @@ Return t if any property value actually changed, nil otherwise.") | |||
| 871 | } | 871 | } |
| 872 | } | 872 | } |
| 873 | 873 | ||
| 874 | modify_region (XBUFFER (object), XINT (start), XINT (end)); | 874 | if (BUFFERP (object)) |
| 875 | modify_region (XBUFFER (object), XINT (start), XINT (end)); | ||
| 875 | 876 | ||
| 876 | /* We are at the beginning of interval I, with LEN chars to scan. */ | 877 | /* We are at the beginning of interval I, with LEN chars to scan. */ |
| 877 | for (;;) | 878 | for (;;) |
| @@ -888,8 +889,9 @@ Return t if any property value actually changed, nil otherwise.") | |||
| 888 | 889 | ||
| 889 | if (interval_has_all_properties (properties, i)) | 890 | if (interval_has_all_properties (properties, i)) |
| 890 | { | 891 | { |
| 891 | signal_after_change (XINT (start), XINT (end) - XINT (start), | 892 | if (BUFFERP (object)) |
| 892 | XINT (end) - XINT (start)); | 893 | signal_after_change (XINT (start), XINT (end) - XINT (start), |
| 894 | XINT (end) - XINT (start)); | ||
| 893 | 895 | ||
| 894 | return modified ? Qt : Qnil; | 896 | return modified ? Qt : Qnil; |
| 895 | } | 897 | } |
| @@ -897,8 +899,9 @@ Return t if any property value actually changed, nil otherwise.") | |||
| 897 | if (LENGTH (i) == len) | 899 | if (LENGTH (i) == len) |
| 898 | { | 900 | { |
| 899 | add_properties (properties, i, object); | 901 | add_properties (properties, i, object); |
| 900 | signal_after_change (XINT (start), XINT (end) - XINT (start), | 902 | if (BUFFERP (object)) |
| 901 | XINT (end) - XINT (start)); | 903 | signal_after_change (XINT (start), XINT (end) - XINT (start), |
| 904 | XINT (end) - XINT (start)); | ||
| 902 | return Qt; | 905 | return Qt; |
| 903 | } | 906 | } |
| 904 | 907 | ||
| @@ -907,8 +910,9 @@ Return t if any property value actually changed, nil otherwise.") | |||
| 907 | i = split_interval_left (unchanged, len); | 910 | i = split_interval_left (unchanged, len); |
| 908 | copy_properties (unchanged, i); | 911 | copy_properties (unchanged, i); |
| 909 | add_properties (properties, i, object); | 912 | add_properties (properties, i, object); |
| 910 | signal_after_change (XINT (start), XINT (end) - XINT (start), | 913 | if (BUFFERP (object)) |
| 911 | XINT (end) - XINT (start)); | 914 | signal_after_change (XINT (start), XINT (end) - XINT (start), |
| 915 | XINT (end) - XINT (start)); | ||
| 912 | return Qt; | 916 | return Qt; |
| 913 | } | 917 | } |
| 914 | 918 | ||
| @@ -968,10 +972,7 @@ is the string or buffer containing the text.") | |||
| 968 | if (! XSTRING (object)->intervals) | 972 | if (! XSTRING (object)->intervals) |
| 969 | return Qt; | 973 | return Qt; |
| 970 | 974 | ||
| 971 | modify_region (XBUFFER (object), XINT (start), XINT (end)); | ||
| 972 | XSTRING (object)->intervals = 0; | 975 | XSTRING (object)->intervals = 0; |
| 973 | signal_after_change (XINT (start), XINT (end) - XINT (start), | ||
| 974 | XINT (end) - XINT (start)); | ||
| 975 | return Qt; | 976 | return Qt; |
| 976 | } | 977 | } |
| 977 | 978 | ||
| @@ -997,7 +998,8 @@ is the string or buffer containing the text.") | |||
| 997 | s = XINT (start); | 998 | s = XINT (start); |
| 998 | len = XINT (end) - s; | 999 | len = XINT (end) - s; |
| 999 | 1000 | ||
| 1000 | modify_region (XBUFFER (object), XINT (start), XINT (end)); | 1001 | if (BUFFERP (object)) |
| 1002 | modify_region (XBUFFER (object), XINT (start), XINT (end)); | ||
| 1001 | 1003 | ||
| 1002 | if (i->position != s) | 1004 | if (i->position != s) |
| 1003 | { | 1005 | { |
| @@ -1009,8 +1011,9 @@ is the string or buffer containing the text.") | |||
| 1009 | copy_properties (unchanged, i); | 1011 | copy_properties (unchanged, i); |
| 1010 | i = split_interval_left (i, len); | 1012 | i = split_interval_left (i, len); |
| 1011 | set_properties (properties, i, object); | 1013 | set_properties (properties, i, object); |
| 1012 | signal_after_change (XINT (start), XINT (end) - XINT (start), | 1014 | if (BUFFERP (object)) |
| 1013 | XINT (end) - XINT (start)); | 1015 | signal_after_change (XINT (start), XINT (end) - XINT (start), |
| 1016 | XINT (end) - XINT (start)); | ||
| 1014 | 1017 | ||
| 1015 | return Qt; | 1018 | return Qt; |
| 1016 | } | 1019 | } |
| @@ -1019,8 +1022,9 @@ is the string or buffer containing the text.") | |||
| 1019 | 1022 | ||
| 1020 | if (LENGTH (i) == len) | 1023 | if (LENGTH (i) == len) |
| 1021 | { | 1024 | { |
| 1022 | signal_after_change (XINT (start), XINT (end) - XINT (start), | 1025 | if (BUFFERP (object)) |
| 1023 | XINT (end) - XINT (start)); | 1026 | signal_after_change (XINT (start), XINT (end) - XINT (start), |
| 1027 | XINT (end) - XINT (start)); | ||
| 1024 | 1028 | ||
| 1025 | return Qt; | 1029 | return Qt; |
| 1026 | } | 1030 | } |
| @@ -1047,8 +1051,9 @@ is the string or buffer containing the text.") | |||
| 1047 | set_properties (properties, i, object); | 1051 | set_properties (properties, i, object); |
| 1048 | if (!NULL_INTERVAL_P (prev_changed)) | 1052 | if (!NULL_INTERVAL_P (prev_changed)) |
| 1049 | merge_interval_left (i); | 1053 | merge_interval_left (i); |
| 1050 | signal_after_change (XINT (start), XINT (end) - XINT (start), | 1054 | if (BUFFERP (object)) |
| 1051 | XINT (end) - XINT (start)); | 1055 | signal_after_change (XINT (start), XINT (end) - XINT (start), |
| 1056 | XINT (end) - XINT (start)); | ||
| 1052 | return Qt; | 1057 | return Qt; |
| 1053 | } | 1058 | } |
| 1054 | 1059 | ||
| @@ -1066,8 +1071,9 @@ is the string or buffer containing the text.") | |||
| 1066 | i = next_interval (i); | 1071 | i = next_interval (i); |
| 1067 | } | 1072 | } |
| 1068 | 1073 | ||
| 1069 | signal_after_change (XINT (start), XINT (end) - XINT (start), | 1074 | if (BUFFERP (object)) |
| 1070 | XINT (end) - XINT (start)); | 1075 | signal_after_change (XINT (start), XINT (end) - XINT (start), |
| 1076 | XINT (end) - XINT (start)); | ||
| 1071 | return Qt; | 1077 | return Qt; |
| 1072 | } | 1078 | } |
| 1073 | 1079 | ||
| @@ -1118,7 +1124,8 @@ Return t if any property was actually removed, nil otherwise.") | |||
| 1118 | } | 1124 | } |
| 1119 | } | 1125 | } |
| 1120 | 1126 | ||
| 1121 | modify_region (XBUFFER (object), XINT (start), XINT (end)); | 1127 | if (BUFFERP (object)) |
| 1128 | modify_region (XBUFFER (object), XINT (start), XINT (end)); | ||
| 1122 | 1129 | ||
| 1123 | /* We are at the beginning of an interval, with len to scan */ | 1130 | /* We are at the beginning of an interval, with len to scan */ |
| 1124 | for (;;) | 1131 | for (;;) |
| @@ -1134,8 +1141,9 @@ Return t if any property was actually removed, nil otherwise.") | |||
| 1134 | if (LENGTH (i) == len) | 1141 | if (LENGTH (i) == len) |
| 1135 | { | 1142 | { |
| 1136 | remove_properties (properties, i, object); | 1143 | remove_properties (properties, i, object); |
| 1137 | signal_after_change (XINT (start), XINT (end) - XINT (start), | 1144 | if (BUFFERP (object)) |
| 1138 | XINT (end) - XINT (start)); | 1145 | signal_after_change (XINT (start), XINT (end) - XINT (start), |
| 1146 | XINT (end) - XINT (start)); | ||
| 1139 | return Qt; | 1147 | return Qt; |
| 1140 | } | 1148 | } |
| 1141 | 1149 | ||
| @@ -1144,8 +1152,9 @@ Return t if any property was actually removed, nil otherwise.") | |||
| 1144 | i = split_interval_left (i, len); | 1152 | i = split_interval_left (i, len); |
| 1145 | copy_properties (unchanged, i); | 1153 | copy_properties (unchanged, i); |
| 1146 | remove_properties (properties, i, object); | 1154 | remove_properties (properties, i, object); |
| 1147 | signal_after_change (XINT (start), XINT (end) - XINT (start), | 1155 | if (BUFFERP (object)) |
| 1148 | XINT (end) - XINT (start)); | 1156 | signal_after_change (XINT (start), XINT (end) - XINT (start), |
| 1157 | XINT (end) - XINT (start)); | ||
| 1149 | return Qt; | 1158 | return Qt; |
| 1150 | } | 1159 | } |
| 1151 | 1160 | ||