/* Simple built-in editing commands.
- Copyright (C) 1985, 1992 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1993 Free Software Foundation, Inc.
This file is part of GNU Emacs.
else
CHECK_NUMBER (n, 0);
- SET_PT (point + XINT (n));
- if (point < BEGV)
- {
- SET_PT (BEGV);
- Fsignal (Qbeginning_of_buffer, Qnil);
- }
- if (point > ZV)
- {
- SET_PT (ZV);
- Fsignal (Qend_of_buffer, Qnil);
- }
+ /* This used to just set point to point + XINT (n), and then check
+ to see if it was within boundaries. But now that SET_PT can
+ potentially do a lot of stuff (calling entering and exiting
+ hooks, etcetera), that's not a good approach. So we validate the
+ proposed position, then set point. */
+ {
+ int new_point = point + XINT (n);
+
+ if (new_point < BEGV)
+ {
+ SET_PT (BEGV);
+ Fsignal (Qbeginning_of_buffer, Qnil);
+ }
+ if (new_point > ZV)
+ {
+ SET_PT (ZV);
+ Fsignal (Qend_of_buffer, Qnil);
+ }
+
+ SET_PT (new_point);
+ }
+
return Qnil;
}
arg = Fprefix_numeric_value (arg1);
if (!NILP (current_buffer->read_only))
- Fsignal (Qbuffer_read_only, Qnil);
+ Fbarf_if_buffer_read_only ();
/* Inserting a newline at the end of a line produces better
- redisplay in try_window_id than inserting at the ebginning fo a
+ redisplay in try_window_id than inserting at the beginning of a
line, and the textual result is the same. So, if we're at
beginning of line, pretend to be at the end of the previous line.
initial_define_key (global_map, Ctl('I'), "self-insert-command");
for (n = 040; n < 0177; n++)
initial_define_key (global_map, n, "self-insert-command");
+ for (n = 0240; n < 0377; n++)
+ initial_define_key (global_map, n, "self-insert-command");
initial_define_key (global_map, Ctl ('A'), "beginning-of-line");
initial_define_key (global_map, Ctl ('B'), "backward-char");