1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-27 16:51:06 -07:00

(Fprimitive_undo): Check that undo function does not switch buffer.

This commit is contained in:
Kim F. Storm 2005-02-09 21:49:12 +00:00
parent 9ca0f64a8a
commit a7a39468d6

View file

@ -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))