From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#23959: 25.0.94; find: missing argument to `-exec' Date: Wed, 13 Jul 2016 17:45:00 +0300 Message-ID: <83eg6xa977.fsf@gnu.org> References: <87r3ayodw4.fsf@betacantrips.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1468421188 31756 80.91.229.3 (13 Jul 2016 14:46:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Jul 2016 14:46:28 +0000 (UTC) Cc: 23959@debbugs.gnu.org To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 13 16:46:16 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bNLQV-0004MP-DY for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Jul 2016 16:46:15 +0200 Original-Received: from localhost ([::1]:48166 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNLQU-00071i-QY for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Jul 2016 10:46:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNLQM-0006za-Gp for bug-gnu-emacs@gnu.org; Wed, 13 Jul 2016 10:46:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNLQI-0007Pq-0q for bug-gnu-emacs@gnu.org; Wed, 13 Jul 2016 10:46:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37598) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNLQH-0007Pa-TN for bug-gnu-emacs@gnu.org; Wed, 13 Jul 2016 10:46:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bNLQH-0003RG-Lz for bug-gnu-emacs@gnu.org; Wed, 13 Jul 2016 10:46:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 13 Jul 2016 14:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23959 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23959-submit@debbugs.gnu.org id=B23959.146842112713175 (code B ref 23959); Wed, 13 Jul 2016 14:46:01 +0000 Original-Received: (at 23959) by debbugs.gnu.org; 13 Jul 2016 14:45:27 +0000 Original-Received: from localhost ([127.0.0.1]:49935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNLPj-0003QQ-6L for submit@debbugs.gnu.org; Wed, 13 Jul 2016 10:45:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60264) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNLPg-0003QC-R7 for 23959@debbugs.gnu.org; Wed, 13 Jul 2016 10:45:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNLPX-00077V-O8 for 23959@debbugs.gnu.org; Wed, 13 Jul 2016 10:45:18 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55510) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNLPX-00077G-KR; Wed, 13 Jul 2016 10:45:15 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3840 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bNLPV-0006Xc-Ql; Wed, 13 Jul 2016 10:45:14 -0400 In-reply-to: (message from Tino Calancha on Wed, 13 Jul 2016 13:45:15 +0900 (JST)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:120995 Archived-At: > From: Tino Calancha > 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.