From: Eli Zaretskii <eliz@gnu.org>
To: Tino Calancha <tino.calancha@gmail.com>
Cc: 23959@debbugs.gnu.org
Subject: bug#23959: 25.0.94; find: missing argument to `-exec'
Date: Wed, 13 Jul 2016 17:45:00 +0300 [thread overview]
Message-ID: <83eg6xa977.fsf@gnu.org> (raw)
In-Reply-To: <alpine.DEB.2.20.1607131337490.26858@calancha-pc> (message from Tino Calancha on Wed, 13 Jul 2016 13:45:15 +0900 (JST))
> From: Tino Calancha <tino.calancha@gmail.com>
> Date: Wed, 13 Jul 2016 13:45:15 +0900 (JST)
>
> Thank you for the report.
> >I believe this is because the fish shell interprets the "{}" as a brace
> >expansion -- see
> >http://fishshell.com/docs/current/index.html#expand-brace -- and needs
> >the braces to be escaped. Editing the grep command using C-u and
> >inserting quotes around the braces makes it work as expected.
> Yes, braces should be escaped in commands to be processed by a shell.
> I am going to apply following patch to the master branch:
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
> diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
> index 2b44b58..f7f097b 100644
> --- a/lisp/progmodes/grep.el
> +++ b/lisp/progmodes/grep.el
> @@ -543,7 +543,9 @@ grep-compute-defaults
> (let* ((host-id
> (intern (or (file-remote-p default-directory) "localhost")))
> (host-defaults (assq host-id grep-host-defaults-alist))
> - (defaults (assq nil grep-host-defaults-alist)))
> + (defaults (assq nil grep-host-defaults-alist))
> + (quot-braces (shell-quote-argument "{}"))
> + (quot-scolon (shell-quote-argument ";")))
But shell-quote-argument is not documented to support fish shell, is
it? I think the problem is that the OP somehow sets up that shell as
the one used by Emacs when invoking shell commands, which is not a
recommended practice.
> - (format "%s %s{} +" cmd0 null)
> - (format "%s {} %s%s" cmd0 null
> - (shell-quote-argument ";")))
> + (format "%s %s%s +" cmd0 null quot-braces)
> + (format "%s %s %s%s" cmd0 quot-braces null
I'm not sure we can assume a quoted argument can be safely
concatenated to an unquoted one. (Yes, I know the original code used
that for the semi-colon.)
I can't say I'm happy with this solution, sorry. But thanks for
working on this problem.
next prev parent reply other threads:[~2016-07-13 14:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-12 19:27 bug#23959: 25.0.94; find: missing argument to `-exec' Ethan Glasser-Camp
2016-07-13 4:45 ` Tino Calancha
2016-07-13 14:45 ` Eli Zaretskii [this message]
2016-07-13 4:53 ` bug#23959: (no subject) Tino Calancha
2016-07-13 14:46 ` Eli Zaretskii
2016-07-13 14:52 ` Tino Calancha
2016-07-13 15:15 ` Eli Zaretskii
2016-07-13 15:55 ` Clément Pit--Claudel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83eg6xa977.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=23959@debbugs.gnu.org \
--cc=tino.calancha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).