From: Tak Ota <Takaaki.Ota@am.sony.com>
Subject: insert-for-yank neglects yank-handlers
Date: Tue, 09 Dec 2003 18:34:58 -0800 (PST) [thread overview]
Message-ID: <20031209.183458.190217579.Takaaki.Ota@am.sony.com> (raw)
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 <Takaaki.Ota@am.sony.com>
;; 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 <Takaaki.Ota@am.sony.com>
;; 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).
reply other threads:[~2003-12-10 2:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20031209.183458.190217579.Takaaki.Ota@am.sony.com \
--to=takaaki.ota@am.sony.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.