Function: vip-replace-string

vip-replace-string is an interactive and byte-compiled function defined in vip.el.gz.

Signature

(vip-replace-string)

Documentation

Replace string. If you supply null string as the string to be replaced, the query replace mode will toggle between string replace and regexp replace.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/vip.el.gz
(defun vip-replace-string ()
  "Replace string.  If you supply null string as the string to be replaced,
the query replace mode will toggle between string replace and regexp replace."
  (interactive)
  (let (str)
    (setq str (vip-read-string
	       (if vip-re-replace "Replace regexp: " "Replace string: ")))
    (if (string= str "")
	(progn
	  (setq vip-re-replace (not vip-re-replace))
	  (message "Replace mode changed to %s."
		   (if vip-re-replace "regexp replace"
		     "string replace")))
      (if vip-re-replace
	  ;; (replace-regexp
	  ;;  str
	  ;;  (vip-read-string (format "Replace regexp \"%s\" with: " str)))
	  (while (re-search-forward str nil t)
	    (replace-match (vip-read-string
			    (format "Replace regexp \"%s\" with: " str))
			   nil nil))
	(with-no-warnings
	  (replace-string
	   str
	   (vip-read-string (format "Replace \"%s\" with: " str))))))))