changeset 60000:bbd61dfcbd2c

(Fprimitive_undo): Check that undo function does not switch buffer.
author Kim F. Storm <storm@cua.dk>
date Wed, 09 Feb 2005 21:49:12 +0000
parents fc21b849d45c
children 21421676f693
files src/undo.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/undo.c	Wed Feb 09 21:48:36 2005 +0000
+++ b/src/undo.c	Wed Feb 09 21:49:12 2005 +0000
@@ -557,6 +557,8 @@
 	      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 @@
 		    }
 		  else
 		    apply1 (car, cdr);
+
+		  if (save_buffer != current_buffer)
+		    error ("Undo function switched buffer");
 		  did_apply = 1;
 		}
 	      else if (STRINGP (car) && INTEGERP (cdr))