Mercurial > emacs
comparison src/intervals.c @ 3847:a58e981e2582
(verify_interval_modification): Don't just test
Qread_only prop; use INTERVAL_WRITABLE_P.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 20 Jun 1993 08:48:58 +0000 |
parents | dea4ce3d7a4d |
children | cdab67a10461 |
comparison
equal
deleted
inserted
replaced
3846:8808695cc15b | 3847:a58e981e2582 |
---|---|
1477 if (start == BUF_ZV (buf)) | 1477 if (start == BUF_ZV (buf)) |
1478 i = 0; | 1478 i = 0; |
1479 | 1479 |
1480 if (NULL_INTERVAL_P (prev)) | 1480 if (NULL_INTERVAL_P (prev)) |
1481 { | 1481 { |
1482 after = textget (i->plist, Qread_only); | 1482 if (! INTERVAL_WRITABLE_P (i)) |
1483 if (! NILP (after)) | |
1484 error ("Attempt to insert within read-only text"); | 1483 error ("Attempt to insert within read-only text"); |
1485 } | 1484 } |
1486 else if (NULL_INTERVAL_P (i)) | 1485 else if (NULL_INTERVAL_P (i)) |
1487 { | 1486 { |
1488 before = textget (prev->plist, Qread_only); | 1487 if (! INTERVAL_WRITABLE_P (prev)) |
1489 if (! NILP (before)) | |
1490 error ("Attempt to insert within read-only text"); | 1488 error ("Attempt to insert within read-only text"); |
1491 } | 1489 } |
1492 else | 1490 else |
1493 { | 1491 { |
1494 before = textget (prev->plist, Qread_only); | 1492 before = textget (prev->plist, Qread_only); |
1495 after = textget (i->plist, Qread_only); | 1493 after = textget (i->plist, Qread_only); |
1496 if (! NILP (before) && EQ (before, after)) | 1494 if (! NILP (before) && EQ (before, after) |
1495 /* This checks Vinhibit_read_only properly | |
1496 for the common value of the read-only property. */ | |
1497 && ! INTERVAL_WRITABLE_P (i)) | |
1497 error ("Attempt to insert within read-only text"); | 1498 error ("Attempt to insert within read-only text"); |
1498 } | 1499 } |
1499 | 1500 |
1500 /* Run both mod hooks (just once if they're the same). */ | 1501 /* Run both mod hooks (just once if they're the same). */ |
1501 if (!NULL_INTERVAL_P (prev)) | 1502 if (!NULL_INTERVAL_P (prev)) |