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: Wed, 2 Mar 2005 21:49:10 -0500 (EST) Message-ID: <1415.220.255.169.59.1109818150.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> 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 1109818474 6694 80.91.229.2 (3 Mar 2005 02:54:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 3 Mar 2005 02:54:34 +0000 (UTC) Cc: teirllm@dms.auburn.edu, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 03 03:54:34 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D6gTM-0008SH-W2 for ged-emacs-devel@m.gmane.org; Thu, 03 Mar 2005 03:53:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D6gmF-0006Ql-Cc for ged-emacs-devel@m.gmane.org; Wed, 02 Mar 2005 22:13:27 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D6gkN-0005Tg-9t for emacs-devel@gnu.org; Wed, 02 Mar 2005 22:11:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D6gkK-0005R3-Cm for emacs-devel@gnu.org; Wed, 02 Mar 2005 22:11:30 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D6gkJ-0005PB-HY for emacs-devel@gnu.org; Wed, 02 Mar 2005 22:11:27 -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 1D6gP0-0006KQ-DN; Wed, 02 Mar 2005 21:49:26 -0500 Original-Received: from stupidch by shark.dnsvelocity.com with local (Exim 4.44) id 1D6gOk-000561-CM; Wed, 02 Mar 2005 21:49:10 -0500 Original-Received: from 220.255.169.59 ([220.255.169.59]) (SquirrelMail authenticated user cyd@stupidchicken.com) by www.stupidchicken.com with HTTP; Wed, 2 Mar 2005 21:49:10 -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:34122 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34122 > As I see it, the rationale for turning on require-final-newline is > that a particular type of file should always end in a newline. The > user should type RET himself, but in case he forgets to do so, Emacs > does it for him. So (newline) should be used. > > That is true. But those kinds of files are in special formats, not > human-language text. What is the motive for setting use-hard-newlines > in one of those buffers? Require-final-newline is a user option, and if a user customizes it to t then it is turned on for every buffer, even for human-language text. A user might do this if he want every file he edits to end in a newline. > The specific problem I am trying to solve is with Longlines mode > (which is not part of Emacs.) It is, in principle, impossible for > Longlines to distinguish between the soft newline inserted by > require-final-newline and the soft newline inserted by filling when > performing automatic line wrapping. > > "Automatic line wrapping" is not a normal Emacs term, and I am not > sure what you mean by it. Do you mean Auto Fill mode? If so, > longlines can distinguish the two cases because the newline inserted > by Auto Fill mode is not at the end of the line. > > If it means something else, could you please say what? Like Emacs' built-in Refill mode, Longlines does filling after every user command, except that it uses its own filling functions (for various reasons that have to do with simulating the behavior of "word-wrapped" text editors.) In any case, it makes use of use-hard-newlines to keep track of hard and soft newlines. 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, simply by looking at the context. Both are soft, and both occur at the end of a line. Both newlines might even occur at the end of a buffer, if that was the final line. But the first is conceptually a hard newline, and should not be converted into a space by filling; whereas the second is a "real" soft newline.