comparison src/intervals.c @ 5780:07449eefd453

(verify_interval_modification): When checking read-only, allow for the case that stickiness might be t instead of a list.
author Karl Heuer <kwzh@gnu.org>
date Fri, 04 Feb 1994 20:51:16 +0000
parents ab11e2af95ef
children d7ac9a417f87
comparison
equal deleted inserted replaced
5779:8fae1a51e9c5 5780:07449eefd453
1829 1829
1830 /* If interval I is read-only and read-only is 1830 /* If interval I is read-only and read-only is
1831 front-sticky, inhibit insertion. 1831 front-sticky, inhibit insertion.
1832 Check for read-only as well as category. */ 1832 Check for read-only as well as category. */
1833 if (! NILP (after) 1833 if (! NILP (after)
1834 && NILP (Fmemq (after, Vinhibit_read_only)) 1834 && NILP (Fmemq (after, Vinhibit_read_only)))
1835 && (! NILP (Fmemq (Qread_only, 1835 {
1836 textget (i->plist, Qfront_sticky))) 1836 Lisp_Object tem;
1837
1838 tem = textget (i->plist, Qfront_sticky);
1839 if (TMEM (Qread_only, tem)
1837 || (NILP (textget_direct (i->plist, Qread_only)) 1840 || (NILP (textget_direct (i->plist, Qread_only))
1838 && ! NILP (Fmemq (Qcategory, 1841 && TMEM (Qcategory, tem)))
1839 textget (i->plist, 1842 error ("Attempt to insert within read-only text");
1840 Qfront_sticky)))))) 1843 }
1841 error ("Attempt to insert within read-only text");
1842 } 1844 }
1843 else 1845 else
1844 after = Qnil; 1846 after = Qnil;
1845 if (! NULL_INTERVAL_P (prev)) 1847 if (! NULL_INTERVAL_P (prev))
1846 { 1848 {
1848 1850
1849 /* If interval PREV is read-only and read-only isn't 1851 /* If interval PREV is read-only and read-only isn't
1850 rear-nonsticky, inhibit insertion. 1852 rear-nonsticky, inhibit insertion.
1851 Check for read-only as well as category. */ 1853 Check for read-only as well as category. */
1852 if (! NILP (before) 1854 if (! NILP (before)
1853 && NILP (Fmemq (before, Vinhibit_read_only)) 1855 && NILP (Fmemq (before, Vinhibit_read_only)))
1854 && NILP (Fmemq (Qread_only, 1856 {
1855 textget (prev->plist, Qrear_nonsticky))) 1857 Lisp_Object tem;
1856 && (! NILP (textget_direct (prev->plist,Qread_only)) 1858
1857 || NILP (Fmemq (Qcategory, 1859 tem = textget (prev->plist, Qrear_nonsticky);
1858 textget (prev->plist, 1860 if (! TMEM (Qread_only, tem)
1859 Qrear_nonsticky))))) 1861 && (! NILP (textget_direct (prev->plist,Qread_only))
1860 error ("Attempt to insert within read-only text"); 1862 || ! TMEM (Qcategory, tem)))
1863 error ("Attempt to insert within read-only text");
1864 }
1861 } 1865 }
1862 else 1866 else
1863 before = Qnil; 1867 before = Qnil;
1864 } 1868 }
1865 else if (! NULL_INTERVAL_P (i)) 1869 else if (! NULL_INTERVAL_P (i))