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: Fri, 11 Mar 2005 21:40:51 -0500 (EST) Message-ID: <1444.220.255.169.59.1110595251.squirrel@220.255.169.59> References: <1483.220.255.172.231.1109730379.squirrel@www.stupidchicken.com> <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.220.255.169.59.1110546234.squirrel@www.stupidchic 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 1110596741 23389 80.91.229.2 (12 Mar 2005 03:05:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 12 Mar 2005 03:05:41 +0000 (UTC) Cc: emacs-devel@gnu.org, rms@gnu.org, "Kim F. Storm" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 12 04:05:40 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D9wwa-0006IQ-4w for ged-emacs-devel@m.gmane.org; Sat, 12 Mar 2005 04:05:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D9xBm-0007wi-8c for ged-emacs-devel@m.gmane.org; Fri, 11 Mar 2005 22:21:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D9xB6-0007hB-O7 for emacs-devel@gnu.org; Fri, 11 Mar 2005 22:20:38 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D9xB2-0007fF-II for emacs-devel@gnu.org; Fri, 11 Mar 2005 22:20:33 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D9xAz-0007ZU-TS for emacs-devel@gnu.org; Fri, 11 Mar 2005 22:20:29 -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 1D9wYr-0004K7-Pj; Fri, 11 Mar 2005 21:41:06 -0500 Original-Received: from stupidch by shark.dnsvelocity.com with local (Exim 4.44) id 1D9wYd-0006hQ-B3; Fri, 11 Mar 2005 21:40:51 -0500 Original-Received: from 220.255.169.59 ([220.255.169.59]) (SquirrelMail authenticated user cyd@stupidchicken.com); by www.stupidchicken.com with HTTP; Fri, 11 Mar 2005 21:40:51 -0500 (EST) In-Reply-To: <878y4uhyxa.fsf-monnier+emacs@gnu.org> Original-To: "Stefan Monnier" 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:34502 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34502 >> Sorry, I'm probably missing something, but I don't understand how this >> would work. > > Simple: it wouldn't use run-hook* (or maybe it would introduce a new > run-hook-filter). Not using a hook seems to be simpler than writing a new run-hook-filter function. How about the following? It seems to be a bit overengineered, but that's the only way to meet the various objections. (defvar kill-filters nil "List of functions for converting a string before it is killed. These are called by `kill-region' and `copy-region-as-kill' to convert a buffer substring before putting it into the kill ring and passing it to `interprogram-cut-function'. Each function must accept three arguments: STRING, BEG, and END. STRING is the string to be converted, and BEG and END are the position arguments given to `kill-region' or `copy-region-as-kill'. Each function must return a string. The buffer substring between BEG and END is passed as STRING to the first function in the list, and the return value of each function is passed as STRING to the next. The final return value is used as the killed string. If this variable is nil, no filtering is performed.")