Mercurial > emacs
comparison src/editfns.c @ 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 | 157f0e91232e |
children | b278da3accef |
comparison
equal
deleted
inserted
replaced
25646:9154af188477 | 25647:947cb0e32a1d |
---|---|
280 DEFUN ("line-beginning-position", Fline_beginning_position, Sline_beginning_position, | 280 DEFUN ("line-beginning-position", Fline_beginning_position, Sline_beginning_position, |
281 0, 1, 0, | 281 0, 1, 0, |
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 { |
289 register int orig, orig_byte, end; | 292 register int orig, orig_byte, end; |
290 | 293 |
295 | 298 |
296 orig = PT; | 299 orig = PT; |
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); |
303 } | 312 } |
304 | 313 |