From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Chong Yidong" Newsgroups: gmane.emacs.devel Subject: Re: require-hard-newlines to use newline Date: Thu, 3 Mar 2005 17:32:26 -0500 (EST) Message-ID: <1404.220.255.169.59.1109889146.squirrel@www.stupidchicken.com> References: <1483.220.255.172.231.1109730379.squirrel@www.stupidchicken.com> <200503020302.j2232fR21722@raven.dms.auburn.edu> <2750.220.255.172.231.1109734015.squirrel@www.stupidchicken.com> <1415.220.255.169.59.1109818150.squirrel@www.stupidchicken.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1109889441 15049 80.91.229.2 (3 Mar 2005 22:37:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 3 Mar 2005 22:37:21 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 03 23:37:21 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D6ywD-0006gB-46 for ged-emacs-devel@m.gmane.org; Thu, 03 Mar 2005 23:36:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D6zFF-0003pl-SU for ged-emacs-devel@m.gmane.org; Thu, 03 Mar 2005 17:56:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D6zBz-0002eZ-4e for emacs-devel@gnu.org; Thu, 03 Mar 2005 17:53:15 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D6zBr-0002a8-9p for emacs-devel@gnu.org; Thu, 03 Mar 2005 17:53:11 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D6zBq-0002Wd-Lx for emacs-devel@gnu.org; Thu, 03 Mar 2005 17:53:06 -0500 Original-Received: from [64.21.80.18] (helo=shark.dnsvelocity.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1D6ys4-0001Jr-BM; Thu, 03 Mar 2005 17:32:40 -0500 Original-Received: from stupidch by shark.dnsvelocity.com with local (Exim 4.44) id 1D6yrq-0001X3-PJ; Thu, 03 Mar 2005 17:32:26 -0500 Original-Received: from 220.255.169.59 ([220.255.169.59]) (SquirrelMail authenticated user cyd@stupidchicken.com) by www.stupidchicken.com with HTTP; Thu, 3 Mar 2005 17:32:26 -0500 (EST) In-Reply-To: Original-To: rms@gnu.org User-Agent: SquirrelMail/1.4.4 X-Priority: 3 (Normal) Importance: Normal X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - shark.dnsvelocity.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [32675 33085] / [47 12] X-AntiAbuse: Sender Address Domain - stupidchicken.com X-Source: /usr/local/cpanel/3rdparty/bin/php X-Source-Args: /usr/local/cpanel/3rdparty/bin/php /usr/local/cpanel/base/3rdparty/squirrelmail/src/compose.php X-Source-Dir: :/base/3rdparty/squirrelmail/src X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: main.gmane.org gmane.emacs.devel:34153 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34153 > As I understand it, the newline that ends the last line in a paragraph > is normally soft. A hard newline would end the following blank line. > The newline added by require-final-newline would be at the end of the > last line in a paragraph, so it ought to be soft. Both of the newline ends the last line in a paragraph, as well as the newline on the following blank line, are hard. You can verify this for yourself, but I can also illustrate it. First, recall that soft newlines are equivalent to spaces, so fill-paragraph can delete a soft newline or replace it with one or more spaces. Now if you have a paragraph foo foo\n bar bar\n \N foo bar\n ... where \n denotes a soft newline and \N a hard newline, then it is refilled to foo foo\n bar bar\N foo bar\n ... whereas foo foo\n bar bar\N \N foo bar\n can't be further refilled. > It is impossible to distinguish between a soft newline left at the end > of a line by require-final-newline, and a soft newline produced by, > e.g., a call to kill-line, > > I don't see how a call to kill-line can produce a newline. > I don't understand you. kill-line deletes up to and including the newline. Suppose the cursor is at the indicated position: foo-!-bar\n[EOB] Calling kill-lines gives foo-!-\n[EOB] which, since soft newlines can be converted to spaces, is refilled to foo-!-[EOB] The soft newline at the end is gobbled up. That's the problem.