From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Uday S Reddy Newsgroups: gmane.emacs.help Subject: Re: move-end-of-line vs just search for newline char? Date: Tue, 09 Mar 2010 20:27:57 +0000 Organization: Janet Usenet Reading Service. Message-ID: References: <9be093f9-908c-4759-9c2c-8fad57ad80d2@u19g2000prh.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1273053623 18165 80.91.229.12 (5 May 2010 10:00:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 May 2010 10:00:23 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 05 12:00:22 2010 connect(): No such file or directory Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O9bOw-0003f9-9Q for geh-help-gnu-emacs@m.gmane.org; Wed, 05 May 2010 12:00:22 +0200 Original-Received: from localhost ([127.0.0.1]:44090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9bOv-0000ff-JD for geh-help-gnu-emacs@m.gmane.org; Wed, 05 May 2010 06:00:21 -0400 Original-Path: usenet.stanford.edu!newsfeed.esat.net!feeder.news.heanet.ie!feed4.jnfs.ja.net!feed2.jnfs.ja.net!jnfs.ja.net!times.reader.netnews.ja.net!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 16 Original-NNTP-Posting-Host: acws-0068.cs.bham.ac.uk Original-X-Trace: north.jnrs.ja.net 1268166454 7406 147.188.194.56 (9 Mar 2010 20:27:34 GMT) Original-X-Complaints-To: usenet@north.jnrs.ja.net Original-NNTP-Posting-Date: Tue, 9 Mar 2010 20:27:34 +0000 (UTC) User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: <9be093f9-908c-4759-9c2c-8fad57ad80d2@u19g2000prh.googlegroups.com> Original-Xref: usenet.stanford.edu gnu.emacs.help:177421 comp.emacs:99659 X-Mailman-Approved-At: Tue, 04 May 2010 16:45:43 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:73338 Archived-At: 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. Your alternative might not work in a CRLF line-ending format or if there is no newline at the end of the buffer. Cheers, Uday