From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: move-end-of-line vs just search for newline char? Date: Tue, 9 Mar 2010 13:38:26 -0800 (PST) Organization: http://groups.google.com Message-ID: <4b7703fe-f901-40ca-84e5-dda8b2e7165c@m27g2000prl.googlegroups.com> References: <9be093f9-908c-4759-9c2c-8fad57ad80d2@u19g2000prh.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1273053731 18589 80.91.229.12 (5 May 2010 10:02:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 May 2010 10:02:11 +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:02:10 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 1O9bQV-00054o-3g for geh-help-gnu-emacs@m.gmane.org; Wed, 05 May 2010 12:01:59 +0200 Original-Received: from localhost ([127.0.0.1]:44676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9bQU-00028s-L6 for geh-help-gnu-emacs@m.gmane.org; Wed, 05 May 2010 06:01:58 -0400 Original-Path: usenet.stanford.edu!postnews.google.com!m27g2000prl.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 25 Original-NNTP-Posting-Host: 76.102.12.87 Original-X-Trace: posting.google.com 1268170706 9709 127.0.0.1 (9 Mar 2010 21:38:26 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 9 Mar 2010 21:38:26 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: m27g2000prl.googlegroups.com; posting-host=76.102.12.87; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.89 Safari/532.5, gzip(gfe), gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:177422 comp.emacs:99660 X-Mailman-Approved-At: Tue, 04 May 2010 16:45:48 -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:73339 Archived-At: On Mar 9, 12:27=A0pm, Uday S Reddy 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 > > > =A0 (search-forward "\n") > > =A0 (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