From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: keymap in yank-excluded-properties Date: 26 Aug 2002 00:49:44 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <5x3ct2y2nr.fsf@kfs2.cua.dk> References: <20020822.173129.01368056.Takaaki.Ota@am.sony.com> <200208250525.g7P5PfH11882@wijiji.santafe.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1030312243 9371 127.0.0.1 (25 Aug 2002 21:50:43 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 25 Aug 2002 21:50:43 +0000 (UTC) Cc: Takaaki.Ota@am.sony.com, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17j5HN-0002R2-00 for ; Sun, 25 Aug 2002 23:50:41 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17j5lt-0007Nr-00 for ; Mon, 26 Aug 2002 00:22:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17j5Ie-0002TB-00; Sun, 25 Aug 2002 17:52:00 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17j5G7-0002Q1-00 for emacs-devel@gnu.org; Sun, 25 Aug 2002 17:49:23 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17j5G5-0002Pp-00 for emacs-devel@gnu.org; Sun, 25 Aug 2002 17:49:22 -0400 Original-Received: from mail.filanet.dk ([195.215.206.179]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17j5G4-0002Pj-00; Sun, 25 Aug 2002 17:49:20 -0400 Original-Received: from kfs2.cua.dk.cua.dk (unknown [10.1.82.3]) by mail.filanet.dk (Postfix) with SMTP id 5E7207C017; Sun, 25 Aug 2002 21:49:19 +0000 (GMT) Original-To: rms@gnu.org In-Reply-To: <200208250525.g7P5PfH11882@wijiji.santafe.edu> Original-Lines: 37 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:6876 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:6876 Richard Stallman writes: > Is it generally a good idea not to copy keymap text property? > > Yes--very much so. In most cases that leads to very confusing > results. > > What's correct to do for yanking a table? Yanking the whole table > ought to preserve its properties so that the table still functions as > one. Yanking a part of the table which can act as a complete table in > itself should also do that. However, yanking some of the text within > the table, which is less than a whole table entry, should forget that > it came from a table and treat it like any ordinary text. > > Does that make sense to you? If so, can you look for a design to > achieve those results? Perhaps a new text property `yank-function' which takes a function as value. `yank' will look for that property on kill-ring elements and call the function with one argument: the string (or rectangle?) to yank. The function is then responsible for inserting the string in the buffer and remove any unwanted properties [i.e. it is expected to do the actual insertion]. A table could have this property set to a function which check that the string to insert is really a complete table -- and keep the properties in that case [using insert] -- or remove the properties otherwise [using insert-for-yank]. This is a simple, but flexible concept which may be used for other purposes as well; for example, text killed by a "special" function [e.g. kill-rectangle] may be later inserted using plain C-y by another special function [e.g. insert-rectangle]. -- Kim F. Storm http://www.cua.dk