comparison lisp/emulation/cua-gmrk.el @ 69902:eea8aee5048b

(cua-copy-region-to-global-mark) (cua-cut-region-to-global-mark): Use filter-buffer-substring.
author Kim F. Storm <storm@cua.dk>
date Sun, 09 Apr 2006 23:04:33 +0000
parents 067115a6e738
children 7a3f13e2dd57 c156f6a9e7b5
comparison
equal deleted inserted replaced
69901:a1cf3efe0a2c 69902:eea8aee5048b
141 (interactive "r") 141 (interactive "r")
142 (if (cua--global-mark-active) 142 (if (cua--global-mark-active)
143 (let ((src-buf (current-buffer))) 143 (let ((src-buf (current-buffer)))
144 (save-excursion 144 (save-excursion
145 (if (equal (marker-buffer cua--global-mark-marker) src-buf) 145 (if (equal (marker-buffer cua--global-mark-marker) src-buf)
146 (let ((text (buffer-substring-no-properties start end))) 146 (let ((text (filter-buffer-substring start end nil t)))
147 (goto-char (marker-position cua--global-mark-marker)) 147 (goto-char (marker-position cua--global-mark-marker))
148 (insert text)) 148 (insert text))
149 (set-buffer (marker-buffer cua--global-mark-marker)) 149 (set-buffer (marker-buffer cua--global-mark-marker))
150 (goto-char (marker-position cua--global-mark-marker)) 150 (goto-char (marker-position cua--global-mark-marker))
151 (insert-buffer-substring-as-yank src-buf start end)) 151 (insert-buffer-substring-as-yank src-buf start end))
165 (save-excursion 165 (save-excursion
166 (if (equal (marker-buffer cua--global-mark-marker) src-buf) 166 (if (equal (marker-buffer cua--global-mark-marker) src-buf)
167 (if (and (< start (marker-position cua--global-mark-marker)) 167 (if (and (< start (marker-position cua--global-mark-marker))
168 (< (marker-position cua--global-mark-marker) end)) 168 (< (marker-position cua--global-mark-marker) end))
169 (message "Can't move region into itself") 169 (message "Can't move region into itself")
170 (let ((text (buffer-substring-no-properties start end)) 170 (let ((text (filter-buffer-substring start end nil t))
171 (p1 (copy-marker start)) 171 (p1 (copy-marker start))
172 (p2 (copy-marker end))) 172 (p2 (copy-marker end)))
173 (goto-char (marker-position cua--global-mark-marker)) 173 (goto-char (marker-position cua--global-mark-marker))
174 (insert text) 174 (insert text)
175 (cua--activate-global-mark) 175 (cua--activate-global-mark)