From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Tak Ota Newsgroups: gmane.emacs.devel Subject: insert-for-yank neglects yank-handlers Date: Tue, 09 Dec 2003 18:34:58 -0800 (PST) Organization: Sony Electronics Inc. Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20031209.183458.190217579.Takaaki.Ota@am.sony.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1071024109 15821 80.91.224.253 (10 Dec 2003 02:41:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 10 Dec 2003 02:41:49 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Dec 10 03:41:43 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ATuIJ-0000hn-00 for ; Wed, 10 Dec 2003 03:41:43 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1ATuIJ-00066f-00 for ; Wed, 10 Dec 2003 03:41:43 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ATvEL-0008IG-AS for emacs-devel@quimby.gnus.org; Tue, 09 Dec 2003 22:41:41 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ATvDV-0007tQ-Sg for emacs-devel@gnu.org; Tue, 09 Dec 2003 22:40:49 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1ATvCk-0006ct-Mj for emacs-devel@gnu.org; Tue, 09 Dec 2003 22:40:34 -0500 Original-Received: from [160.33.82.73] (helo=mail6.fw-sj.sony.com) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ATvCi-0006VT-Cp for emacs-devel@gnu.org; Tue, 09 Dec 2003 22:40:00 -0500 Original-Received: from mail1.bc.in.sel.sony.com (mail1.bc.in.sel.sony.com [43.144.65.111]) by mail6.fw-sj.sony.com (8.8.8/8.8.8) with ESMTP id CAA18577 for ; Wed, 10 Dec 2003 02:38:32 GMT Original-Received: by mail1.bc.in.sel.sony.com id CAA29625; Wed, 10 Dec 2003 02:38:31 GMT Original-To: emacs-devel@gnu.org X-Telephone: +1-858-942-3239 X-Fax------: +1-858-942-9142 X-SnailMail: 16450 West Bernardo Drive MZ7205, San Diego, CA 92127-1804 X-Mailer: Mew-4.0.62 on Emacs-21.3.50.1 (i386-msvc-nt5.0.2195) of 2003-12-05 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:18597 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:18597 The following patch to table.el takes advantage of the new yank-handler property and preserves active table functionality after kill/copy and paste. However table properties are scattered and most likely the first character of the copied string wouldn't have that property. Is the following patch to insert-for-yank acceptable to correct this shortcoming? If so could someone commit these changes to the CVS? Thank you. -Tak *** ../../../pub/emacs/emacs-21.3.50/lisp/textmodes/table.el Mon Sep 1 08:45:40 2003 --- textmodes/table.el Tue Dec 9 14:36:50 2003 *************** *** 5,11 **** ;; Keywords: wp, convenience ;; Author: Takaaki Ota ;; Created: Sat Jul 08 2000 13:28:45 (PST) ! ;; Revised: jue jun 05 2003 22:00:02 (Hora de verano romance) ;; This file is part of GNU Emacs. --- 5,11 ---- ;; Keywords: wp, convenience ;; Author: Takaaki Ota ;; Created: Sat Jul 08 2000 13:28:45 (PST) ! ;; Revised: Tue Dec 09 2003 14:36:50 (PST) ;; This file is part of GNU Emacs. *************** *** 837,842 **** --- 837,845 ---- :type 'hook :group 'table-hooks) + (defcustom table-yank-handler '(nil nil t nil) + "*yank-handler for table.") + (setplist 'table-disable-incompatibility-warning nil) (defvar table-disable-menu (null (and (locate-library "easymenu") *************** *** 5228,5234 **** (defun table--put-cell-indicator-property (beg end &optional object) "Put cell property which indicates that the location is within a table cell." ! (put-text-property beg end 'table-cell t object)) (defun table--put-cell-face-property (beg end &optional object) "Put cell face property." --- 5231,5238 ---- (defun table--put-cell-indicator-property (beg end &optional object) "Put cell property which indicates that the location is within a table cell." ! (put-text-property beg end 'table-cell t object) ! (put-text-property beg end 'yank-handler table-yank-handler object)) (defun table--put-cell-face-property (beg end &optional object) "Put cell face property." *** ../../../pub/emacs/emacs-21.3.50/lisp/subr.el Sun Nov 30 11:03:49 2003 --- subr.el Tue Dec 9 18:10:07 2003 *************** *** 1563,1568 **** --- 1563,1576 ---- (defvar yank-undo-function) (defun insert-for-yank (string) + "Calls `insert-for-yank-1' repetitively for each `yank-handler' segment." + (let (to) + (while (setq to (next-single-property-change 0 'yank-handler string)) + (insert-for-yank-1 (substring string 0 to)) + (setq string (substring string to)))) + (insert-for-yank-1 string)) + + (defun insert-for-yank-1 (string) "Insert STRING at point, stripping some text properties. Strip text properties from the inserted text according to `yank-excluded-properties'. Otherwise just like (insert STRING).