From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: require-hard-newlines to use newline Date: Sat, 12 Mar 2005 17:16:03 -0500 Message-ID: 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 Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1110667018 8771 80.91.229.2 (12 Mar 2005 22:36:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 12 Mar 2005 22:36:58 +0000 (UTC) Cc: emacs-devel@gnu.org, storm@cua.dk Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 12 23:36:58 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DAFE4-0005t6-1H for ged-emacs-devel@m.gmane.org; Sat, 12 Mar 2005 23:36:52 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DAFPv-0008Oj-JD for ged-emacs-devel@m.gmane.org; Sat, 12 Mar 2005 17:49:07 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DAFPR-0008L8-3s for emacs-devel@gnu.org; Sat, 12 Mar 2005 17:48:37 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DAFPI-0008H1-Ui for emacs-devel@gnu.org; Sat, 12 Mar 2005 17:48:29 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DAFPI-0008Bm-NW for emacs-devel@gnu.org; Sat, 12 Mar 2005 17:48:28 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DAEtw-0002tW-8V for emacs-devel@gnu.org; Sat, 12 Mar 2005 17:16:04 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1DAEtv-0002xs-3L; Sat, 12 Mar 2005 17:16:03 -0500 Original-To: "Chong Yidong" In-reply-to: <3222.220.255.169.59.1110546234.squirrel@www.stupidchicken.com> (cyd@stupidchicken.com) 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:34522 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34522 > If we agree that those hooks are the proper approach, and you can > write the proper doc for them, this is a trivial change, so I don't > see why we have to wait. Okay then. How about this patch? It only does a part of the job. It handles kill, but not registers, etc. I think it is implemented at the wrong level. Stefan wrote: I think it's usually important to keep the property that killing doesn't modify the buffer's text (when used in copy-as-kill), so rather than having before-kill-functions modify the buffer's text just before it's put in the kill-ring, it would be more convenient to make it return the string, i.e. use it as a replacement for buffer-substring. That is true, too. Another possibility is not to use a hook at all, e.g.: (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. But that makes it difficult to process the string in a way that depends on its context. Maybe so, but is it necessary to do that?