/* 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.
{
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;
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)
else if (INTEGERP (car) && INTEGERP (cdr))
{
/* Element (BEG . END) means range was inserted. */
- Lisp_Object end;
if (XINT (car) < BEGV
|| XINT (cdr) > ZV)