diff options
author | Richard M. Stallman <rms@gnu.org> | 1996-09-26 03:48:10 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1996-09-26 03:48:10 +0000 |
commit | c6478cbac96d1883bdbc063bdb37841cd775e509 (patch) | |
tree | c30d2bc100fefd11961270308330b016793d4b5d /src/textprop.c | |
parent | fbd6d244145e61beed8d536fa0f53127ab13dedc (diff) | |
download | emacs-c6478cbac96d1883bdbc063bdb37841cd775e509.tar.gz |
(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/textprop.c')
-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.") } } - modify_region (XBUFFER (object), XINT (start), XINT (end)); + if (BUFFERP (object)) + modify_region (XBUFFER (object), XINT (start), XINT (end)); /* We are at the beginning of interval I, with LEN chars to scan. */ for (;;) @@ -888,8 +889,9 @@ Return t if any property value actually changed, nil otherwise.") if (interval_has_all_properties (properties, i)) { - signal_after_change (XINT (start), XINT (end) - XINT (start), - XINT (end) - XINT (start)); + if (BUFFERP (object)) + signal_after_change (XINT (start), XINT (end) - XINT (start), + XINT (end) - XINT (start)); return modified ? Qt : Qnil; } @@ -897,8 +899,9 @@ Return t if any property value actually changed, nil otherwise.") if (LENGTH (i) == len) { add_properties (properties, i, object); - signal_after_change (XINT (start), XINT (end) - XINT (start), - XINT (end) - XINT (start)); + if (BUFFERP (object)) + signal_after_change (XINT (start), XINT (end) - XINT (start), + XINT (end) - XINT (start)); return Qt; } @@ -907,8 +910,9 @@ Return t if any property value actually changed, nil otherwise.") i = split_interval_left (unchanged, len); copy_properties (unchanged, i); add_properties (properties, i, object); - signal_after_change (XINT (start), XINT (end) - XINT (start), - XINT (end) - XINT (start)); + if (BUFFERP (object)) + signal_after_change (XINT (start), XINT (end) - XINT (start), + XINT (end) - XINT (start)); return Qt; } @@ -968,10 +972,7 @@ is the string or buffer containing the text.") if (! XSTRING (object)->intervals) return Qt; - modify_region (XBUFFER (object), XINT (start), XINT (end)); XSTRING (object)->intervals = 0; - signal_after_change (XINT (start), XINT (end) - XINT (start), - XINT (end) - XINT (start)); return Qt; } @@ -997,7 +998,8 @@ is the string or buffer containing the text.") s = XINT (start); len = XINT (end) - s; - modify_region (XBUFFER (object), XINT (start), XINT (end)); + if (BUFFERP (object)) + modify_region (XBUFFER (object), XINT (start), XINT (end)); if (i->position != s) { @@ -1009,8 +1011,9 @@ is the string or buffer containing the text.") copy_properties (unchanged, i); i = split_interval_left (i, len); set_properties (properties, i, object); - signal_after_change (XINT (start), XINT (end) - XINT (start), - XINT (end) - XINT (start)); + if (BUFFERP (object)) + signal_after_change (XINT (start), XINT (end) - XINT (start), + XINT (end) - XINT (start)); return Qt; } @@ -1019,8 +1022,9 @@ is the string or buffer containing the text.") if (LENGTH (i) == len) { - signal_after_change (XINT (start), XINT (end) - XINT (start), - XINT (end) - XINT (start)); + if (BUFFERP (object)) + signal_after_change (XINT (start), XINT (end) - XINT (start), + XINT (end) - XINT (start)); return Qt; } @@ -1047,8 +1051,9 @@ is the string or buffer containing the text.") set_properties (properties, i, object); if (!NULL_INTERVAL_P (prev_changed)) merge_interval_left (i); - signal_after_change (XINT (start), XINT (end) - XINT (start), - XINT (end) - XINT (start)); + if (BUFFERP (object)) + signal_after_change (XINT (start), XINT (end) - XINT (start), + XINT (end) - XINT (start)); return Qt; } @@ -1066,8 +1071,9 @@ is the string or buffer containing the text.") i = next_interval (i); } - signal_after_change (XINT (start), XINT (end) - XINT (start), - XINT (end) - XINT (start)); + if (BUFFERP (object)) + signal_after_change (XINT (start), XINT (end) - XINT (start), + XINT (end) - XINT (start)); return Qt; } @@ -1118,7 +1124,8 @@ Return t if any property was actually removed, nil otherwise.") } } - modify_region (XBUFFER (object), XINT (start), XINT (end)); + if (BUFFERP (object)) + modify_region (XBUFFER (object), XINT (start), XINT (end)); /* We are at the beginning of an interval, with len to scan */ for (;;) @@ -1134,8 +1141,9 @@ Return t if any property was actually removed, nil otherwise.") if (LENGTH (i) == len) { remove_properties (properties, i, object); - signal_after_change (XINT (start), XINT (end) - XINT (start), - XINT (end) - XINT (start)); + if (BUFFERP (object)) + signal_after_change (XINT (start), XINT (end) - XINT (start), + XINT (end) - XINT (start)); return Qt; } @@ -1144,8 +1152,9 @@ Return t if any property was actually removed, nil otherwise.") i = split_interval_left (i, len); copy_properties (unchanged, i); remove_properties (properties, i, object); - signal_after_change (XINT (start), XINT (end) - XINT (start), - XINT (end) - XINT (start)); + if (BUFFERP (object)) + signal_after_change (XINT (start), XINT (end) - XINT (start), + XINT (end) - XINT (start)); return Qt; } |