Function: dired-do-query-replace-regexp

dired-do-query-replace-regexp is an autoloaded, interactive and byte-compiled function defined in dired-aux.el.gz.

Signature

(dired-do-query-replace-regexp FROM TO &optional DELIMITED)

Documentation

Do query-replace-regexp of FROM with TO, on all marked files.

As each match is found, the user must type a character saying what to do with it. Type SPC or y to replace the match, DEL or n to skip and go to the next match. For more directions, type <f1> (help-command) at that time.

Third arg DELIMITED (prefix arg) means replace only word-delimited matches. If you exit the query-replace loop (C-g (keyboard-quit), RET or q), you can resume the query replace with the command M-x fileloop-continue (fileloop-continue).

Probably introduced at or before Emacs version 23.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/dired-aux.el.gz
;;;###autoload
(defun dired-do-query-replace-regexp (from to &optional delimited)
  "Do `query-replace-regexp' of FROM with TO, on all marked files.
As each match is found, the user must type a character saying
what to do with it.  Type SPC or `y' to replace the match,
DEL or `n' to skip and go to the next match.  For more directions,
type \\[help-command] at that time.

Third arg DELIMITED (prefix arg) means replace only word-delimited matches.
If you exit the query-replace loop (\\[keyboard-quit], RET or q), you can
resume the query replace with the command \\[fileloop-continue]."
  (interactive
   (let ((common
	  (query-replace-read-args
	   "Query replace regexp in marked files" t t)))
     (list (nth 0 common) (nth 1 common) (nth 2 common)))
   dired-mode)
  (dolist (file (dired-get-marked-files nil nil #'dired-nondirectory-p nil t))
    (let ((buffer (get-file-buffer file)))
      (if (and buffer (with-current-buffer buffer
			buffer-read-only))
	  (error "File `%s' is visited read-only" file))))
  (dired-post-do-command)
  (fileloop-initialize-replace
   from to (dired-get-marked-files nil nil #'dired-nondirectory-p)
   (if (equal from (downcase from)) nil 'default)
   delimited)
  (fileloop-continue))