/* Simple built-in editing commands.
-Copyright (C) 1985, 1993-1998, 2001-2011 Free Software Foundation, Inc.
+Copyright (C) 1985, 1993-1998, 2001-2012 Free Software Foundation, Inc.
This file is part of GNU Emacs.
#include <setjmp.h>
#include "lisp.h"
#include "commands.h"
-#include "buffer.h"
#include "character.h"
+#include "buffer.h"
#include "syntax.h"
#include "window.h"
#include "keyboard.h"
if (remove_boundary
&& CONSP (BVAR (current_buffer, undo_list))
- && NILP (XCAR (BVAR (current_buffer, undo_list))))
+ && NILP (XCAR (BVAR (current_buffer, undo_list)))
+ /* Only remove auto-added boundaries, not boundaries
+ added be explicit calls to undo-boundary. */
+ && EQ (BVAR (current_buffer, undo_list), last_undo_boundary))
/* Remove the undo_boundary that was just pushed. */
- BVAR (current_buffer, undo_list) = XCDR (BVAR (current_buffer, undo_list));
+ BSET (current_buffer, undo_list, XCDR (BVAR (current_buffer, undo_list)));
/* Barf if the key that invoked this was not a character. */
if (!CHARACTERP (last_command_event))
/* If we expanded an abbrev which has a hook,
and the hook has a non-nil `no-self-insert' property,
return right away--don't really self-insert. */
- if (SYMBOLP (sym) && ! NILP (sym) && ! NILP (XSYMBOL (sym)->function)
+ if (SYMBOLP (sym) && ! NILP (sym)
+ && ! NILP (XSYMBOL (sym)->function)
&& SYMBOLP (XSYMBOL (sym)->function))
{
Lisp_Object prop;
}
replace_range (PT, PT + chars_to_delete, string, 1, 1, 1);
- move_point (n + spaces_to_insert, 1);
+ Fforward_char (make_number (n + spaces_to_insert));
}
else if (n > 1)
{