aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann1999-11-26 12:07:31 +0000
committerGerd Moellmann1999-11-26 12:07:31 +0000
commit0087ade67a7c8e31b32579a353381fb00b53a112 (patch)
tree7fad26a2fd45a778e08ff12ba6dfddd2e8503902 /src
parentf2cab2ea4abd6d4dddb57ed51a9dffa56b3ca633 (diff)
downloademacs-0087ade67a7c8e31b32579a353381fb00b53a112.tar.gz
emacs-0087ade67a7c8e31b32579a353381fb00b53a112.zip
(set_text_properties): New function. Like
Fset_text_properties, but with additional parameter SIGNAL_AFTER_CHANGE_P. If that is nil, don't signal after changes. (Fset_text_properties): Use it.
Diffstat (limited to 'src')
-rw-r--r--src/textprop.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/textprop.c b/src/textprop.c
index e7091b144dc..8b405a2bb44 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -1087,6 +1087,21 @@ is the string or buffer containing the text.")
1087 (start, end, properties, object) 1087 (start, end, properties, object)
1088 Lisp_Object start, end, properties, object; 1088 Lisp_Object start, end, properties, object;
1089{ 1089{
1090 return set_text_properties (start, end, properties, object, Qt);
1091}
1092
1093
1094/* Replace properties of text from START to END with new list of
1095 properties PROPERTIES. OBJECT is the buffer or string containing
1096 the text. OBJECT nil means use the current buffer.
1097 SIGNAL_AFTER_CHANGE_P nil means don't signal after changes. Value
1098 is non-nil if properties were replaced; it is nil if there weren't
1099 any properties to replace. */
1100
1101Lisp_Object
1102set_text_properties (start, end, properties, object, signal_after_change_p)
1103 Lisp_Object start, end, properties, object, signal_after_change_p;
1104{
1090 register INTERVAL i, unchanged; 1105 register INTERVAL i, unchanged;
1091 register INTERVAL prev_changed = NULL_INTERVAL; 1106 register INTERVAL prev_changed = NULL_INTERVAL;
1092 register int s, len; 1107 register int s, len;
@@ -1148,7 +1163,7 @@ is the string or buffer containing the text.")
1148 copy_properties (unchanged, i); 1163 copy_properties (unchanged, i);
1149 i = split_interval_left (i, len); 1164 i = split_interval_left (i, len);
1150 set_properties (properties, i, object); 1165 set_properties (properties, i, object);
1151 if (BUFFERP (object)) 1166 if (BUFFERP (object) && !NILP (signal_after_change_p))
1152 signal_after_change (XINT (start), XINT (end) - XINT (start), 1167 signal_after_change (XINT (start), XINT (end) - XINT (start),
1153 XINT (end) - XINT (start)); 1168 XINT (end) - XINT (start));
1154 1169
@@ -1159,7 +1174,7 @@ is the string or buffer containing the text.")
1159 1174
1160 if (LENGTH (i) == len) 1175 if (LENGTH (i) == len)
1161 { 1176 {
1162 if (BUFFERP (object)) 1177 if (BUFFERP (object) && !NILP (signal_after_change_p))
1163 signal_after_change (XINT (start), XINT (end) - XINT (start), 1178 signal_after_change (XINT (start), XINT (end) - XINT (start),
1164 XINT (end) - XINT (start)); 1179 XINT (end) - XINT (start));
1165 1180
@@ -1188,7 +1203,7 @@ is the string or buffer containing the text.")
1188 set_properties (properties, i, object); 1203 set_properties (properties, i, object);
1189 if (!NULL_INTERVAL_P (prev_changed)) 1204 if (!NULL_INTERVAL_P (prev_changed))
1190 merge_interval_left (i); 1205 merge_interval_left (i);
1191 if (BUFFERP (object)) 1206 if (BUFFERP (object) && !NILP (signal_after_change_p))
1192 signal_after_change (XINT (start), XINT (end) - XINT (start), 1207 signal_after_change (XINT (start), XINT (end) - XINT (start),
1193 XINT (end) - XINT (start)); 1208 XINT (end) - XINT (start));
1194 return Qt; 1209 return Qt;
@@ -1208,7 +1223,7 @@ is the string or buffer containing the text.")
1208 i = next_interval (i); 1223 i = next_interval (i);
1209 } 1224 }
1210 1225
1211 if (BUFFERP (object)) 1226 if (BUFFERP (object) && !NILP (signal_after_change_p))
1212 signal_after_change (XINT (start), XINT (end) - XINT (start), 1227 signal_after_change (XINT (start), XINT (end) - XINT (start),
1213 XINT (end) - XINT (start)); 1228 XINT (end) - XINT (start));
1214 return Qt; 1229 return Qt;