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: Wed, 9 Mar 2005 04:45:53 -0500 (EST) Message-ID: <1627.220.255.169.59.1110361553.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> <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> 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 1110365448 12136 80.91.229.2 (9 Mar 2005 10:50:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 9 Mar 2005 10:50:48 +0000 (UTC) Cc: miles@gnu.org, snogglethorpe@gmail.com, Luc Teirlinck , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 09 11:50:47 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D8yl5-0004N1-TX for ged-emacs-devel@m.gmane.org; Wed, 09 Mar 2005 11:49:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D8yuZ-0002aB-Kq for ged-emacs-devel@m.gmane.org; Wed, 09 Mar 2005 05:59:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D8yGn-00011X-Qv for emacs-devel@gnu.org; Wed, 09 Mar 2005 05:18:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D8yGi-0000zp-4B for emacs-devel@gnu.org; Wed, 09 Mar 2005 05:18:23 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D8yGg-0000h5-H2 for emacs-devel@gnu.org; Wed, 09 Mar 2005 05:18:18 -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 1D8xlN-0007KO-7O; Wed, 09 Mar 2005 04:45:57 -0500 Original-Received: from stupidch by shark.dnsvelocity.com with local (Exim 4.44) id 1D8xlJ-0007e4-2l; Wed, 09 Mar 2005 04:45:53 -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, 9 Mar 2005 04:45:53 -0500 (EST) In-Reply-To: <2451.220.255.169.59.1110299961.squirrel@www.stupidchicken.com> 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: news.gmane.org gmane.emacs.devel:34363 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34363 > 2. Defining two new abnormal hooks, maybe named yank-encode-functions and > kill-encode-functions, to be called by kill-region etc (or possibly the > lower-level functions like kill-new and kill-append.) Each function would > be called with one argument, the yanked or killed string, and return an > encoded string to be passed to the next function, or to the buffer/kill > ring. On further consideration, there seems to be some overlap between the above suggestion and the yank-handler text property (new to Emacs 22). It may be better to a variable called `yank-handlers' which is a list of yank handlers to use. The yank functions could then read from both yank-handlers and the yank-handler text property. There is one problem, however: currently, the function specified by the yank-handler text property is called *instead* of insert, to insert the desired text. According to NEWS, this is to allow it to do things like yanking rectanges. Such a function obviously cannot "stack", so what happens if yank-handlers and the yank-handler text property are both defined? My original idea was to have the functions specified by yank-handlers return a string to be passed to the next handler, but (i) this would be an incompatibility with the text property, and (ii) it won't be able to perform more general operations like yanking rectangles. I would also still need an analogous kill-handlers variable for encoding kills, i.e. stripping out newlines from the killed text (it's not enough to use a yank handler, because the killed text could be pasted into an external program via the X selection or clipboard.)