diff lisp/emulation/cua-base.el @ 108467:114b70461f96

CUA mode: Fix use of `filter-buffer-substring' (rework previous change). * emulation/cua-base.el (cua--filter-buffer-noprops): New function. (cua-repeat-replace-region): * emulation/cua-rect.el (cua--extract-rectangle, cua-incr-rectangle): * emulation/cua-gmrk.el (cua-copy-region-to-global-mark) (cua-cut-region-to-global-mark): Use it.
author Juanma Barranquero <lekktu@gmail.com>
date Mon, 10 May 2010 16:37:59 +0200
parents 41220cd25ea8
children 0d7ed8742a5f
line wrap: on
line diff
--- a/lisp/emulation/cua-base.el	Mon May 10 12:09:27 2010 +0000
+++ b/lisp/emulation/cua-base.el	Mon May 10 16:37:59 2010 +0200
@@ -780,6 +780,10 @@
     (setq mark-active nil)
     (run-hooks 'deactivate-mark-hook)))
 
+(defun cua--filter-buffer-noprops (start end)
+  (let ((str (filter-buffer-substring start end)))
+    (set-text-properties 0 (length str) nil str)
+    str))
 
 ;; The current register prefix
 (defvar cua--register nil)
@@ -1039,10 +1043,7 @@
 		    (setq s (car u))
 		  (setq s (car u) e (cdr u)))))))
 	  (cond ((and s e (<= s e) (= s (mark t)))
-		 (setq cua--repeat-replace-text
-		       (filter-buffer-substring s e))
-		 (set-text-properties 0 (length cua--repeat-replace-text)
-				      nil cua--repeat-replace-text))
+		 (setq cua--repeat-replace-text (cua--filter-buffer-noprops s e)))
 		((and (null s) (eq u elt)) ;; nothing inserted
 		 (setq cua--repeat-replace-text
 		       ""))