diff options
| author | Tom Tromey | 2018-08-09 17:56:53 -0600 |
|---|---|---|
| committer | Tom Tromey | 2018-08-09 17:56:53 -0600 |
| commit | accb7b7ecc19f85c2750ded1046a464bc73c6a52 (patch) | |
| tree | 1aa94af022d6700a93a8ff2b73f5b210046ac010 /src/textprop.c | |
| parent | f822a2516d88eeb2118fbbc8554f155e86dfd74e (diff) | |
| parent | 53483df0de0085dbc9ef0b15a0f629ab808b0147 (diff) | |
| download | emacs-accb7b7ecc19f85c2750ded1046a464bc73c6a52.tar.gz emacs-accb7b7ecc19f85c2750ded1046a464bc73c6a52.zip | |
Merge remote-tracking branch 'origin/master' into feature/bignum
Diffstat (limited to 'src/textprop.c')
| -rw-r--r-- | src/textprop.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/textprop.c b/src/textprop.c index 4bd4892b730..8e8baf43d9f 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -1350,6 +1350,7 @@ set_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object properties, | |||
| 1350 | { | 1350 | { |
| 1351 | register INTERVAL i; | 1351 | register INTERVAL i; |
| 1352 | Lisp_Object ostart, oend; | 1352 | Lisp_Object ostart, oend; |
| 1353 | bool first_time = true; | ||
| 1353 | 1354 | ||
| 1354 | ostart = start; | 1355 | ostart = start; |
| 1355 | oend = end; | 1356 | oend = end; |
| @@ -1372,6 +1373,7 @@ set_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object properties, | |||
| 1372 | return Qt; | 1373 | return Qt; |
| 1373 | } | 1374 | } |
| 1374 | 1375 | ||
| 1376 | retry: | ||
| 1375 | i = validate_interval_range (object, &start, &end, soft); | 1377 | i = validate_interval_range (object, &start, &end, soft); |
| 1376 | 1378 | ||
| 1377 | if (!i) | 1379 | if (!i) |
| @@ -1391,8 +1393,22 @@ set_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object properties, | |||
| 1391 | return Qnil; | 1393 | return Qnil; |
| 1392 | } | 1394 | } |
| 1393 | 1395 | ||
| 1394 | if (BUFFERP (object) && !NILP (coherent_change_p)) | 1396 | if (BUFFERP (object) && !NILP (coherent_change_p) && first_time) |
| 1395 | modify_text_properties (object, start, end); | 1397 | { |
| 1398 | ptrdiff_t prev_length = LENGTH (i); | ||
| 1399 | ptrdiff_t prev_pos = i->position; | ||
| 1400 | |||
| 1401 | modify_text_properties (object, start, end); | ||
| 1402 | /* If someone called us recursively as a side effect of | ||
| 1403 | modify_text_properties, and changed the intervals behind our | ||
| 1404 | back, we cannot continue with I, because its data changed. | ||
| 1405 | So we restart the interval analysis anew. */ | ||
| 1406 | if (LENGTH (i) != prev_length || i->position != prev_pos) | ||
| 1407 | { | ||
| 1408 | first_time = false; | ||
| 1409 | goto retry; | ||
| 1410 | } | ||
| 1411 | } | ||
| 1396 | 1412 | ||
| 1397 | set_text_properties_1 (start, end, properties, object, i); | 1413 | set_text_properties_1 (start, end, properties, object, i); |
| 1398 | 1414 | ||
| @@ -2269,7 +2285,7 @@ verify_interval_modification (struct buffer *buf, | |||
| 2269 | if (!inhibit_modification_hooks) | 2285 | if (!inhibit_modification_hooks) |
| 2270 | { | 2286 | { |
| 2271 | hooks = Fnreverse (hooks); | 2287 | hooks = Fnreverse (hooks); |
| 2272 | while (! EQ (hooks, Qnil)) | 2288 | while (! NILP (hooks)) |
| 2273 | { | 2289 | { |
| 2274 | call_mod_hooks (Fcar (hooks), make_fixnum (start), | 2290 | call_mod_hooks (Fcar (hooks), make_fixnum (start), |
| 2275 | make_fixnum (end)); | 2291 | make_fixnum (end)); |