Function: tpu-substitute

tpu-substitute is an interactive and byte-compiled function defined in tpu-edt.el.gz.

Signature

(tpu-substitute NUM)

Documentation

Replace the selected region with the contents of the cut buffer, and repeat most recent search. A numeric argument serves as a repeat count. A negative argument means replace all occurrences of the search string.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/tpu-edt.el.gz
(defun tpu-substitute (num)
  "Replace the selected region with the contents of the cut buffer,
and repeat most recent search.  A numeric argument serves as a repeat count.
A negative argument means replace all occurrences of the search string."
  (interactive "p")
  (cond ((or (tpu-mark) (tpu-check-match))
	 (while (and (not (= num 0)) (or (tpu-mark) (tpu-check-match)))
	   (let ((beg (point)))
	     (tpu-replace)
	     (if tpu-searching-forward (forward-char -1) (goto-char beg))
	     (if (= num 1) (tpu-search-internal tpu-search-last-string)
	       (tpu-search-internal-core tpu-search-last-string)))
	   (setq num (1- num))))
	(t
	 (tpu-error "No selection active."))))