179 |
doc: /* Move point to end of current line. |
doc: /* Move point to end of current line. |
180 |
With argument N not nil or 1, move forward N - 1 lines first. |
With argument N not nil or 1, move forward N - 1 lines first. |
181 |
If point reaches the beginning or end of buffer, it stops there. |
If point reaches the beginning or end of buffer, it stops there. |
182 |
|
To ignore intangibility, bind `inhibit-text-motion-hooks' to t. |
183 |
|
|
184 |
This command does not move point across a field boundary unless doing so |
This command does not move point across a field boundary unless doing so |
185 |
would move beyond there to a different line; if N is nil or 1, and |
would move beyond there to a different line; if N is nil or 1, and |
188 |
(n) |
(n) |
189 |
Lisp_Object n; |
Lisp_Object n; |
190 |
{ |
{ |
191 |
|
int newpos; |
192 |
|
|
193 |
if (NILP (n)) |
if (NILP (n)) |
194 |
XSETFASTINT (n, 1); |
XSETFASTINT (n, 1); |
195 |
else |
else |
196 |
CHECK_NUMBER (n); |
CHECK_NUMBER (n); |
197 |
|
|
198 |
SET_PT (XINT (Fline_end_position (n))); |
while (1) |
199 |
|
{ |
200 |
|
newpos = XINT (Fline_end_position (n)); |
201 |
|
SET_PT (newpos); |
202 |
|
|
203 |
|
if (PT > newpos |
204 |
|
&& FETCH_CHAR (PT - 1) == '\n') |
205 |
|
{ |
206 |
|
/* If we skipped over a newline that follows |
207 |
|
an invisible intangible run, |
208 |
|
move back to the last tangible position |
209 |
|
within the line. */ |
210 |
|
|
211 |
|
SET_PT (PT - 1); |
212 |
|
break; |
213 |
|
} |
214 |
|
else if (PT > newpos && PT < ZV |
215 |
|
&& FETCH_CHAR (PT) != '\n') |
216 |
|
/* If we skipped something intangible |
217 |
|
and now we're not really at eol, |
218 |
|
keep going. */ |
219 |
|
n = make_number (1); |
220 |
|
else |
221 |
|
break; |
222 |
|
} |
223 |
|
|
224 |
return Qnil; |
return Qnil; |
225 |
} |
} |