Mercurial > emacs
changeset 25647:947cb0e32a1d
(Fline_beginning_position): Handle minibuffer prompt here.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 12 Sep 1999 17:28:03 +0000 |
parents | 9154af188477 |
children | a48ea135fed4 |
files | src/editfns.c |
diffstat | 1 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/editfns.c Sun Sep 12 07:05:34 1999 +0000 +++ b/src/editfns.c Sun Sep 12 17:28:03 1999 +0000 @@ -282,7 +282,10 @@ "Return the character position of the first character on the current line.\n\ With argument N not nil or 1, move forward N - 1 lines first.\n\ If scan reaches end of buffer, return that position.\n\ -This function does not move point.") +This function does not move point.\n\n\ +In the minibuffer, if point is not within the prompt,\n\ +the return value is never within the prompt either.") + (n) Lisp_Object n; { @@ -297,6 +300,12 @@ orig_byte = PT_BYTE; Fforward_line (make_number (XINT (n) - 1)); end = PT; + + if (INTEGERP (current_buffer->minibuffer_prompt_length) + && orig >= XFASTINT (current_buffer->minibuffer_prompt_length) + && end < XFASTINT (current_buffer->minibuffer_prompt_length)) + end = XFASTINT (current_buffer->minibuffer_prompt_length); + SET_PT_BOTH (orig, orig_byte); return make_number (end);