emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: grep-tree doesn't shell-quote-argument]


From: Kim F. Storm
Subject: Re: address@hidden: grep-tree doesn't shell-quote-argument]
Date: Tue, 18 Apr 2006 16:02:44 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Richard Stallman <address@hidden> writes:

> Since M-x grep does not do this, I am not sure it is desirable
> to make M-x grep-tree incompatible with it.  But I don't use
> grep-tree.  What do others think?

M-x grep prompts for the entire command line, so the user can easily
add the necessary quoting of the regexp.

M-x grep-tree prompts individually for the regexp, files, and directory,
so I think it makes good sense to quote the regexp automatically.

It would make sense to rewrite the following line to use
shell-quote-argument as well:
>                      (and files (concat "-name '" files "'"))
i.e.
        (and files (concat "-name " (shell-quote-argument files)))

>
> From: Magnus Henoch <address@hidden>
> Subject: grep-tree doesn't shell-quote-argument
> To: address@hidden
> Date: Mon, 17 Apr 2006 23:17:14 +0200
> Mail-Followup-To: address@hidden
> Mail-Copies-To: never
>
> - --=-=-=
>
> grep-tree doesn't quote its regexp argument to protect it from the
> shell.  This makes it harder to use * and ? in regexps.  I propose
> this patch:
>
> 2006-04-17  Magnus Henoch  <address@hidden>
>
>       * progmodes/grep.el (grep-tree): Call shell-quote-argument on
>           regexp.
>
>
> - --=-=-=
> Content-Type: text/x-patch
> Content-Disposition: inline
>
> *** orig/lisp/progmodes/grep.el
> - --- mod/lisp/progmodes/grep.el
> ***************
> *** 631,637 ****
>         (setq files (cdr mf)))))
>     (let ((command-args (grep-expand-command-macros
>                      grep-tree-command
> !                    (setq grep-tree-last-regexp regexp)
>                      (and files (concat "-name '" files "'"))
>                      (if subdirs
>                          (if (stringp subdirs)
> - --- 632,638 ----
>         (setq files (cdr mf)))))
>     (let ((command-args (grep-expand-command-macros
>                      grep-tree-command
> !                    (shell-quote-argument (setq grep-tree-last-regexp 
> regexp))
>                      (and files (concat "-name '" files "'"))
>                      (if subdirs
>                          (if (stringp subdirs)
>
> - --=-=-=
> Content-Type: text/plain; charset="us-ascii"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline
>
> _______________________________________________
> emacs-pretest-bug mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
>
> - --=-=-=--
> ----------
>

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]