]> code.delx.au - gnu-emacs/blobdiff - src/undo.c
Added a version string.
[gnu-emacs] / src / undo.c
index 2eedfe31ab3b78d1369dec6df7e601858423120c..83c2327a8db56b84242a8a8645f615dae3f8142b 100644 (file)
@@ -1,5 +1,5 @@
 /* undo handling for GNU Emacs.
-   Copyright (C) 1990, 1993, 1994 Free Software Foundation, Inc.
+   Copyright (C) 1990, 1993, 1994, 2000 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -393,8 +393,9 @@ Return what remains of the list.")
 {
   struct gcpro gcpro1, gcpro2;
   Lisp_Object next;
-  int count = specpdl_ptr - specpdl;
+  int count = BINDING_STACK_SIZE ();
   register int arg;
+  
 #if 0  /* This is a good feature, but would make undo-start
          unable to do what is expected.  */
   Lisp_Object tem;
@@ -411,10 +412,14 @@ Return what remains of the list.")
   next = Qnil;
   GCPRO2 (next, list);
 
-  /* Don't let read-only properties interfere with undo.  */
+  /* In a writable buffer, enable undoing read-only text that is so
+     because of text properties.  */
   if (NILP (current_buffer->read_only))
     specbind (Qinhibit_read_only, Qt);
 
+  /* Don't let `intangible' properties interfere with undo.  */
+  specbind (Qinhibit_point_motion_hooks, Qt);
+
   while (arg > 0)
     {
       while (1)
@@ -474,7 +479,6 @@ Return what remains of the list.")
              else if (INTEGERP (car) && INTEGERP (cdr))
                {
                  /* Element (BEG . END) means range was inserted.  */
-                 Lisp_Object end;
 
                  if (XINT (car) < BEGV
                      || XINT (cdr) > ZV)