• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/

Lines Matching +defs:replace +defs:regexp

51 (defconst dired-star-subst-regexp "\\(^\\|[ \t]\\)\\*\\([ \t]\\|$\\)")
52 (defconst dired-quark-subst-regexp "\\(^\\|[ \t]\\)\\?\\([ \t]\\|$\\)")
518 (let* ((on-each (not (string-match dired-star-subst-regexp command)))
519 (subst (not (string-match dired-quark-subst-regexp command)))
560 (if (or (string-match dired-star-subst-regexp command)
561 (string-match dired-quark-subst-regexp command))
566 (setq retval (replace-match x t t retval 2)))
672 (regexp (dired-marker-regexp)))
674 (re-search-forward regexp nil t))
701 ;; Now replace the current line with an entry for NEW-FILE.
1247 (to-file (dired-replace-in-string
1248 (concat "^" (regexp-quote from-dir))
1292 (let ((regexp (regexp-quote (directory-file-name dir)))
1297 (if (not (looking-at dired-subdir-regexp))
1301 (if (re-search-forward regexp (match-end 1) t)
1302 (replace-match newtext t t)
1307 (dired-replace-in-string regexp newtext (car elt)))))
1642 (defun dired-do-create-files-regexp
1643 (file-creator operation arg regexp newname &optional whole-name marker-char)
1648 ;; filename from NEWNAME (like in function replace-match).
1649 ;; Optional arg WHOLE-NAME means match/replace the whole file name
1655 (rename-regexp-help-form (format "\
1660 (regexp-name-constructor
1665 (let ((to (dired-string-replace-match regexp from newname))
1668 (help-form rename-regexp-help-form))
1670 (and (dired-query 'rename-regexp-query
1675 (dired-log "%s: %s did not match regexp %s\n"
1676 operation from regexp)))))
1677 ;; not whole-name, replace non-directory part only
1680 (let* ((new (dired-string-replace-match
1681 regexp (file-name-nondirectory from) newname))
1685 (help-form rename-regexp-help-form))
1687 (and (dired-query 'rename-regexp-query
1692 (dired-log "%s: %s did not match regexp %s\n"
1693 operation (file-name-nondirectory from) regexp)))))))
1694 rename-regexp-query)
1696 file-creator operation fn-list regexp-name-constructor marker-char)))
1698 (defun dired-mark-read-regexp (operation)
1700 ;; Read and return list of: regexp newname arg whole-name.
1705 (regexp
1706 (dired-read-regexp
1707 (concat (if whole-name "Abs. " "") operation " from (regexp): ")))
1710 (concat (if whole-name "Abs. " "") operation " " regexp " to: "))))
1711 (list regexp newname arg whole-name)))
1714 (defun dired-do-rename-regexp (regexp newname &optional arg whole-name)
1723 NEWNAME may contain \\=\\<n> or \\& as in `query-replace-regexp'.
1724 REGEXP defaults to the last regexp used.
1726 With a zero prefix arg, renaming by regexp affects the absolute file name.
1728 (interactive (dired-mark-read-regexp "Rename"))
1729 (dired-do-create-files-regexp
1731 "Rename" arg regexp newname whole-name dired-keep-marker-rename))
1734 (defun dired-do-copy-regexp (regexp newname &optional arg whole-name)
1736 See function `dired-do-rename-regexp' for more info."
1737 (interactive (dired-mark-read-regexp "Copy"))
1739 (dired-do-create-files-regexp
1742 arg regexp newname whole-name dired-keep-marker-copy)))
1745 (defun dired-do-hardlink-regexp (regexp newname &optional arg whole-name)
1747 See function `dired-do-rename-regexp' for more info."
1748 (interactive (dired-mark-read-regexp "HardLink"))
1749 (dired-do-create-files-regexp
1751 "HardLink" arg regexp newname whole-name dired-keep-marker-hardlink))
1754 (defun dired-do-symlink-regexp (regexp newname &optional arg whole-name)
1756 See function `dired-do-rename-regexp' for more info."
1757 (interactive (dired-mark-read-regexp "SymLink"))
1758 (dired-do-create-files-regexp
1760 "SymLink" arg regexp newname whole-name dired-keep-marker-symlink))
1890 (setq switches (dired-replace-in-string "R" "" switches))
1994 (dired-replace-in-string "R" "" dired-actual-switches))))
2055 "Splitting on regexp PAT, turn string STR into a list of substrings.
2058 Thus, if SEP is a regexp that only matches itself,
2272 (defun dired-do-search (regexp)
2276 (interactive "sSearch marked files (regexp): ")
2277 (tags-search regexp '(dired-get-marked-files nil nil 'dired-nondirectory-p)))
2280 (defun dired-do-query-replace-regexp (from to &optional delimited)
2281 "Do `query-replace-regexp' of FROM with TO, on all marked files.
2282 Third arg DELIMITED (prefix arg) means replace only word-delimited matches.
2283 If you exit (\\[keyboard-quit], RET or q), you can resume the query replace
2287 (query-replace-read-args
2288 "Query replace regexp in marked files" t t)))
2295 (tags-query-replace from to delimited