From: Kim F. Storm Date: Wed, 9 Feb 2005 21:49:12 +0000 (+0000) Subject: (Fprimitive_undo): Check that undo function does not switch buffer. X-Git-Tag: ttn-vms-21-2-B4~2344 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a7a39468d688c006f26b8fb804ac87fc7f4fde68;p=emacs.git (Fprimitive_undo): Check that undo function does not switch buffer. --- 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))