comparison 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
comparison
equal deleted inserted replaced
108466:a30c85fa75e8 108467:114b70461f96
778 (if (not now) 778 (if (not now)
779 (setq deactivate-mark t) 779 (setq deactivate-mark t)
780 (setq mark-active nil) 780 (setq mark-active nil)
781 (run-hooks 'deactivate-mark-hook))) 781 (run-hooks 'deactivate-mark-hook)))
782 782
783 (defun cua--filter-buffer-noprops (start end)
784 (let ((str (filter-buffer-substring start end)))
785 (set-text-properties 0 (length str) nil str)
786 str))
783 787
784 ;; The current register prefix 788 ;; The current register prefix
785 (defvar cua--register nil) 789 (defvar cua--register nil)
786 790
787 (defun cua--prefix-arg (arg) 791 (defun cua--prefix-arg (arg)
1037 ((and (consp u) (integerp (car u)) (integerp (cdr u))) 1041 ((and (consp u) (integerp (car u)) (integerp (cdr u)))
1038 (if (and s (= (cdr u) s)) 1042 (if (and s (= (cdr u) s))
1039 (setq s (car u)) 1043 (setq s (car u))
1040 (setq s (car u) e (cdr u))))))) 1044 (setq s (car u) e (cdr u)))))))
1041 (cond ((and s e (<= s e) (= s (mark t))) 1045 (cond ((and s e (<= s e) (= s (mark t)))
1042 (setq cua--repeat-replace-text 1046 (setq cua--repeat-replace-text (cua--filter-buffer-noprops s e)))
1043 (filter-buffer-substring s e))
1044 (set-text-properties 0 (length cua--repeat-replace-text)
1045 nil cua--repeat-replace-text))
1046 ((and (null s) (eq u elt)) ;; nothing inserted 1047 ((and (null s) (eq u elt)) ;; nothing inserted
1047 (setq cua--repeat-replace-text 1048 (setq cua--repeat-replace-text
1048 "")) 1049 ""))
1049 (t 1050 (t
1050 (message "Cannot locate replacement text")))))) 1051 (message "Cannot locate replacement text"))))))