aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-03-26 21:02:24 +0000
committerRichard M. Stallman1994-03-26 21:02:24 +0000
commitdf28eb7b38be1a96163b3849962c4a6343e6d2f2 (patch)
tree316ae2e6b718a3a4f3767ec1b60bf3acdc9430e0 /src
parent24cffc681071efcbfedc7297a036c9f69e5d8167 (diff)
downloademacs-df28eb7b38be1a96163b3849962c4a6343e6d2f2.tar.gz
emacs-df28eb7b38be1a96163b3849962c4a6343e6d2f2.zip
(verify_interval_modification): For insertion in
middle of an interval, use the same criterion as between intervals for whether read-only forbids it.
Diffstat (limited to 'src')
-rw-r--r--src/intervals.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/src/intervals.c b/src/intervals.c
index 6c7ce7ee898..597fcf07b30 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -1847,8 +1847,7 @@ verify_interval_modification (buf, start, end)
1847 error ("Attempt to insert within read-only text"); 1847 error ("Attempt to insert within read-only text");
1848 } 1848 }
1849 } 1849 }
1850 else 1850
1851 after = Qnil;
1852 if (! NULL_INTERVAL_P (prev)) 1851 if (! NULL_INTERVAL_P (prev))
1853 { 1852 {
1854 before = textget (prev->plist, Qread_only); 1853 before = textget (prev->plist, Qread_only);
@@ -1868,18 +1867,30 @@ verify_interval_modification (buf, start, end)
1868 error ("Attempt to insert within read-only text"); 1867 error ("Attempt to insert within read-only text");
1869 } 1868 }
1870 } 1869 }
1871 else
1872 before = Qnil;
1873 } 1870 }
1874 else if (! NULL_INTERVAL_P (i)) 1871 else if (! NULL_INTERVAL_P (i))
1875 before = after = textget (i->plist, Qread_only);
1876 if (! NULL_INTERVAL_P (i) && ! NULL_INTERVAL_P (prev))
1877 { 1872 {
1878 /* If I and PREV differ, neither of them has a sticky 1873 after = textget (i->plist, Qread_only);
1879 read-only property. It only remains to check, whether 1874
1880 they have a common read-only property. */ 1875 /* If interval I is read-only and read-only is
1881 if (! NILP (before) && EQ (before, after)) 1876 front-sticky, inhibit insertion.
1882 error ("Attempt to insert within read-only text"); 1877 Check for read-only as well as category. */
1878 if (! NILP (after) && NILP (Fmemq (after, Vinhibit_read_only)))
1879 {
1880 Lisp_Object tem;
1881
1882 tem = textget (i->plist, Qfront_sticky);
1883 if (TMEM (Qread_only, tem)
1884 || (NILP (textget_direct (i->plist, Qread_only))
1885 && TMEM (Qcategory, tem)))
1886 error ("Attempt to insert within read-only text");
1887
1888 tem = textget (prev->plist, Qrear_nonsticky);
1889 if (! TMEM (Qread_only, tem)
1890 && (! NILP (textget_direct (prev->plist, Qread_only))
1891 || ! TMEM (Qcategory, tem)))
1892 error ("Attempt to insert within read-only text");
1893 }
1883 } 1894 }
1884 } 1895 }
1885 1896