changeset 53368:6dab9150c9e0

(insert-for-yank): Call insert-for-yank-1 repetitively for each yank-handler segment. (insert-for-yank-1): New function, with the body of the previous insert-for-yank.
author Eli Zaretskii <eliz@is.elta.co.il>
date Mon, 29 Dec 2003 11:39:44 +0000
parents fbdcff26f02a
children e37aae745c21
files lisp/subr.el
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Mon Dec 29 11:29:31 2003 +0000
+++ b/lisp/subr.el	Mon Dec 29 11:39:44 2003 +0000
@@ -1563,7 +1563,18 @@
 (defvar yank-undo-function)
 
 (defun insert-for-yank (string)
+  "Calls `insert-for-yank-1' repetitively for each `yank-handler' segment.
+
+See `insert-for-yank-1' for more details."
+  (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).