* insert-for-yank neglects yank-handlers
@ 2003-12-10 2:34 Tak Ota
0 siblings, 0 replies; only message in thread
From: Tak Ota @ 2003-12-10 2:34 UTC (permalink / 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).
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-12-10 2:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-10 2:34 insert-for-yank neglects yank-handlers Tak Ota
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.