diff options
| author | Richard M. Stallman | 1999-09-12 17:28:03 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1999-09-12 17:28:03 +0000 |
| commit | e2dae3f29f795bc0f04f7bf6987480bf43e450dc (patch) | |
| tree | 4efca1c48aba54c03bf2f1efe2bb129209211ea7 /src | |
| parent | 8e713be64cb396e4fa30d8a393987b77d6cd99f6 (diff) | |
| download | emacs-e2dae3f29f795bc0f04f7bf6987480bf43e450dc.tar.gz emacs-e2dae3f29f795bc0f04f7bf6987480bf43e450dc.zip | |
(Fline_beginning_position): Handle minibuffer prompt here.
Diffstat (limited to 'src')
| -rw-r--r-- | src/editfns.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/editfns.c b/src/editfns.c index e883f103db0..8194e06b762 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -282,7 +282,10 @@ DEFUN ("line-beginning-position", Fline_beginning_position, Sline_beginning_posi | |||
| 282 | "Return the character position of the first character on the current line.\n\ | 282 | "Return the character position of the first character on the current line.\n\ |
| 283 | With argument N not nil or 1, move forward N - 1 lines first.\n\ | 283 | With argument N not nil or 1, move forward N - 1 lines first.\n\ |
| 284 | If scan reaches end of buffer, return that position.\n\ | 284 | If scan reaches end of buffer, return that position.\n\ |
| 285 | This function does not move point.") | 285 | This function does not move point.\n\n\ |
| 286 | In the minibuffer, if point is not within the prompt,\n\ | ||
| 287 | the return value is never within the prompt either.") | ||
| 288 | |||
| 286 | (n) | 289 | (n) |
| 287 | Lisp_Object n; | 290 | Lisp_Object n; |
| 288 | { | 291 | { |
| @@ -297,6 +300,12 @@ This function does not move point.") | |||
| 297 | orig_byte = PT_BYTE; | 300 | orig_byte = PT_BYTE; |
| 298 | Fforward_line (make_number (XINT (n) - 1)); | 301 | Fforward_line (make_number (XINT (n) - 1)); |
| 299 | end = PT; | 302 | end = PT; |
| 303 | |||
| 304 | if (INTEGERP (current_buffer->minibuffer_prompt_length) | ||
| 305 | && orig >= XFASTINT (current_buffer->minibuffer_prompt_length) | ||
| 306 | && end < XFASTINT (current_buffer->minibuffer_prompt_length)) | ||
| 307 | end = XFASTINT (current_buffer->minibuffer_prompt_length); | ||
| 308 | |||
| 300 | SET_PT_BOTH (orig, orig_byte); | 309 | SET_PT_BOTH (orig, orig_byte); |
| 301 | 310 | ||
| 302 | return make_number (end); | 311 | return make_number (end); |