X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/4f13cc9959c1a786da94bbb1fef1a633619e3066..ecfb39ee8e14337d40328c8248c6d27793798025:/src/cmds.c diff --git a/src/cmds.c b/src/cmds.c index 64e7eaca4f..a9d4890c52 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -117,7 +117,6 @@ With positive N, a non-empty line at the end counts as one line\n\ int opoint = PT, opoint_byte = PT_BYTE; int pos, pos_byte; int count, shortage; - int temp; if (NILP (n)) count = 1; @@ -154,7 +153,10 @@ DEFUN ("beginning-of-line", Fbeginning_of_line, Sbeginning_of_line, 0, 1, "p", "Move point to beginning of current line.\n\ With argument N not nil or 1, move forward N - 1 lines first.\n\ -If scan reaches end of buffer, stop there without error.") +If point reaches the beginning or end of buffer, it stops there.\n\ +This command does not move point across a field boundary\n\ +unless it would move beyond there to a different line.\n\ +If N is nil or 1, and point starts at a field boundary, point does not move.") (n) Lisp_Object n; { @@ -163,13 +165,7 @@ If scan reaches end of buffer, stop there without error.") else CHECK_NUMBER (n, 0); - { - int pos = XFASTINT (Fline_beginning_position (n)); - if (INTEGERP (current_buffer->minibuffer_prompt_length) - && pos < XFASTINT (current_buffer->minibuffer_prompt_length)) - pos = XFASTINT (current_buffer->minibuffer_prompt_length); - SET_PT (pos); - } + SET_PT (XINT (Fline_beginning_position (n))); return Qnil; } @@ -178,13 +174,13 @@ DEFUN ("end-of-line", Fend_of_line, Send_of_line, 0, 1, "p", "Move point to end of current line.\n\ With argument N not nil or 1, move forward N - 1 lines first.\n\ -If scan reaches end of buffer, stop there without error.") +If point reaches the beginning or end of buffer, it stops there.\n\ +This command does not move point across a field boundary\n\ +unless it would move beyond there to a different line.\n\ +If N is nil or 1, and point starts at a field boundary, point does not move.") (n) Lisp_Object n; { - register int pos; - register int stop; - if (NILP (n)) XSETFASTINT (n, 1); else @@ -347,20 +343,19 @@ internal_self_insert (c, noautofill) /* Length of multi-byte form of C. */ int len; /* Working buffer and pointer for multi-byte form of C. */ - unsigned char workbuf[4], *str; + unsigned char str[MAX_MULTIBYTE_LENGTH]; int chars_to_delete = 0; int spaces_to_insert = 0; overwrite = current_buffer->overwrite_mode; - if (!NILP (Vbefore_change_function) || !NILP (Vafter_change_function) - || !NILP (Vbefore_change_functions) || !NILP (Vafter_change_functions)) + if (!NILP (Vbefore_change_functions) || !NILP (Vafter_change_functions)) hairy = 1; /* At first, get multi-byte form of C in STR. */ if (!NILP (current_buffer->enable_multibyte_characters)) { c = unibyte_char_to_multibyte (c); - len = CHAR_STRING (c, workbuf, str); + len = CHAR_STRING (c, str); if (len == 1) /* If C has modifier bits, this makes C an appropriate one-byte char. */ @@ -368,10 +363,9 @@ internal_self_insert (c, noautofill) } else { - workbuf[0] = (SINGLE_BYTE_CHAR_P (c) - ? c - : multibyte_char_to_unibyte (c, Qnil)); - str = workbuf; + str[0] = (SINGLE_BYTE_CHAR_P (c) + ? c + : multibyte_char_to_unibyte (c, Qnil)); len = 1; } if (!NILP (overwrite) @@ -447,7 +441,7 @@ internal_self_insert (c, noautofill) sym = Fexpand_abbrev (); - /* If we expanded an abbrev which has only a hook, + /* 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 (! NILP (sym) && ! NILP (XSYMBOL (sym)->function)