changeset 39247:989367eb5ce1

(verify_interval_modification): Fix last change.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 11 Sep 2001 12:45:24 +0000
parents 01728833d541
children 51b411c7b689
files src/textprop.c
diffstat 1 files changed, 18 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/textprop.c	Tue Sep 11 12:32:50 2001 +0000
+++ b/src/textprop.c	Tue Sep 11 12:45:24 2001 +0000
@@ -1902,7 +1902,7 @@
 	interval_insert_in_front_hooks
 	  = textget (i->plist, Qinsert_in_front_hooks);
     }
-  else if (!inhibit_modification_hooks)
+  else
     {
       /* Loop over intervals on or next to START...END,
 	 collecting their hooks.  */
@@ -1913,11 +1913,14 @@
 	  if (! INTERVAL_WRITABLE_P (i))
 	    text_read_only ();
 
-	  mod_hooks = textget (i->plist, Qmodification_hooks);
-	  if (! NILP (mod_hooks) && ! EQ (mod_hooks, prev_mod_hooks))
+	  if (!inhibit_modification_hooks)
 	    {
-	      hooks = Fcons (mod_hooks, hooks);
-	      prev_mod_hooks = mod_hooks;
+	      mod_hooks = textget (i->plist, Qmodification_hooks);
+	      if (! NILP (mod_hooks) && ! EQ (mod_hooks, prev_mod_hooks))
+		{
+		  hooks = Fcons (mod_hooks, hooks);
+		  prev_mod_hooks = mod_hooks;
+		}
 	    }
 
 	  i = next_interval (i);
@@ -1925,15 +1928,18 @@
       /* Keep going thru the interval containing the char before END.  */
       while (! NULL_INTERVAL_P (i) && i->position < end);
 
-      GCPRO1 (hooks);
-      hooks = Fnreverse (hooks);
-      while (! EQ (hooks, Qnil))
+      if (!inhibit_modification_hooks)
 	{
-	  call_mod_hooks (Fcar (hooks), make_number (start),
-			  make_number (end));
-	  hooks = Fcdr (hooks);
+	  GCPRO1 (hooks);
+	  hooks = Fnreverse (hooks);
+	  while (! EQ (hooks, Qnil))
+	    {
+	      call_mod_hooks (Fcar (hooks), make_number (start),
+			      make_number (end));
+	      hooks = Fcdr (hooks);
+	    }
+	  UNGCPRO;
 	}
-      UNGCPRO;
     }
 }