Function: delete-selection-repeat-replace-region
delete-selection-repeat-replace-region is an interactive and
byte-compiled function defined in delsel.el.gz.
Signature
(delete-selection-repeat-replace-region ARG)
Documentation
Repeat replacing text of highlighted region with typed text.
Search for the next stretch of text identical to the region last replaced
by typing text over it and replaces it with the same stretch of text.
With ARG (interactively, prefix numeric argument), repeat that many times.
Just C-u (universal-argument) means repeat until the end of the buffer's accessible portion.
This function requires the last replacement to be available in a register,
so it does not work when delete-selection-save-to-register is nil.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/delsel.el.gz
(defun delete-selection-repeat-replace-region (arg)
"Repeat replacing text of highlighted region with typed text.
Search for the next stretch of text identical to the region last replaced
by typing text over it and replaces it with the same stretch of text.
With ARG (interactively, prefix numeric argument), repeat that many times.
Just `\\[universal-argument]' means repeat until the end of the buffer's accessible portion.
This function requires the last replacement to be available in a register,
so it does not work when `delete-selection-save-to-register' is nil."
(interactive "P")
(unless delete-selection-save-to-register
(user-error "Can't work without delete-selection-save-to-register"))
(let ((old-text (get-register delete-selection-save-to-register))
(count (if (consp arg) (point-max)
(prefix-numeric-value current-prefix-arg))))
(if (not (and old-text (> (length old-text) 0)))
(message "No known previous replacement")
(let ((string (delete-selection--replacement-text)))
(if string
(while (and (> count 0)
string
(search-forward old-text nil t))
(replace-match string nil t)
(setq count (1- count)))
(message "Cannot locate replacement text"))))))