From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Chong Yidong" Newsgroups: gmane.emacs.devel Subject: Re: require-hard-newlines to use newline Date: Sun, 13 Mar 2005 01:14:32 -0500 (EST) Message-ID: <49420.203.116.59.23.1110694472.squirrel@203.116.59.23> 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> <1404.220.255.169.59.1109889146.squirrel@www.stupidchicken.com> <200503040033.j240XD022473@raven.dms.auburn.edu> <50554.203.116.59.23.1109897782.squirrel@www.stupidchicken.com> <200503080005.j2805Kg28696@raven.dms.auburn.edu> <2451.220.255.169.59.1110299961.squirrel@www.stupidchicken.com> <2518.220.255.169.59.1110532203.squirrel@www.stupidchicken.com> <3222 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 1110696124 26043 80.91.229.2 (13 Mar 2005 06:42:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 13 Mar 2005 06:42:04 +0000 (UTC) Cc: storm@cua.dk, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 13 07:42:04 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DAMn7-0001Ae-If for ged-emacs-devel@m.gmane.org; Sun, 13 Mar 2005 07:41:33 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DAN2X-0007Ge-EJ for ged-emacs-devel@m.gmane.org; Sun, 13 Mar 2005 01:57:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DAN2F-0007FJ-RY for emacs-devel@gnu.org; Sun, 13 Mar 2005 01:57:12 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DAMwz-0005sd-U1 for emacs-devel@gnu.org; Sun, 13 Mar 2005 01:51:53 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DAMws-0005mc-T7 for emacs-devel@gnu.org; Sun, 13 Mar 2005 01:51:38 -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 1DAMNI-0008Cu-1H; Sun, 13 Mar 2005 01:14:52 -0500 Original-Received: from stupidch by shark.dnsvelocity.com with local (Exim 4.44) id 1DAMMy-00027P-2C; Sun, 13 Mar 2005 01:14:32 -0500 Original-Received: from 203.116.59.23 ([203.116.59.23]) (SquirrelMail authenticated user cyd@stupidchicken.com); by stupidchicken.com with HTTP; Sun, 13 Mar 2005 01:14:32 -0500 (EST) In-Reply-To: Original-To: rms@gnu.org User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a 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: news.gmane.org gmane.emacs.devel:34534 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34534 > It only does a part of the job. It handles kill, but not registers, > etc. I think it is implemented at the wrong level. > >> (defvar kill-filters nil >> "List of functions for converting a string before it is killed. >> Each function should accept a single argument, a string, and >> return a string. > > That is more the right idea, for the part that reads from > the buffer. But it is not correct to associate this with > killing. Think of it as a variant of buffer-substring. By this, I'm guessing you mean going to a lower level, e.g. calling the filter functions from inside buffer-substring. I'll look into this, but I doubt it's worth it. The current behavior of longlines.el, which is to filter at the level of kill-region and copy-region-as-kill, addresses the main requirement of users -- removing the soft newlines when copying into another program or yanking into a non-longlines buffer. All the bugs here have been pretty much ironed out. It doesn't deal with *all* the situations where filtering might be good, like copy-to-register, but we could simply make those commands use the filter too. buffer-substring is called in many, many places, and I'm not confident that filtering is appropriate everywhere. For example, fill.el calls buffer-substring all over the place, and one feature of longlines is that M-q still works as usual; changing buffer-substring may screw it up. I suggest implementing the `kill-filter' variable I proposed; then I will change longlines.el to use it, and we can put longlines.el into Emacs. This version of longlines.el will be the same as the existing "third-party" longlines.el, except it won't use advice. A future version can implement something more elegant. (I have other plans for longlines.el too, including providing word wrap for files which are already full of hard newlines.)