aboutsummaryrefslogtreecommitdiffstats
path: root/src/undo.c
diff options
context:
space:
mode:
authorKim F. Storm2005-02-09 21:49:12 +0000
committerKim F. Storm2005-02-09 21:49:12 +0000
commita7a39468d688c006f26b8fb804ac87fc7f4fde68 (patch)
tree38a3ad62f0b04f6f15051d557c79babc78e8ed7d /src/undo.c
parent9ca0f64a8ad27d416796ffdf49596d42cfc176ea (diff)
downloademacs-a7a39468d688c006f26b8fb804ac87fc7f4fde68.tar.gz
emacs-a7a39468d688c006f26b8fb804ac87fc7f4fde68.zip
(Fprimitive_undo): Check that undo function does not switch buffer.
Diffstat (limited to 'src/undo.c')
-rw-r--r--src/undo.c5
1 files changed, 5 insertions, 0 deletions
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. */)
557 else if (EQ (car, Qapply)) 557 else if (EQ (car, Qapply))
558 { 558 {
559 /* Element (apply FUN . ARGS) means call FUN to undo. */ 559 /* Element (apply FUN . ARGS) means call FUN to undo. */
560 struct buffer *save_buffer = current_buffer;
561
560 car = Fcar (cdr); 562 car = Fcar (cdr);
561 cdr = Fcdr (cdr); 563 cdr = Fcdr (cdr);
562 if (INTEGERP (car)) 564 if (INTEGERP (car))
@@ -582,6 +584,9 @@ Return what remains of the list. */)
582 } 584 }
583 else 585 else
584 apply1 (car, cdr); 586 apply1 (car, cdr);
587
588 if (save_buffer != current_buffer)
589 error ("Undo function switched buffer");
585 did_apply = 1; 590 did_apply = 1;
586 } 591 }
587 else if (STRINGP (car) && INTEGERP (cdr)) 592 else if (STRINGP (car) && INTEGERP (cdr))