aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1999-09-12 17:28:03 +0000
committerRichard M. Stallman1999-09-12 17:28:03 +0000
commite2dae3f29f795bc0f04f7bf6987480bf43e450dc (patch)
tree4efca1c48aba54c03bf2f1efe2bb129209211ea7 /src
parent8e713be64cb396e4fa30d8a393987b77d6cd99f6 (diff)
downloademacs-e2dae3f29f795bc0f04f7bf6987480bf43e450dc.tar.gz
emacs-e2dae3f29f795bc0f04f7bf6987480bf43e450dc.zip
(Fline_beginning_position): Handle minibuffer prompt here.
Diffstat (limited to 'src')
-rw-r--r--src/editfns.c11
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\
283With argument N not nil or 1, move forward N - 1 lines first.\n\ 283With argument N not nil or 1, move forward N - 1 lines first.\n\
284If scan reaches end of buffer, return that position.\n\ 284If scan reaches end of buffer, return that position.\n\
285This function does not move point.") 285This function does not move point.\n\n\
286In the minibuffer, if point is not within the prompt,\n\
287the 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);