(Fprimitive_undo): Give clearer error message when trying to change
authorChong Yidong <cyd@stupidchicken.com>
Fri, 30 Mar 2007 02:04:27 +0000 (02:04 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Fri, 30 Mar 2007 02:04:27 +0000 (02:04 +0000)
text properties outside accessible part of buffer.

src/undo.c

index 0eca97d..7a6ba37 100644 (file)
@@ -548,6 +548,8 @@ Return what remains of the list.  */)
                  beg = Fcar (cdr);
                  end = Fcdr (cdr);
 
+                 if (XINT (beg) < BEGV || XINT (end) > ZV)
+                   error ("Changes to be undone are outside visible portion of buffer");
                  Fput_text_property (beg, end, prop, val, Qnil);
                }
              else if (INTEGERP (car) && INTEGERP (cdr))