}
DEFUN ("forward-char", Fforward_char, Sforward_char, 0, 1, "^p",
- doc: /* Move point right N characters (left if N is negative).
-On reaching end of buffer, stop and signal error. */)
+ doc: /* Move point N characters forward (backward if N is negative).
+On reaching end or beginning of buffer, stop and signal error.
+
+Depending on the bidirectional context, the movement may be to the
+right or to the left on the screen. This is in contrast with
+\\[right-char], which see. */)
(n)
Lisp_Object n;
{
}
DEFUN ("backward-char", Fbackward_char, Sbackward_char, 0, 1, "^p",
- doc: /* Move point left N characters (right if N is negative).
-On attempt to pass beginning or end of buffer, stop and signal error. */)
+ doc: /* Move point N characters backward (forward if N is negative).
+On attempt to pass beginning or end of buffer, stop and signal error.
+
+Depending on the bidirectional context, the movement may be to the
+right or to the left on the screen. This is in contrast with
+\\[left-char], which see. */)
(n)
Lisp_Object n;
{
Returns the count of lines left to move. If moving forward,
that is N - number of lines moved; if backward, N + number moved.
With positive N, a non-empty line at the end counts as one line
- successfully moved (for the return value). */)
+successfully moved (for the return value). */)
(n)
Lisp_Object n;
{
If point reaches the beginning or end of buffer, it stops there.
This function constrains point to the current field unless this moves
-point to a different line than the original, unconstrained result. If
-N is nil or 1, and a front-sticky field starts at point, the point
+point to a different line than the original, unconstrained result.
+If N is nil or 1, and a front-sticky field starts at point, the point
does not move. To ignore field boundaries bind
`inhibit-field-text-motion' to t, or use the `forward-line' function
instead. For instance, `(forward-line 0)' does the same thing as
doc: /* Delete the following N characters (previous if N is negative).
Optional second arg KILLFLAG non-nil means kill instead (save in kill ring).
Interactively, N is the prefix arg, and KILLFLAG is set if
-N was explicitly specified. */)
+N was explicitly specified.
+
+The command `delete-forward' is preferable for interactive use. */)
(n, killflag)
Lisp_Object n, killflag;
{
return Qnil;
}
-DEFUN ("delete-backward-char", Fdelete_backward_char, Sdelete_backward_char,
- 1, 2, "p\nP",
- doc: /* Delete the previous N characters (following if N is negative).
-Optional second arg KILLFLAG non-nil means kill instead (save in kill ring).
-Interactively, N is the prefix arg, and KILLFLAG is set if
-N was explicitly specified. */)
- (n, killflag)
- Lisp_Object n, killflag;
-{
- Lisp_Object value;
- int deleted_special = 0;
- int pos, pos_byte, i;
-
- CHECK_NUMBER (n);
-
- /* See if we are about to delete a tab or newline backwards. */
- pos = PT;
- pos_byte = PT_BYTE;
- for (i = 0; i < XINT (n) && pos_byte > BEGV_BYTE; i++)
- {
- int c;
-
- DEC_BOTH (pos, pos_byte);
- c = FETCH_BYTE (pos_byte);
- if (c == '\t' || c == '\n')
- {
- deleted_special = 1;
- break;
- }
- }
-
- /* In overwrite mode, back over columns while clearing them out,
- unless at end of line. */
- if (XINT (n) > 0
- && ! NILP (current_buffer->overwrite_mode)
- && ! deleted_special
- && ! (PT == ZV || FETCH_BYTE (PT_BYTE) == '\n'))
- {
- int column = (int) current_column (); /* iftc */
-
- value = Fdelete_char (make_number (-XINT (n)), killflag);
- i = column - (int) current_column (); /* iftc */
- Finsert_char (make_number (' '), make_number (i), Qnil);
- /* Whitespace chars are ASCII chars, so we can simply subtract. */
- SET_PT_BOTH (PT - i, PT_BYTE - i);
- }
- else
- value = Fdelete_char (make_number (-XINT (n)), killflag);
-
- return value;
-}
-
static int nonundocount;
/* Note that there's code in command_loop_1 which typically avoids
defsubr (&Send_of_line);
defsubr (&Sdelete_char);
- defsubr (&Sdelete_backward_char);
-
defsubr (&Sself_insert_command);
}
initial_define_key (global_map, Ctl ('A'), "beginning-of-line");
initial_define_key (global_map, Ctl ('B'), "backward-char");
- initial_define_key (global_map, Ctl ('D'), "delete-char");
initial_define_key (global_map, Ctl ('E'), "end-of-line");
initial_define_key (global_map, Ctl ('F'), "forward-char");
- initial_define_key (global_map, 0177, "delete-backward-char");
}
/* arch-tag: 022ba3cd-67f9-4978-9c5d-7d2b18d8644e