aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm <[email protected]>2005-02-09 21:49:12 +0000
committerKim F. Storm <[email protected]>2005-02-09 21:49:12 +0000
commita7a39468d688c006f26b8fb804ac87fc7f4fde68 (patch)
tree38a3ad62f0b04f6f15051d557c79babc78e8ed7d
parent9ca0f64a8ad27d416796ffdf49596d42cfc176ea (diff)
(Fprimitive_undo): Check that undo function does not switch buffer.
-rw-r--r--src/undo.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/undo.c b/src/undo.c
index 86237e2c59..b4e16bfd0e 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -557,6 +557,8 @@ Return what remains of the list. */)
else if (EQ (car, Qapply))
{
/* Element (apply FUN . ARGS) means call FUN to undo. */
+ struct buffer *save_buffer = current_buffer;
+
car = Fcar (cdr);
cdr = Fcdr (cdr);
if (INTEGERP (car))
@@ -582,6 +584,9 @@ Return what remains of the list. */)
}
else
apply1 (car, cdr);
+
+ if (save_buffer != current_buffer)
+ error ("Undo function switched buffer");
did_apply = 1;
}
else if (STRINGP (car) && INTEGERP (cdr))