mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-30 12:21:25 -08:00
(find-dired): Use shell-quote-argument to properly
escape ( and ) args. Also use it on {} and ; args in default
value of find-ls-option string.
(find-grep-dired): Use shell-quote-argument on {} and ; args.
This commit is contained in:
parent
31bf51258a
commit
2fda9976e9
1 changed files with 15 additions and 3 deletions
|
|
@ -129,8 +129,17 @@ as the final argument."
|
|||
args (concat find-dired-find-program " . "
|
||||
(if (string= args "")
|
||||
""
|
||||
(concat "\\( " args " \\) "))
|
||||
(car find-ls-option)))
|
||||
(concat
|
||||
(shell-quote-argument "(")
|
||||
" " args " "
|
||||
(shell-quote-argument ")")
|
||||
" "))
|
||||
(if (equal (car find-ls-option) "-exec ls -ld {} \\;")
|
||||
(concat "-exec ls -ld "
|
||||
(shell-quote-argument "{}")
|
||||
" "
|
||||
(shell-quote-argument ";"))
|
||||
(car find-ls-option))))
|
||||
;; Start the find process.
|
||||
(shell-command (concat args "&") (current-buffer))
|
||||
;; The next statement will bomb in classic dired (no optional arg allowed)
|
||||
|
|
@ -215,7 +224,10 @@ Thus ARG can also contain additional grep options."
|
|||
(find-dired dir
|
||||
(concat "-type f -exec grep " find-grep-options " -e "
|
||||
(shell-quote-argument regexp)
|
||||
" {} \\\; ")))
|
||||
" "
|
||||
(shell-quote-argument "{}")
|
||||
" "
|
||||
(shell-quote-argument ";"))))
|
||||
|
||||
(defun find-dired-filter (proc string)
|
||||
;; Filter for \\[find-dired] processes.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue