]> code.delx.au - gnu-emacs/commitdiff
(verify_interval_modification): When checking read-only, allow for the case
authorKarl Heuer <kwzh@gnu.org>
Fri, 4 Feb 1994 20:51:16 +0000 (20:51 +0000)
committerKarl Heuer <kwzh@gnu.org>
Fri, 4 Feb 1994 20:51:16 +0000 (20:51 +0000)
that stickiness might be t instead of a list.

src/intervals.c

index 7a843040e239b4899ba5d8ceb074cf9c125e4783..400ef43d0d6fe997335854797fc3245ca06b0089 100644 (file)
@@ -1831,14 +1831,16 @@ verify_interval_modification (buf, start, end)
                     front-sticky, inhibit insertion.
                     Check for read-only as well as category.  */
                  if (! NILP (after)
-                     && NILP (Fmemq (after, Vinhibit_read_only))
-                     && (! NILP (Fmemq (Qread_only,
-                                        textget (i->plist, Qfront_sticky)))
+                     && NILP (Fmemq (after, Vinhibit_read_only)))
+                   {
+                     Lisp_Object tem;
+
+                     tem = textget (i->plist, Qfront_sticky);
+                     if (TMEM (Qread_only, tem)
                          || (NILP (textget_direct (i->plist, Qread_only))
-                             && ! NILP (Fmemq (Qcategory,
-                                               textget (i->plist,
-                                                        Qfront_sticky))))))
-                   error ("Attempt to insert within read-only text");
+                             && TMEM (Qcategory, tem)))
+                       error ("Attempt to insert within read-only text");
+                   }
                }
              else
                after = Qnil;
@@ -1850,14 +1852,16 @@ verify_interval_modification (buf, start, end)
                     rear-nonsticky, inhibit insertion.
                     Check for read-only as well as category.  */
                  if (! NILP (before)
-                     && NILP (Fmemq (before, Vinhibit_read_only))
-                     && NILP (Fmemq (Qread_only,
-                                     textget (prev->plist, Qrear_nonsticky)))
-                     && (! NILP (textget_direct (prev->plist,Qread_only))
-                         || NILP (Fmemq (Qcategory,
-                                         textget (prev->plist,
-                                                  Qrear_nonsticky)))))
-                   error ("Attempt to insert within read-only text");
+                     && NILP (Fmemq (before, Vinhibit_read_only)))
+                   {
+                     Lisp_Object tem;
+
+                     tem = textget (prev->plist, Qrear_nonsticky);
+                     if (! TMEM (Qread_only, tem)
+                         && (! NILP (textget_direct (prev->plist,Qread_only))
+                             || ! TMEM (Qcategory, tem)))
+                       error ("Attempt to insert within read-only text");
+                   }
                }
              else
                before = Qnil;