diff options
author | Kim F. Storm <[email protected]> | 2005-02-09 21:49:12 +0000 |
---|---|---|
committer | Kim F. Storm <[email protected]> | 2005-02-09 21:49:12 +0000 |
commit | a7a39468d688c006f26b8fb804ac87fc7f4fde68 (patch) | |
tree | 38a3ad62f0b04f6f15051d557c79babc78e8ed7d | |
parent | 9ca0f64a8ad27d416796ffdf49596d42cfc176ea (diff) |
(Fprimitive_undo): Check that undo function does not switch buffer.
-rw-r--r-- | src/undo.c | 5 |
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)) |