From a7a39468d688c006f26b8fb804ac87fc7f4fde68 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Wed, 9 Feb 2005 21:49:12 +0000 Subject: [PATCH] (Fprimitive_undo): Check that undo function does not switch buffer. --- src/undo.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/undo.c b/src/undo.c index 86237e2c59a..b4e16bfd0e5 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)) -- 2.39.5