help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: move-end-of-line vs just search for newline char?


From: Xah Lee
Subject: Re: move-end-of-line vs just search for newline char?
Date: Tue, 04 May 2010 15:42:03 -0000
User-agent: G2/1.0

On Mar 9, 12:27 pm, Uday S Reddy <uDOTsDOTre...@cs.bham.ac.uk> wrote:
> Xah Lee wrote:
> > There's the move-end-of-line function. The source code and doc seems a
> > bit complicated.
>
> > my question is, what's the difference if i just call
>
> >   (search-forward "\n")
> >   (backward-char 1)


> I think (end-of-line 1) is the preferred way of going to the end of line.
> move-end-of-line is an interactive command and it has to take care
>  of various stuff.

Thanks. good answer.

> Your alternative might not work in a CRLF line-ending format or if
> there is no newline at the end of the buffer.

this shouldn't matter though because in buffer, newline char is always
represented by "\n". End of buffer problem is a good one still, i
think.

 Xah


reply via email to

[Prev in Thread] Current Thread [Next in Thread]